As part of gnome’s GSoC project, I was learning to submit a patch to gnome, so I thought : Why not blog about it ?
The mundane way to submit a patch is by using git to make a patch file (using format-patch) and attaching it to the bug. But this is way to tiresome ! Here we use the git bz utility (gnome’s recommended way of doing this) to automatically send the patch to bugzilla which is a lot easier. Later, this same patch can be updated
Step 1 : Save the git-bz link to /bin/git-bz or /usr/bin/git-bz (anywhere that your terminal can find it) and make it executable:
cd /usr/local/bin sudo wget http://git.fishsoup.net/cgit/git-bz/plain/git-bz sudo chmod a+x git-bz
Step 2 : Now, open firefox and make sure to be logged into gnome’s bugzilla. And also, find the number of the bug you wish to attach a patch to.
Step 3 : Create a branch where you will keep all your changes
git checkout -b my/new/testbed
Step 4 : Now, make the changes you want to submit as a patch.
Step 5 : Add all your files and commit using the following commands:
git add -i . git commit -a -m "some message here"
Step 6 : Run the following command to apply your last commit as a patch to the bug:
git bz attach nnnnnn HEAD
And, that’s all there is to it !