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

Re: [PATCH 1/1] commit: add support to provide --coauthor

From
Toon Claes <toon@iotcl.com>
Date
Oct 10, 2019, 08:49 UTC
Message-ID
<87sgo1q92k.fsf@iotcl.com>
In-Reply-To
<20191009203105.GA7007@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes: 
 
> Yeah, I'd agree that we should start first with a generic 
> trailer line.
IIUC you are suggesting something like this?
  git commit --trailer="Co-authored-by: <coauthor>"

I really want to consider this, but I do not understand how that improves the user experience compared to adding that trailer manually when typing the commit message in your $EDITOR?

Show 8 quoted lines
> There might be some advantage to building trailer-specific 
> intelligence on top of that (for instance, it would be nice for 
> coauthor trailers to expand names the way --author does). But 
> that can come after, and might not even be in the form of 
> specific command-line options. E.g., if the coauthor trailer 
> could be marked in config as "this is an ident", then we we 
> would know to expand it. And the same could apply to acked, 
> reported, etc.

Wouldn't making it a generic --trailer option make this more complex? I can image users might even want to use the --trailer argument to indicate which issue the commit closes:

  git commit --trailer="Closes: $BUGNUMBER"

So, how can we make the config understand it has to expand Co-authored-by and not Closes?

Maybe, because I was looking at https://git.wiki.kernel.org/index.php/CommitMessageConventions#Trailers, it will probably be safe to expand a name when a '-by' suffix is used.

With this pattern in place there is a slight improvement compared to typing the trailer in your $EDITOR, because the user can pass --trailer="Anything-by: name" and the trailer is expanded to `Anything-by: name <name@example.com>".

But I'd like to note another thing, and let me circle back to SZEDER Gábor's reply:

> I wonder how we are supposed to use this trailer in the Git 
> project, in particular in combination with Signed-off-by. 
> Should all (co)authors sign off as well?  Or will Co-authored-by 
> imply Signed-off-by?

For this purpose I think it's useful git understands what "Co-authored-by" means, so when you run:

  git commit -s --coauthor=<coauthor>
The following trailer will be added:
  Co-authored-by: <coauthor>
  Signed-off-by: <author>
  Signed-off-by: <coauthor>

So I'm still pro of adding a --co-author option, but I do understand the concerns to avoid adding an option for all the possible trailers found in the link above.

-- 
Toon
Previous: Jeff KingNext: Jeff King
Message 10 of 15 in “commit: add support to provide --coauthor”
  1. 1/1 commit: add support to provide --coauthorToon Claes, Oct 8, 2019
  2. Denton LiuOct 8, 2019
  3. Phillip WoodOct 8, 2019
  4. Phillip WoodOct 8, 2019
  5. SZEDER GáborOct 9, 2019
  6. Junio C HamanoOct 9, 2019
  7. brian m. carlsonOct 9, 2019
  8. Junio C HamanoOct 9, 2019
  9. Jeff KingOct 9, 2019
  10. Toon ClaesOct 10, 2019
  11. Jeff KingOct 10, 2019
  12. Junio C HamanoOct 11, 2019
  13. brian m. carlsonOct 10, 2019
  14. Johannes SchindelinOct 10, 2019
  15. Denton LiuOct 10, 2019

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.