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

Re: How to make devs write better commit messages

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Dec 7, 2011, 00:08 UTC
Message-ID
<CAE1pOi3REHvQjrO+=K+qt5dH60U+Le4Ty_Vq2nFPpWS27h1+Eg@mail.gmail.com>
In-Reply-To
<CAOJsP-X0ZWT5HLHcBc2FmhoMpWFOvEFADiM9jGZ9R1ctqHDJ9w@mail.gmail.com>
On 6 December 2011 14:55, Joseph Huttner <huttnified@gmail.com> wrote:
Show 21 quoted lines
> So I know that there is a somewhat standard format of commit messages
> in Git, which Linus outlines here:
>
> https://github.com/torvalds/subsurface/blob/master/README#L164
>
> Trouble is, when most people go to commit, the file that the editor
> opens has no reminder of how to write a proper commit message.  Often
> I find myself having to go back through the commit log, or consulting
> the above link.
>
> I propose two things:
>
> 1.  An optional flag in the Git config that, if set, shows the format
> of a typical commit message in your commit message template.
>
> 2.  The ability to modify this commit message template.  Many teams
> use automated tools to read commit messages and then do automated
> tasks based on that data, like comment an RT ticket.  Thus, developers
> need to be reminded of these team-specific settings as well.
>
> What are your thoughts?

Great idea! These templates would be stored in the Git repo, I assume? Btw, there is 'commit.template' which you can use locally.

 I was wondering if it might be possible to somehow add project config
defaults to one's Git repo. It would be great to have something like
'commit.template' point to a file in the Git repo by default.
Currently, it doesn't seem possible to have a config parameter "point
to" a file or directory in the Git repo. Nor do I know of a way to
have the Git repo set a config parameter to a default value. Or is
this possible after all?
Previous: Junio C HamanoNext: Thomas Koch
Message 4 of 5 in “How to make devs write better commit messages”
  1. Joseph HuttnerDec 6, 2011
  2. Michael SchubertDec 6, 2011
  3. Junio C HamanoDec 7, 2011
  4. Hilco WijbengaDec 7, 2011
  5. Thomas KochDec 7, 2011

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.