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

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

From
Jeff King <peff@peff.net>
Date
Aug 22, 2011, 17:57 UTC
Message-ID
<20110822175705.GB1945@sigill.intra.peff.net>
In-Reply-To
<CAGdFq_gx+NutDCU7egr_fYUvVG=g1t76LiV1SV-W=0KWBTjHyQ@mail.gmail.com>
On Mon, Aug 22, 2011 at 09:54:47AM -0700, Sverre Rabbelier wrote:
Show 20 quoted lines
> Do you agree that this is expected behavior?
> 
> $ git init test
> Initialized empty Git repository in /home/sverre/code/test/.git/
> $ cd test/
> $ echo content >> foo
> sverre@laptop-sverre:~/code/test
> $ git add foo
> $ git commit -m first
> [master (root-commit) 821176f] first
>  1 files changed, 1 insertions(+), 0 deletions(-)
>  create mode 100644 foo
> $ echo content >> foo
> $ git commit -am second
> [master 1934282] second
>  1 files changed, 1 insertions(+), 0 deletions(-)
> $ git branch other
> $ git fast-export ^master other
> reset refs/heads/other
> from 1934282469e3a83a5ef827fd31e074cfb4f3eadf
Yeah, that seems reasonable to me.
Show 9 quoted lines
> Because in current git.git, this doesn't work (the above is generated
> using a git that has the patch series Dscho and I sent out). Current
> git will instead do the following:
> 
> $ git fast-export ^master other
> reset refs/heads/other
> from :0
> 
> The 'from :0' here is obviously a bug (which is fixed by our patch series).

Yep, the current behavior is definitely wrong. But I thought your question was about accidentally mentioning refs/heads/master, which this doesn't do (nor should it).

I just read through the remote-helper threads from early June, and the only mention of triggering that is when you actually have a rename (i.e., your "refs/heads/foo" becomes remote's "refs/heads/bar", but we mention "refs/heads/foo" in the export stream). I was thinking there was another case, but I couldn't find mention of it.

Show 12 quoted lines
> You might wonder, 'why would anyone do that', well, for example, they
> might be using marks:
> 
> $ git fast-export --export-marks=marksfile  master > /dev/null
> $ git fast-export --import-marks=marksfile  other
> reset refs/heads/other
> from :4
> 
> Again, the above is generated with my patched git, current git.git
> simply outputs nothing.
> 
> $ git fast-export --import-marks=marksfile other

Yeah, the behavior of your patch looks fine to me. I thought the point in contention was that having export understand refspecs would fix a lot of _other_ cases, too.

-Peff
Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 8 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.