hg2git.py: add -f/--force option to bypass validation checks
[fast-export/benizi.git] / hg2git.txt
blobf4da25820bd6d1e68dce79451b766be17ebd5d49
1 hg2git.(sh|py) - mercurial to git converter using git-fast-import
3 Legal
4 =====
6 The scripts are licensed under the GPL version 2 and were written by
7 Rocco Rutte <pdmef@gmx.net> with hints and help from the git list and
8 #mercurial on freenode.
10 Usage
11 =====
13 Using it is quite simple for a mercurial repository <repo>:
15   mkdir repo-git # or whatever
16   cd repo-git
17   git init
18   hg2git.sh -r <repo>
20 Incremental imports to track hg repos is supported, too.
22 Notes/Limitations
23 =================
25 hg2git supports multiple branches but only named branches with exaclty
26 one head each. Otherwise commits to the tip of these heads within branch
27 will get flattened into merge commits.
29 As each git-fast-import run creates a new pack file, it may be required
30 to repack the repository quite often for incremental imports (especially
31 when importing a small number of changesets per incremental import).
33 Design
34 ======
36 hg2git.py was designed in a way that doesn't require a 2-pass mechanism
37 or any prior repository analysis: if just feeds what it finds into
38 git-fast-import. This also implies that it heavily relies on strictly
39 linear ordering of changesets from hg, i.e. its append-only storage
40 model so that changesets hg2git already saw never get modified.
42 Todo
43 ====
45 For incremental imports, handling tags needs to be reworked (maybe):
46 Right now we assume that once a tag is created, it stays forever and
47 never changes. However,
49   1) tags in hg may be removed
50   2) tags may change
52 I'm not yet sure how to handle this and how this interferes with
53 non-hg-based tags in git.
55 The same for branches: They may get removed.
57 For one-time conversions, everything is fine.