I am in the process of moving the Doom packages that the Debian Games Team maintain from subversion to git.

I started with a small native package called game-data-packager. The clone operation took hours to run and resulted in a 90-odd Mb git repository. Since game-data-packager is a relatively small collection of shell scripts with a recent history, I have reason to believe that git svn has imported much more of the Games Team SVN repo than just the game-data-packager bits.

After fiddling with git repack -a -d, git prune and git gc --aggressive, the repository is still 80Mb large. How do I determine what is using all this space? Can anyone advise me on the best way to analyse a repository like this?



Have You tried to git clone you new git repository ? If I remember correctly git svn store some information for the git/svn synchronisation that are not needed anymore if you choose to drop the svn repository.

remi [vanicat.free.fr],

If git svn is the same as regular git, i.e. operating on entire repositories, not subtrees, the following excerpt may help you. It clones a repository, then strips it down to a subtree, then clones it twice(!) to actually get it to remove the superfluous data.

tg@eurynome:~ $ cat /git/mksh-spell.UP
#!/bin/mksh -ex

cd /git/grimoire.git
git fetch
rm -rf /git/grimoire.tmp:mksh
mkdir /git/grimoire.tmp:mksh
cd /git/grimoire.tmp:mksh
git clone --bare -s /git/grimoire.git copy1.git
cd /git/grimoire.tmp:mksh/copy1.git
git tag -d $(git tag -l)
git filter-branch \
    --prune-empty -d /home/tg/.mfs/grimoire.tmp:mksh -f \
    --subdirectory-filter shell-term-fm/mksh \
    --tag-name-filter cat \
    -- --all #refs/heads/master
cd /git/grimoire.tmp:mksh
git clone --bare file:///git/grimoire.tmp:mksh/copy1.git copy2.git
git clone --bare file:///git/grimoire.tmp:mksh/copy2.git mksh-spell.git
cd /git
rm -rf /git/mksh-spell.git
mv grimoire.tmp:mksh/mksh-spell.git .
rm -rf grimoire.tmp:mksh

-- mirabilos

mirabilos [launchpad.net],

Thank you for your comment! I think git filter-branch might be part of the solution, thanks for sharing your script. -- Jon

Jon Dowland,

Hi Rémi, thanks for your comment. I did try that and the clone is indeed smaller, but if I've created local branches pointing at any of the branches I want, it's still 80+MB. Unfortunately the log for these branches shows lots of irrelevant commits. This must be a git-svn bug. -- Jon

Jon Dowland,