Thoughts on git commit mail

John Baldwin jhb at FreeBSD.org
Thu Dec 31 22:14:35 UTC 2020


On 12/16/20 2:23 AM, Li-Wen Hsu wrote:
> On Wed, Dec 16, 2020 at 7:59 AM John Baldwin <jhb at freebsd.org> wrote:
>> Putting 1-3 together for the commit in question would give the
>> header below which I think is a bit more compact and similar to
>> svn formatting in that all the metadata is in a single block
>> without additional whitespace.
>>
>> commit d79b57d3cf7151e45216c0f8501cdb2eb7a3bd86
>> Author: Glen Barber <gjb at FreeBSD.org>
>> Date:   2020-12-13 21:31:39 +0000
>> Branch: main
>> URL:    https://cgit.FreeBSD.org/doc/commit/?id=d79b57d3cf7151e45216c0f8501cdb2eb7a3bd86
> 
> This sounds good to me, the reason I have both Author and Committer
> fields because I was thinking if we have pull request / merge
> workflow, there will be more commits and pushes with different
> author/committer/pusher, and the date of these three will be
> different, the From and Date fields in mail header can only cover the
> pusher.

So seeing some cherry-picks now via MFCs, I do have one thought.
Here is a MFC by rlibby of a commit I made in head:


commit 939430f23771bb2bdd85337a58f5ba0757f60782
Author:     John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2020-08-31 21:55:25 +0000
Commit:     Ryan Libby <rlibby at FreeBSD.org>
CommitDate: 2020-12-31 19:56:33 +0000

I still find this a bit verbose, but I do find that the CommitDate is
the Date I actually care about rather than the AuthorDate.  Neither one
is a "push date", but CommitDate is much closer to that.  I think I am
still fine with keeping the Author as the name and relying on the e-mail
>From to serve as the 'Commit' (probably should be "Committer") field,
so something like:

commit 939430f23771bb2bdd85337a58f5ba0757f60782
Author: John Baldwin <jhb at FreeBSD.org>
Date:   2020-12-31 19:56:33 +0000
Branch: stable/12
URL:    https://cgit.FreeBSD.org/src/commit/?id=939430f23771bb2bdd85337a58f5ba0757f60782

The mix of fields for name and date is a bit odd though.  Perhaps another
alternative might be to elide the Author fields if the Author == Committer?
That would keep a lean format when when the individuals are the same.
For that suggestion, I think you would always show the two Commit fields
("Committer" and "CommitDate") and only show "Author" and "AuthorDate"
if Author != Committer?  This would still be verbose for the change I'm
referencing here, but would collapse the detail a bit for the (current)
common case of people committing or merging their own changes.

-- 
John Baldwin


More information about the freebsd-git mailing list