git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: importing bk into git (succeeded)

From
CChristoph <christoph.duelli@gmx.de>
Date
Dec 8, 2007, 19:19 UTC
Message-ID
<200712082019.10273.christoph.duelli@gmx.de>
In-Reply-To
<474FC2C5.8060400@op5.se>
On Friday 30 November 2007 08:59:01 you wrote:
Show 6 quoted lines
> 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
Previous: Johannes SchindelinNext: David Kettler
Message 4 of 6 in “importing bk into git”
  1. ChristophNov 29, 2007
  2. Andreas EricssonNov 30, 2007
  3. Replace the word 'update-cache' by 'update-index' everywhereJohannes Schindelin, Nov 30, 2007
  4. ChristophDec 8, 2007
  5. David KettlerDec 3, 2007
  6. ChristophDec 3, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.