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

Re: [RFC PATCH] fast-export, fast-import: Let tags specify an internal name

From
Luke Shumaker <lukeshu@lukeshu.com>
Date
Apr 21, 2021, 18:48 UTC
Message-ID
<87h7jz3248.wl-lukeshu@lukeshu.com>
In-Reply-To
<CABPp-BFY65wddHHw2Uhortcux+TzMYBZS1wwfnsasYeishXa-w@mail.gmail.com>

On Wed, 21 Apr 2021 12:34:26 -0600, Elijah Newren wrote:

Show 24 quoted lines
> 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
Previous: Elijah NewrenNext: Elijah Newren
Message 7 of 20 in “fast-export, fast-import: Let tags specify an internal name”
  1. fast-export, fast-import: Let tags specify an internal nameLuke Shumaker, Apr 20, 2021
  2. Junio C HamanoApr 20, 2021
  3. Ævar Arnfjörð BjarmasonApr 21, 2021
  4. Luke ShumakerApr 21, 2021
  5. Junio C HamanoApr 21, 2021
  6. Elijah NewrenApr 21, 2021
  7. Luke ShumakerApr 21, 2021
  8. Elijah NewrenApr 21, 2021
  9. Ævar Arnfjörð BjarmasonApr 22, 2021
  10. Elijah NewrenApr 21, 2021
  11. Junio C HamanoApr 21, 2021
  12. Elijah NewrenApr 21, 2021
  13. Ævar Arnfjörð BjarmasonApr 22, 2021
  14. Elijah NewrenApr 22, 2021
  15. Ævar Arnfjörð BjarmasonApr 21, 2021
  16. Luke ShumakerApr 21, 2021
  17. Luke ShumakerApr 21, 2021
  18. Elijah NewrenApr 21, 2021
  19. Junio C HamanoApr 21, 2021
  20. Luke ShumakerApr 23, 2021

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.