On Friday 30 November 2007 08:59:01 you wrote: > Christoph wrote: > > I am trying to import a BitKeeper repo into a (new) git repo. > > > > I am trying with the script bk2git.py that I found on the web. > > This does not quite work - I fear script is no longer working with the > > current git release. (I am using the current git release.) [snip] > > The following lines fail > > os.system("cd %s; git-ls-files --deleted | xargs > > git-update-cache --remove" % tmp_dir) [snip] > It should still do this, afaik, although it's probably better > to just use GIT_DIR nowadays. Using GIT_DIR works, one has to set it to point to the .git directory (I had assumed the git_dir to be the one *containing* .git). Another point with the original script was that you had to have all commiters in the mapping (email -> name), otherwise it would not work. (Supplying '*Unknown*' fixed this.) I have added - better arguments parsing (see --help) - ability to do incremental conversions (--incr-db, -r) - different levels of verbosity I have attached a working version of the script. I have added comments that (try to) explain the script if someone else has trouble with it. Moreover, it is very helpful to put the directories inside a ramdisk. Otherwise, you have to be extremely patient. (You have to be patient anyway. For a bk repo of some 14k files (>110MB when 'clean', 8000 changesets) the script took some 11hrs). Another issue (when using ramdisks) is memory. On my machine memory is scarce (only 1 GB). So the ever growing bare repo (can't be gc'ed before getting its head) exhausted the ramdisk space. I worked around this by doing an incremental conversion. After each increment a gc is possible and the git repo shrinks to a managable size (and still fits inside the ramdisk). So, to sum up: converting a big repo is no fun, but it works, given enough time (and ram). Thanks, best regards Christoph -- A billion here, a couple of billion there -- first thing you know it adds up to be real money. -- Senator Everett McKinley Dirksen
Attachment:
bk2git.py
Description: application/python