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

Re: [PATCH] builtin/tag.c: add --trailer arg

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 29, 2024, 17:07 UTC
Message-ID
<xmqqedaow100.fsf@gitster.g>
In-Reply-To
<CAJdN7KhCesU-j=yyM5Sk0sMj8W2Gk=LJc-Dzf8-2+gjhkgA4HQ@mail.gmail.com>
John Passaro <john.a.passaro@gmail.com> writes:
Show 12 quoted lines
> It seems to me the duplication goes further than that.
> Ideally I would love to have a unified approach to the problem of
> combining `-m`, `-F`, `-e`, and `--trailer` generally. That would change
> one existing nit I have in git-tag, which is that with `-m`, `-F`,
> or `-fae` to replace an existing tag, it doesn't add commentary guidance
> the way git-commit does.
>
> That's a bigger change than I'm comfortable taking on and it's
> arguably beyond the scope of this ticket. Question here is - first,
> is such a consolidation possible in the future, and second, if it were,
> would this refactor (dedicated function for augmenting a strbuf/file
> with trailers) still be valuable?
There is no doubt it would be, if it were ;-)

At least, it should be straight-forward to turn the copying and pasting in this patch to a proper refactoring into a common helper function as Patrick suggested and add it to the trailer API. It should become a separate, preparatory clean-up patch on a two-patch series, upon which the main "now we have a reusable piece split out of 'git commit --trailer' implementation, let's use it to teach the same '--trailer' to 'git tag'" patch can come.

Thanks.
Previous: John PassaroNext: Junio C Hamano
Message 5 of 37 in “builtin/tag.c: add --trailer arg”
  1. builtin/tag.c: add --trailer argJohn Passaro via GitGitGadget, Apr 29, 2024
  2. Patrick SteinhardtApr 29, 2024
  3. John PassaroApr 29, 2024
  4. John PassaroApr 29, 2024
  5. Junio C HamanoApr 29, 2024
  6. Junio C HamanoApr 29, 2024
  7. John PassaroApr 29, 2024
  8. Junio C HamanoApr 29, 2024
  9. builtin/tag.c: add --trailer argJohn Passaro via GitGitGadget, Apr 29, 2024
  10. 0/3 builtin/tag.c: add --trailer optionJohn Passaro via GitGitGadget, Apr 29, 2024
  11. 1/3 builtin/commit.c: refactor --trailer logicJohn Passaro via GitGitGadget, Apr 29, 2024
  12. Patrick SteinhardtApr 30, 2024
  13. Junio C HamanoApr 30, 2024
  14. 2/3 builtin/tag.c: add --trailer argJohn Passaro via GitGitGadget, Apr 29, 2024
  15. Patrick SteinhardtApr 30, 2024
  16. Junio C HamanoApr 30, 2024
  17. John PassaroApr 30, 2024
  18. Junio C HamanoApr 30, 2024
  19. John PassaroMay 5, 2024
  20. 3/3 po: update git-tag translationsJohn Passaro via GitGitGadget, Apr 29, 2024
  21. Junio C HamanoApr 29, 2024
  22. John PassaroApr 29, 2024
  23. 0/3 builtin/tag.c: add --trailer optionJohn Passaro via GitGitGadget, Apr 30, 2024
  24. 1/3 builtin/commit.c: remove bespoke option callbackJohn Passaro via GitGitGadget, Apr 30, 2024
  25. Patrick SteinhardtMay 2, 2024
  26. 2/3 builtin/commit.c: refactor --trailer logicJohn Passaro via GitGitGadget, Apr 30, 2024
  27. Patrick SteinhardtMay 2, 2024
  28. 3/3 builtin/tag.c: add --trailer optionJohn Passaro via GitGitGadget, Apr 30, 2024
  29. Patrick SteinhardtMay 2, 2024
  30. 0/3 builtin/tag.c: add --trailer optionJohn Passaro via GitGitGadget, May 5, 2024
  31. 1/3 builtin/commit: use ARGV macro to collect trailersJohn Passaro via GitGitGadget, May 5, 2024
  32. John PassaroMay 7, 2024
  33. Junio C HamanoMay 7, 2024
  34. 2/3 builtin/commit: refactor --trailer logicJohn Passaro via GitGitGadget, May 5, 2024
  35. 3/3 builtin/tag: add --trailer optionJohn Passaro via GitGitGadget, May 5, 2024
  36. Patrick SteinhardtMay 6, 2024
  37. Junio C HamanoMay 6, 2024

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.