Malformed branch name in fast-export when specifying non-HEAD/branch revision
- From
- Owen Stephens <git@owenstephens.co.uk>
- Date
- Aug 17, 2011, 16:21 UTC
- Message-ID
- <CAORuUR154Dhg5vDojga-01bDxxf+=R2X-oJK-0417CgmqxCwvA@mail.gmail.com>
- In-Reply-To
- <CAORuUR1viqG27+dYOFS_5SLxFOE2wHJqAQ3i3RByg_fbWACh-Q@mail.gmail.com>
Hi,
fast-export gives an invalid branch name for commits, if the revision specified is not HEAD or a branch name.
$ git --version git version 1.7.6
$ # Create $ git init export_test && cd export_test $ touch a && git add a && git commit -m 'Add a' $ touch b && git add b && git commit -m 'Add b' $ git branch branch1
$ # ok $ git fast-export HEAD
$ # also ok $ git fast-export branch1
$ # uses HEAD~1 instead of refs/heads/master $ git fast-export HEAD~1
blob mark :1 data 0
reset HEAD~1 commit HEAD~1 mark :2 author Owen Stephens <git@owenstephens.co.uk> 1313597436 +0100 committer Owen Stephens <git@owenstephens.co.uk> 1313597436 +0100 data 6 Add a M 100644 :1 a
$ # Uses the commit hash rather than refs/heads/master $ git fast-export $(git rev-parse HEAD~1)
blob mark :1 data 0
reset 5a8a8abb1ab44890501c64f2d51f671ab2108d60 commit 5a8a8abb1ab44890501c64f2d51f671ab2108d60 mark :2 author Owen Stephens <git@owenstephens.co.uk> 1313597436 +0100 committer Owen Stephens <git@owenstephens.co.uk> 1313597436 +0100 data 6 Add a M 100644 :1 a
$ # fast-import cannot handle this stream: $ git init subgit $ git fast-export HEAD~1 | (cd subgit/ && git fast-import) fatal: Branch name doesn't conform to GIT standards: HEAD~1 fast-import: dumping crash report to .git/fast_import_crash_26863
Regards, Owen.