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

Re: [PATCH v10 2/3] interpret-trailers: add own-identity option

From
ZheNing Hu <adlternative@gmail.com>
Date
Mar 19, 2021, 09:33 UTC
Message-ID
<CAOLTT8RzvQzD0baWPdJzRLK3Q+WeJR_HNA4RVHMxRmwHeym9QQ@mail.gmail.com>
In-Reply-To
<xmqq1rcctgj7.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2021年3月19日周五 上午3:20写道:
Show 17 quoted lines
>
> "ZheNing Hu via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: ZheNing Hu <adlternative@gmail.com>
> >
> > Beacuse `git commit --trailer="Signed-off-by: \
> > $(git config user.name) <$(git config user.email)>"`
> > is difficult for users to add their own identities,
> > so teach interpret-trailers a new option `--own-identity`
> > which allow those trailers with no value add the user’s own
> > identity. This will help the use of `commit --trailer` as
> > easy as `--signoff`.
>
> I have a suspicion that this is too narrowly focused to be useful in
> practice, and I find that the proposed "--own-identity" is quite a
> mouthful.
>

Well, the original meaning of this `--trailer`and`--own-identity` option is to imitate the behavior of `--signoff` to create other trailers, For the time being, it can only "imitation", it does not yet support the ability to provide multiple identities instead of "own-identity".

If `--own-identity` is mouthful, is there a better name?
Show 10 quoted lines
> > +--own-identity::
> > +     Used with `--trailer`. Those trailers without value with the
> > +     `--own-identity` option all will add the user's own identity.
>
> So, the assumption here is that the name of the trailer tag alone,
> without the ':' separator, can identify which trailer the user is
> talking about, and it can be distinguished from the tag name plus ':'
> and nothing else which is calling for a trailer entry with an empty
> string as its value?
>
Yes. `--own-ident` is for trailers without a separator.
Show 10 quoted lines
> OK.
>
> The reason why this looks too narrowly focused on oneself alone to
> be useful to me is because I often need to add various -by trailers
> to incoming patches, and have a script to do exactly that (which
> does not use interpret-trailers, as I do not think
> interpret-trailers can accept a patch email as its input, and the
> script predates interpret-trailers) but it will be useless if that
> script were limited to add -by for myself.
>

I understand it. But I think `--own-ident` is more inclined to add identities for users. If users want to add other people’s identities, they need to use another method.

Show 20 quoted lines
> Wouldn't it be a lot more useful if
>
>         git commit --trailer="Helped-by:@Ch.*Couder"
>
> is expanded (note: I am not married to the syntax, but only for
> illustration purposes, I am using "a value prefixed by @ triggers
> the 'name expansion'" convention in this example.  People can come
> up with better convention) by finding an author or a committer whose
> name matches the given pattern from "git log"?  Then, instead of
>
>         git commit --own-identity --trailer=Signed-off-by
>
> I can say
>
>         git commit --trailer=Signed-off-by:@gitster
>
> and I can even add more than one, e.g.
>
>         git commit --trailer=Helped-by:@peff --trailer=Signed-off-by:@gitster
>
I agree that this idea can be extended again from "own-identity "
mode to "multiple-identity mode",‘@’ seems to have a lot of
 important meanings in git, but I don’t know how to design a solution
 that is more suitable than yours for the time being.
 Another doubt  is what happens if one person corresponds to
 multiple mailboxes or one mailbox corresponds to multiple people?

I think `--own-ident` may be a somewhat "narrow" option that can be kept. Also add a new option for interpret-trailers to resolve the identity of other people?

Thanks for suggestions.
Previous: Junio C HamanoNext: Junio C Hamano
Message 52 of 84 in “[GSOC] commit: provides multiple common signatures”
  1. [GSOC] commit: provides multiple common signaturesZheNing Hu via GitGitGadget, Mar 11, 2021
  2. Shourya ShuklaMar 11, 2021
  3. ZheNing HuMar 12, 2021
  4. Junio C HamanoMar 11, 2021
  5. ZheNing HuMar 12, 2021
  6. ZheNing HuMar 12, 2021
  7. [GSOC] commit: add trailer commandZheNing Hu via GitGitGadget, Mar 12, 2021
  8. Christian CouderMar 14, 2021
  9. ZheNing HuMar 14, 2021
  10. Junio C HamanoMar 14, 2021
  11. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 14, 2021
  12. Rafael SilvaMar 14, 2021
  13. ZheNing HuMar 14, 2021
  14. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 14, 2021
  15. Junio C HamanoMar 14, 2021
  16. ZheNing HuMar 15, 2021
  17. Junio C HamanoMar 15, 2021
  18. ZheNing HuMar 15, 2021
  19. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 15, 2021
  20. Christian CouderMar 15, 2021
  21. Christian CouderMar 15, 2021
  22. ZheNing HuMar 15, 2021
  23. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 15, 2021
  24. Christian CouderMar 15, 2021
  25. ZheNing HuMar 15, 2021
  26. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 15, 2021
  27. Christian CouderMar 15, 2021
  28. Christian CouderMar 15, 2021
  29. ZheNing HuMar 15, 2021
  30. Christian CouderMar 16, 2021
  31. ZheNing HuMar 16, 2021
  32. 0/2 [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 15, 2021
  33. 1/2 [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 15, 2021
  34. Ævar Arnfjörð BjarmasonMar 16, 2021
  35. ZheNing HuMar 17, 2021
  36. Ævar Arnfjörð BjarmasonMar 17, 2021
  37. ZheNing HuMar 17, 2021
  38. 2/2 interpret_trailers: for three options parse add warningZheNing Hu via GitGitGadget, Mar 15, 2021
  39. Christian CouderMar 16, 2021
  40. ZheNing HuMar 16, 2021
  41. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 16, 2021
  42. Shourya ShuklaMar 17, 2021
  43. ZheNing HuMar 17, 2021
  44. 0/3 [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 18, 2021
  45. 1/3 [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 18, 2021
  46. Đoàn Trần Công DanhMar 18, 2021
  47. ZheNing HuMar 19, 2021
  48. 2/3 interpret-trailers: add own-identity optionZheNing Hu via GitGitGadget, Mar 18, 2021
  49. Đoàn Trần Công DanhMar 18, 2021
  50. ZheNing HuMar 19, 2021
  51. Junio C HamanoMar 18, 2021
  52. ZheNing HuMar 19, 2021
  53. Junio C HamanoMar 19, 2021
  54. ZheNing HuMar 20, 2021
  55. Jeff KingMar 20, 2021
  56. Junio C HamanoMar 20, 2021
  57. ZheNing HuMar 20, 2021
  58. ZheNing HuMar 20, 2021
  59. Junio C HamanoMar 20, 2021
  60. ZheNing HuMar 20, 2021
  61. 3/3 commit: add own-identity optionZheNing Hu via GitGitGadget, Mar 18, 2021
  62. Christian CouderMar 18, 2021
  63. ZheNing HuMar 18, 2021
  64. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 19, 2021
  65. Junio C HamanoMar 19, 2021
  66. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 20, 2021
  67. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 22, 2021
  68. Christian CouderMar 22, 2021
  69. ZheNing HuMar 22, 2021
  70. Christian CouderMar 22, 2021
  71. ZheNing HuMar 23, 2021
  72. Junio C HamanoMar 23, 2021
  73. Christian CouderMar 23, 2021
  74. Junio C HamanoMar 23, 2021
  75. ZheNing HuMar 24, 2021
  76. ZheNing HuMar 23, 2021
  77. Christian CouderMar 23, 2021
  78. Junio C HamanoMar 23, 2021
  79. ZheNing HuMar 24, 2021
  80. Christian CouderMar 22, 2021
  81. ZheNing HuMar 23, 2021
  82. [GSOC] commit: add --trailer optionZheNing Hu via GitGitGadget, Mar 23, 2021
  83. Junio C HamanoMar 15, 2021
  84. ZheNing HuMar 15, 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.