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

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/16/20 2:23 AM, Li-Wen Hsu wrote:
> 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.

Certainly we should get some consensus on the format and if we make
changes, batch them up and only make them once.  I was trying to kick
start that discussion.

>> 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.

FWIW, to keep a clean liner history, GDB's policy is that committers
always do a 'git rebase --ignore-date' prior to pushing to master
which results in only a single effective date.  It also means that
dates and times are monotonic in 'git log' which I find to be a
feature.
 
>> 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.

So I'm not sure what the best approach to follow here is.  I think trying
to list all the subdirectories affected in separate headers (e.g.
X-Git-Subdir) would be expensive to generate, but maybe that wouldn't
be the worst thing (e.g. my kernel-request could then just match on if
there's an 'X-Git-Subdir' header that matches 'sys*').  The other options
might be to add specific custom headers such as 'X-Git-Kernel: yes' for
commits that touch the kernel.  To be clear, this also falls more under
"would be nice to have" than a "must".

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?22b040fa-6afa-2453-3d84-f26bce0e5132>