Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Git tips

From MoodleDocs
Revision as of 12:31, 2 October 2008 by Dan Poltawski (talk | contribs) (added seelaso)

Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.

Thorough Resolved Bug QA review with git

The power of having fast access to all of moodle commit history means we can search and checkout any point in moodle source code history which allows us to powerfully QA a bug.

Please note this workflow might not be ideal for all scenarios (for example if lots of work has been done in the same area since).

Example Workflow to QA MDL-16600:

First checkout a new branch for us to work on testing the bug in MOODLE_19_STABLE. We can delete this branch later, its less dangerous than playing any of our 'live' branches.

$ git checkout -b QA-MDL-16600 origin/MOODLE_19_STABLE
Branch QA-MDL-16600 set up to track remote branch refs/remotes/origin/MOODLE_19_STABLE.
Switched to a new branch "QA-MDL-16600"

Now search for any commits related to this bug fix:

$  git log --grep='MDL-16600'
commit 1c2c8b09469ac27a3829e7267f399356a05b9810
Author: tjhunt <tjhunt>
Date:   Fri Sep 26 05:49:06 2008 +0000

    MDL-16600 forcedownload broken for file resources.

In order to test that these commits fixed the bug, we will revert this commit, and then try to reproduce the reported bug:

$ git revert -n 1c2c8b09469ac27a3829e7267f399356a05b9810 

Once we've reproduced the problem, we will reset our repository back to HEAD:

git reset --hard HEAD

Now if the bug is fixed, it can be closed and we can delete our branch:

git branch -D QA-MDL-16600

See Also

Using GIT to backup moodledata