Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 2020 18:23:42 +0800
From:      Li-Wen Hsu <lwhsu@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        git@freebsd.org
Subject:   Re: Thoughts on git commit mail
Message-ID:  <CAKBkRUwP53fV3qGUgvDMyqbURtqQdqdTj3bvOsdc2Xya1s9now@mail.gmail.com>
In-Reply-To: <f90b2357-f13a-44da-42b7-c439f033f218@FreeBSD.org>
References:  <f90b2357-f13a-44da-42b7-c439f033f218@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 16, 2020 at 7:59 AM John Baldwin <jhb@freebsd.org> wrote:
>
> So far I have a few possible suggestions on the git commit mail
> that I would find useful.  Mostly it consists of making it a bit
> leaner:

Thanks for the inputs and I'll try to squeeze time to implement them,
and/or find a suitable place to put the insensitive config files and
scripts for let more people to join the development.

> 1) I would only display Author/AuthorDate.  The committer we can
>    infer from the e-mail sender.  This is what the gdb git commit
>    mails do.  In this case you can also just use 'Date' instead
>    of AuthorDate, e.g.:
>
> commit d79b57d3cf7151e45216c0f8501cdb2eb7a3bd86
> Author:     Glen Barber <gjb@FreeBSD.org>
> AuthorDate: 2020-12-13 21:31:39 +0000
> Commit:     Glen Barber <gjb@FreeBSD.org>
> CommitDate: 2020-12-13 21:31:39 +0000
>
> could become:
>
> commit d79b57d3cf7151e45216c0f8501cdb2eb7a3bd86
> Author: Glen Barber <gjb@FreeBSD.org>
> Date:   2020-12-13 21:31:39 +0000
>
> 2) I would drop the first sentence.  It's a bit redundant to list
>    the committer an extra time.  The branch name is useful, but it
>    might be nicer as metadata if possible, e.g.:
>
> Branch: main
>
>    The one thing this does lose is when a commit is a "cross-repo"
>    commit (e.g. docs committer committing to src or vice versa).
>    The best way to handle this might be to add a new optional
>    metadata field.  I don't have any good ideas on what to call
>    it.  It could either list the repositories a committer has a
>    bit for, or it could just be some kind of boolean
>    (Cross-Commit: yes).
>
> 3) Perhaps put the URL in the metadata section as well to reduce
>    extra blank lines at the start of the mail.
>
> 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@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.

BTW, the current commit hook does check all the commits in a push and
verify all the committer fields are the same with pusher, so the above
issue might not happen. I was just preserving some flexibility.

> 4) Some repository-specific things I would find helpful based on how
>    I have filtered svn commits:
>
>    - For doc, some kind of mail header ('X-Git-Foo') to indicate commits that
>      only touch translations as separate from English and top-level shared
>      areas.  Previously I used some pattern matches on paths in svn subjects
>      to do this.
>
>    - For src, some kind of mail header to indicate commits that touch the
>      kernel vs only touching userland.

I don't quite get these, can you provide some examples to help me
understand them thoroughly?  Do you mean we can have something like we
have in svn, there are the paths (directories) touched in the subject
and headers?  This was not implemented when the doc migration due to
the time constraint, but I'll look into them after the higher priority
items in the migration are done.

Best,
Li-Wen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKBkRUwP53fV3qGUgvDMyqbURtqQdqdTj3bvOsdc2Xya1s9now>