Skip to content

fast-export, fast-import: let tags specify a different refname

Luke Shumaker git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Changes from the RFC from the cover letter

- I've flipped it around; the existing tag line now specifices the tagname, and the added refname line now specifies the refname (rather than having the tag line specify the suffix of the refname, and the added name line specify the tagname). This allows for tags whose refnames to not begin with "refs/tags/".
- I've added prose documentation, rather than just updating the BNF. (The wording is based on what Junio suggested on the RFC.)
- I added tests.
- After responding to feedback, I ended up with just enough "moving and renaming things" noise that in the single commit that for v1 I split that out in to a econd commit.
- While implementing the tests, I discovered a pre-existing bug with nested tags, so I added a separate third commit to fix that.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fast-export, fast-import: make stylistic changesbuiltin/fast-export.c builtin/fast-import.c+35 -250 replies
2/3fast-export: fix bug with nested tagsbuiltin/fast-export.c t/t9350-fast-export.sh+33 -40 replies
3/3fast-export, fast-import: let tags specify a different refnameDocumentation/git-fast-import.txt builtin/fast-export.c builtin/fast-import.c +1 more+35 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] fast-export, fast-import: let tags specify a different refname

From: Luke Shumaker <[email protected]>

After receiving positive feedback on the RFC, here's the polished-up v1.

This patchset adds an optional "refname" sub-command to fast-import's "tag" top-level-command; the stream

    tag foo
    refname refs/tags/bar
    ...

will create a tag at "refs/tags/bar" that says "tag foo" internally. If there is no "refname" line, it will continue with the existing behavior of using "refs/tags/<tagname>" as the refname.

This makes it now-possible for fast-export/fast-import to represent tags for which the internal tagname and the refname disagree. It also adds support for tags with refnames that do not begin with "refs/tags/". I discuss the motivation for supporting this in the commit message of the 3rd patch.

Changes from the RFC:

- I've flipped it around; the existing tag line now specifices the tagname, and the added refname line now specifies the refname (rather than having the tag line specify the suffix of the refname, and the added name line specify the tagname). This allows for tags whose refnames to not begin with "refs/tags/".
- I've added prose documentation, rather than just updating the BNF. (The wording is based on what Junio suggested on the RFC.)
- I added tests.
- After responding to feedback, I ended up with just enough "moving and renaming things" noise that in the single commit that for v1 I split that out in to a econd commit.
- While implementing the tests, I discovered a pre-existing bug with nested tags, so I added a separate third commit to fix that.

This passes all of the GitHub Actions CI checks, and passes all but one of the Travis-CI checks; the failing Travis-CI check seems to be an unrelated 404 from apt-get.
https://github.com/LukeShu/git/runs/2405478827

[1]: https://lore.kernel.org/git/[email protected]/

Luke Shumaker (3):
fast-export, fast-import: make stylistic changes
fast-export: fix bug with nested tags
fast-export, fast-import: let tags specify a different refname

 Documentation/git-fast-import.txt | 22 +++++++++------
 builtin/fast-export.c             | 47 ++++++++++++++++++++++++++-----
 builtin/fast-import.c             | 47 +++++++++++++++++++------------
 t/t9350-fast-export.sh            | 20 ++++++++++---
 4 files changed, 98 insertions(+), 38 deletions(-)
Signature · 4 lines
2.31.1

Happy hacking,
~ Luke Shumaker