Differences between revisions 11 and 12
Revision 11 as of 2008-10-28 19:27:32
Size: 6694
Editor: SeanFinney
Comment: init, not init clone
Revision 12 as of 2009-01-18 20:35:16
Size: 7663
Editor: ?FransPop
Comment: Document issue with da.po file
Deletions are marked like this. Additions are marked like this.
Line 130: Line 130:

== Known issues ==
On 32-bit systems {{{git-svn fetch}}} may fail around SVN revision r57094 with the following error:{{{
  Checksum mismatch: trunk/packages/po/sublevel4/da.po c9893a6364a37460e7a8ee1676d7ac0c9e85f59e
  expected: 2df48ca6c7a79d95b479c4f16eec44ba
       got: ec0b72182b31be69dcae734015d9e316
}}}

The cause is that, due to an error in the scripts that update translations for D-I, this da.po file grew to a size of more than 64MB and apparently git-svn is unable to handle that.

The problem was finally completely corrected in revision r57347 and checkouts that start after that point should be unaffected.

If you use git-svn on a 64-bit system, you will probably not be affected by this issue. It is also likely that a full checkout done on a 64-bit system can be used without problem on a 32-bit system.

For full details of this issue, see the [http://lists.debian.org/debian-boot/2009/01/msg00513.html debian-boot mailing list].

Using git-svn it is possible to use all the cool features of git that allow you to work off-line and still commit your work to a central SVN repository.

This page explains how to do this for DebianInstaller.

Using Joey Hess' repository

Joey Hess has [http://lists.debian.org/debian-boot/2007/11/msg00200.html announced] the availability of a git repository of DebianInstaller.

Follow these steps to create your own local D-I git-svn repo with full history (you probably need to be running testing/unstable):

  • aptitude install git-svn # and optionally: git-completion

  • git clone git://git.debian.org/~joeyh/d-i.git

This repository can be used to prepare patches.

Using Joey's repository to bootstrap git-svn

You can also set up your checkout so that changes can be committed back using git-svn and can be updated in the same fashion.

To be able to git-svn rebase and to do commits in trunk you need to tweak the .git info (note that interaction with joey's git repo will be broken after these commands):

git config remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
git fetch origin
git svn init svn+ssh://svn.debian.org/svn/d-i/trunk
git svn fetch

Creating your own checkout

You can of course run git-svn yourself to create a checkout. Note that this is a fairly slow process and requires a lot more disk space than needed for the eventual repository.

Full checkout

A full checkout using

$ git-svn clone svn+ssh://svn.debian.org/svn/d-i -T trunk -b branches -t tags

takes quite a while to complete (imagine running 'svn up' for 47880 revisions...).

It contains over 730000 objects and initially requires 6.3 GB of diskspace. Luckily this can be compressed to 875MB (!) by running 'git-gc'. `[git-repack' is also a good idea. This should trim it down substantially, but will take some time:

git repack -f -a -d --depth=250 --window=250

The full checkout includes tags and branches (see below). It does not contain the "people" directory, but then again, it can be argued that git was designed exactly to avoid the need for a people directory.

Partial checkout

It is also possible to start a checkout of the repository at any commit. This could be an interesting option if you're only interested in the current state and not in all the history, or if you are short on disk space.

To get just the current version of the repository (without tags and branches), you'd use:

$ git-svn init svn+ssh://svn.debian.org/svn/d-i -T trunk
$ git-svn fetch -r HEAD

This is basically the smallest checkout you can do.

To also get a bit of history (in this example since the release of Etch), you'd use:

$ git-svn init svn+ssh://svn.debian.org/svn/d-i -T trunk
$ git-svn fetch -r 45723:HEAD

This last will result in an initial archive of about 450MB. After running 'git-gc' this is compressed to 170MB, which means it is only half the size of an SVN trunk checkout (and that includes some 4 months of history!).

Using svn:ignore info

svn:ignore info can be used to exclude files from being listed as "changes" by git-status, but needs to be updated semi-manually, and can only be updated from svn to git.

To set svn:ignore info for your git repository, run:

$ echo "## Excludes below imported from SVN (svn:ignore)" >> .git/info/exclude
$ git-svn show-ignore >> .git/info/exclude

If you need to update this, you should first delete the current excludes (only what was added with the previous commands!) and then run these commands again.

Tags and branches

Tags and branches are preserved using what's called "git remotes". This means that there are no real git tags and branches visible, but that the SVN trunk, tags and branches are tracked as separate repositories. Downside is that you need to switch to to the remotes individually before you can update them.

All tags and branches are listed under .git/refs/remotes/ and can be checked out, but it is somewhat confusing as all old schemes for using tags and branches are there too...

The still relevant branches are:

  • remotes/d-i

  • remotes/packages

The relevant tags are:

  • remotes/tags/installer

  • remotes/tags/packages

  • remotes/tags/scripts

  • remotes/tags/manual

  • remotes/tags/d-i

And there is also the branch remotes/fromcvs and tags remotes/tags/fromcvs.

Accessing tags and branches

So, to get to tags for packages, you have to:

$ git reset --hard tags/packages

This immediately increases the diskspace needed to 2.4GB (307000+ files) because you now have all versions of all components "unpacked". For example:

$ ls anna/
0.054/ 0.055/ 0.056/ ....

Checking out tags/installer requires 1.4 GB.

To get back to trunk:

$ git reset --hard trunk

I have no idea yet how it would be possible to create tags/branches using commits from the git repository. It seems tricky because it basically requires separate checkouts. Conclusion: everything is there, but it's not really pretty.

Committing changes back to SVN

If you plan to commit directly from git-svn to SVN, please make sure that you are subscribed to the SVN commit messages for [http://packages.qa.debian.org/debian-installer debian-installer in the PTS], so that you can check if your commits landed correctly and you should probably use git-like log entries (short description of change, optionally followed by a blank line and longer description).

You should probably create a ~/.gitconfig to set your name/email:

$ cat ~/.gitconfig
[user]
        name = "Frans Pop"
        email = "fjp@debian.org"

/!\ Note: releasing packages (uploading) should always be done from an SVN checkout!

Time traveling

The git repository makes it really easy to travel through time and see how D-I looked at any time in its history. Here's an example to revision 500, 10 Feb 2001:

$ git-svn find-rev r500
8cc534cef204753a9ac404fc8b92a0104ebd41b8
$ git checkout 8cc534ce
$ ls
anna  build  doc  kernel-image-di  libd-i  main-menu  retriever  rootskel  tools
$ git checkout master

Known issues

On 32-bit systems git-svn fetch may fail around SVN revision r57094 with the following error:

  Checksum mismatch: trunk/packages/po/sublevel4/da.po c9893a6364a37460e7a8ee1676d7ac0c9e85f59e
  expected: 2df48ca6c7a79d95b479c4f16eec44ba
       got: ec0b72182b31be69dcae734015d9e316

The cause is that, due to an error in the scripts that update translations for D-I, this da.po file grew to a size of more than 64MB and apparently git-svn is unable to handle that.

The problem was finally completely corrected in revision r57347 and checkouts that start after that point should be unaffected.

If you use git-svn on a 64-bit system, you will probably not be affected by this issue. It is also likely that a full checkout done on a 64-bit system can be used without problem on a 32-bit system.

For full details of this issue, see the [http://lists.debian.org/debian-boot/2009/01/msg00513.html debian-boot mailing list].

References

The following documents can be useful to get started: