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.