From: Jeff King <peff@peff.net>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Elijah Newren <newren@gmail.com>,
Owen Stephens <git@owenstephens.co.uk>,
git@vger.kernel.org
Subject: Re: Malformed branch name in fast-export when specifying non-HEAD/branch revision
Date: Mon, 22 Aug 2011 13:57:05 -0400 [thread overview]
Message-ID: <20110822175705.GB1945@sigill.intra.peff.net> (raw)
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:
> 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.
> 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.
> 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
next prev parent reply other threads:[~2011-08-22 17:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAORuUR1viqG27+dYOFS_5SLxFOE2wHJqAQ3i3RByg_fbWACh-Q@mail.gmail.com>
2011-08-17 16:21 ` Malformed branch name in fast-export when specifying non-HEAD/branch revision Owen Stephens
2011-08-17 19:36 ` Elijah Newren
2011-08-17 22:30 ` Junio C Hamano
2011-08-17 23:19 ` Jeff King
2011-08-21 22:29 ` Sverre Rabbelier
2011-08-22 16:19 ` Jeff King
2011-08-22 16:54 ` Sverre Rabbelier
2011-08-22 17:57 ` Jeff King [this message]
2011-08-22 18:05 ` Sverre Rabbelier
2011-08-22 21:27 ` Junio C Hamano
2011-08-22 21:32 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110822175705.GB1945@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@owenstephens.co.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
--cc=srabbelier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).