Commit messages and the move to git

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Fri Nov 8 13:43:00 GMT 2019


On 07/11/2019 14:27, Eric S. Raymond wrote:
> Jeff Law <law@redhat.com>:
>> On 11/4/19 3:29 AM, Richard Earnshaw (lists) wrote:
>>> With the move to git fairly imminent now it would be nice if we could
>>> agree on a more git-friendly style of commit messages; and, ideally,
>>> start using them now so that the converted repository can benefit from
>>> this.
>>>
>>> Some tools, particularly gitk or git log --oneline, can use one-line
>>> summaries from a commit's log message when listing commits.  It would be
>>> nice if we could start adopting a style that is compatible with this, so
>>> that in future commits are summarized in a useful way.  Unfortunately,
>>> some of our existing commits show no useful information with tools like
>>> this.
>> I'd suggest we sync policy with glibc.  They're further along on the
>> ChangeLog issues.  Whatever they do in this space we should follow --
>> aren't we going to be using some of their hooks/scripts?
> 
> Note that my reposurgeon conversion recipe runs gitify on the repository.
> 
>  From the documentation:
> 
>      Attempt to massage comments into a git-friendly form with a blank
>      separator line after a summary line.  This code assumes it can insert
>      a blank line if the first line of the comment ends with '.', ',', ':',
>      ';', '?', or '!'.  If the separator line is already present, the comment
>      won't be touched.
> 
>      Takes a selection set, defaulting to all commits and tags.
> 

Which makes me wonder if, given a commit log of the form:


2019-10-30  Richard Biener  <rguenther@suse.de>

         PR tree-optimization/92275
         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_loops):
         Copy all loop-closed PHIs.

         * gcc.dg/torture/pr92275.c: New testcase.

Where the first line is a ChangeLog style date and author, we could spot 
the PR line below that and hoist it up as a more useful summary (perhaps 
by copying it rather than moving it).

It wouldn't fix all commits, but even just doing this for those that 
have PRs would be a help.

R.



More information about the Gcc mailing list