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

Re: co-authoring commits

From
Jeff King <peff@peff.net>
Date
Jun 19, 2015, 04:25 UTC
Message-ID
<20150619042519.GB26001@peff.net>
In-Reply-To
<55833758.6010000@gmail.com>
On Thu, Jun 18, 2015 at 11:25:44PM +0200, Jakub Narębski wrote:
Show 6 quoted lines
> Author and committer include datetime in the contents of the
> field, which is used by Git for heuristics limiting walk. Coauthor
> would have the same date as author, isn't it? If, after long
> and involved discussion, we didn't add 'generation' field (for
> easier cutting history walking), what chance adding 'coauthor'
> has.

I don't think the two situations are comparable. I would (and did) argue that a "generation" field is a bad header to bake in because of what it means (it is redundant with the graph structure).

Whereas "co-author" is not a fundamentally bad; it's just not something we chose to support early on, and it would have to be added now.

> OTOH it would be nice to have support for .mailmap, and for
> grepping... but the former could conceivably be added to the trailer
> tool, the latter can be done with appropriate regexp in
> "git log --grep=...".

I don't think we munge trailers during "git log" pretty-printing at all now, but it is certainly something we could add (including mailmap-ing them). That doesn't seem like much more work than showing the co-author field, and it's a lot more generally applicable (you could mailmap S-O-B, Reviewed-by, and so forth).

Similarly, something like "git shortlog" would have to learn about multiple authors under the "co-author" scheme. But likewise, it would not be much more work to teach it something like:

  git shortlog --field=Reviewed-by
to handle an arbitrary trailer. And that is much more flexible.
> I wonder what would break if one used 'Name <e@mai.l>, Name <em@i.l>'
> as the author...

The "normal" parser we use for pretty-printing goes left-to-right and will stop at the first ">", and show only the first author.

Older versions of git would then get the date wrong, complaining about the ",". Newer versions parse the date from right-to-left to work around such bogosities (especially things like "<foo <bar>>") and so will parse back to the second ">".

Fsck will definitely complain about it.
-Peff
Previous: Jakub NarębskiNext: Jakub Narębski
Message 12 of 20 in “co-authoring commits”
  1. Tuncer AyazJun 17, 2015
  2. Junio C HamanoJun 17, 2015
  3. Tuncer AyazJun 17, 2015
  4. Junio C HamanoJun 17, 2015
  5. josh@joshtriplett.orgJun 17, 2015
  6. josh@joshtriplett.orgJun 17, 2015
  7. Junio C HamanoJun 17, 2015
  8. Tuncer AyazJun 17, 2015
  9. josh@joshtriplett.orgJun 17, 2015
  10. Junio C HamanoJun 17, 2015
  11. Jakub NarębskiJun 18, 2015
  12. Jeff KingJun 19, 2015
  13. Jakub NarębskiJun 19, 2015
  14. Theodore Ts'oJun 17, 2015
  15. josh@joshtriplett.orgJun 17, 2015
  16. Jason PyeronJun 18, 2015
  17. Tuncer AyazJun 18, 2015
  18. Jakub NarębskiJun 19, 2015
  19. Tuncer AyazJun 19, 2015
  20. Jakub NarębskiJun 19, 2015

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.