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

Malformed branch name in fast-export when specifying non-HEAD/branch revision

From
OSOwen 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.

Next: Elijah Newren
Message 1 of 11 in “Malformed branch name in fast-export when specifying non-HEAD/branch revision”
  1. Owen StephensAug 17, 2011
  2. Elijah NewrenAug 17, 2011
  3. Junio C HamanoAug 17, 2011
  4. Jeff KingAug 17, 2011
  5. Sverre RabbelierAug 21, 2011
  6. Jeff KingAug 22, 2011
  7. Sverre RabbelierAug 22, 2011
  8. Jeff KingAug 22, 2011
  9. Sverre RabbelierAug 22, 2011
  10. Junio C HamanoAug 22, 2011
  11. Jeff KingAug 22, 2011

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.