Thursday, December 04, 2008

Changes to git mirror of Firefox repository

I've made changes to the way I manage the git repository holding the import of the Firefox source. Since the bulk of the HTML 5 <video> implementation is now in the main Firefox source I no longer maintain the video branch. I'll be removing that and the Firefox mirror soon.

The main Mozilla repositories have been split into two now. They are mozilla-central, which holds the current trunk code and represents Firefox 3.2 (or whatever the next version will be called), and mozilla-1.9.1, which is what will be Firefox 3.1. The details of that split are described in this post.

I now import these mercurial repositories directly into git using git's fast import tool. This gives me complete history and makes things like bisect and blame a bit easier to work with. The history of mozilla-1.9.1 being based on mozilla-central is also retained, as best as I could manage. These imported repositories can be browsed at http://gitweb.bluishcoder.co.nz. They can be retrieved via git:
git clone git://bluishcoder.co.nz/git/mozilla-central.git
git clone git://bluishcoder.co.nz/git/mozilla-1.9.1.git
The way I work with these mirrors is to create a git repository that has these added as remotes. This way I can switch between the two easily, cherry pick patches between them, and do logs and diffs between them. This is how I set that up:
$ mkdir firefox
$ cd firefox
$ git init
$ git remote add mozilla-central git://bluishcoder.co.nz/git/mozilla-central.git
$ git remote add mozilla-1.9.1 git://bluishcoder.co.nz/git/mozilla-1.9.1.git
$ git fetch mozilla-central
$ git fetch mozilla-1.9.1
When working on a bug I create a branch for that bug, based on mozilla-central/master:
$ git checkout -b bug123456 mozilla-central/master
...make changes...
$ git commit -a -m "my changes"
$ git diff -U8 mozilla-central/master >bug123456.patch
...attach bug123456.patch to bugzilla for review...
Once reviewed the patch is then applied to mercurial and pushed. If I want to apply the same patch to test on the mozilla-1.9.1 branch I just use 'git cherry-pick'. To make things like 'git status' a bit less clutted I have the following .gitignore:
$ cat .gitignore
obj-*
*~
.mozconfig
config.cache
config.log
*.pyc
CVS
.mozconfig*
.svn
cvsco.log
cvsco.log.old
NONE
configure
gitchangelog
gitchangelog.bak
.hg
.nss.checkout
*.swp
.gitignore

Categories: ,

Labels:

2 Comments:

Blogger Erwan said...

That's really awesome!

Just curious, are you using a cron job to update it or do you do it manually? If it's a cron job, how often is it set?

10:21 AM  
Blogger Chris Double said...

Thanks Erwan, it's a cron job and happens every 3 hours.

11:14 AM  

Post a Comment

<< Home