All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luke Shumaker <lukeshu@lukeshu.com>
To: Elijah Newren <newren@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Luke Shumaker" <lukeshu@lukeshu.com>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Luke Shumaker" <lukeshu@datawire.io>
Subject: Re: [RFC PATCH] fast-export, fast-import: Let tags specify an internal name
Date: Wed, 21 Apr 2021 12:48:39 -0600	[thread overview]
Message-ID: <87h7jz3248.wl-lukeshu@lukeshu.com> (raw)
In-Reply-To: <CABPp-BFY65wddHHw2Uhortcux+TzMYBZS1wwfnsasYeishXa-w@mail.gmail.com>

On Wed, 21 Apr 2021 12:34:26 -0600,
Elijah Newren wrote:
> On Wed, Apr 21, 2021 at 1:19 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
> > There's also perfectly legitimate in-the-wild use-cases for this,
> > e.g. "archiving" tags to not-refs/tags/* so e.g. the upload-pack logic
> > doesn't consider and follow them. Not being able to export/import those
> > repositories as-is due to an overzelous data check there that's not in
> > fsck.c would suck.
> 
> Not would suck, but does suck.  I had to document it as a shortcoming
> of fast-export/fast-import -- see
> https://www.mankier.com/1/git-filter-repo#Internals-Limitations, where
> I wrote, "annotated and signed tags outside of the refs/tags/
> namespace are not supported (their location will be mangled in weird
> ways)".
> 
> The problem is, what's the right backward-compatible way to fix this?
> Do we have to add a flag to both fast-export and fast-import to stop
> assuming a "refs/tags/" prefix and use the full refname, and require
> the user to pass both flags?  How is fast-import supposed to know that
> "refs/alternate-tags/foo" is or isn't
> "refs/tags/refs/alternate-tags/foo"?
> 
> And if we need such a flag, should fast-import die if it sees this new
> "name" directive and the flag isn't given?

Elsehwere in the thread, I responded to some feedback by suggesting
that perhaps I should flip it around, and instead add a 'refname'
sub-command, and have it default to 'refs/tags/{tagname}'

So the stream

    tag foo
    ...

would create a tag at "refs/tags/foo" that says "tag foo".  And the
stream

    tag bar
    refname refs/alternate-tags/baz

would create a tag at "refs/alternate-tags/baz" that says "tag bar".

Grepping for "refs/tags" in fast-export.c and fast-import.c, I think
that would fully address this concern.

-- 
Happy hacking,
~ Luke Shumaker

  reply	other threads:[~2021-04-21 18:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 19:05 [RFC PATCH] fast-export, fast-import: Let tags specify an internal name Luke Shumaker
2021-04-20 21:40 ` Junio C Hamano
2021-04-21  8:18   ` Ævar Arnfjörð Bjarmason
2021-04-21 16:17     ` Luke Shumaker
2021-04-21 16:59     ` Junio C Hamano
2021-04-21 18:34     ` Elijah Newren
2021-04-21 18:48       ` Luke Shumaker [this message]
2021-04-21 19:24         ` Elijah Newren
2021-04-22  8:41       ` Ævar Arnfjörð Bjarmason
2021-04-21 18:41   ` Elijah Newren
2021-04-21 18:54     ` Junio C Hamano
2021-04-21 19:32       ` Elijah Newren
2021-04-22  8:54         ` Ævar Arnfjörð Bjarmason
2021-04-22 19:37           ` Elijah Newren
2021-04-21  8:03 ` Ævar Arnfjörð Bjarmason
2021-04-21 16:34   ` Luke Shumaker
2021-04-21 17:26     ` Luke Shumaker
2021-04-21 18:26     ` Elijah Newren
2021-04-21 17:48   ` Junio C Hamano
2021-04-23 16:47 ` Luke Shumaker

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=87h7jz3248.wl-lukeshu@lukeshu.com \
    --to=lukeshu@lukeshu.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lukeshu@datawire.io \
    --cc=newren@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.