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

Re: Make commit messages optional

From
Tao Klerks <tao@klerks.biz>
Date
Apr 10, 2022, 13:59 UTC
Message-ID
<CAPMMpoi50j7MzrsokQAcBWBgj8qGPN=j68PuEsppv629Oh7GHg@mail.gmail.com>
In-Reply-To
<20220409113244.GX163591@kunlun.suse.cz>
On Sat, Apr 9, 2022 at 1:32 PM Michal Suchánek <msuchanek@suse.de> wrote:
Show 6 quoted lines
>
> On Fri, Apr 08, 2022 at 07:32:03PM -0400, rsbecker@nexbridge.com wrote:
> > On April 8, 2022 6:30 PM, brian m. carlson wrote:
> > >On 2022-04-08 at 03:35:04, jurgen_gjoncari@icloud.com wrote:
> > >> I think that often commit messages are unnecessary. I propose that by
> > >> default a user should be able to commit without a message.
[...]
> > >We want to encourage good software engineering practices.
> > >
[...]
Show 6 quoted lines
> > >
> > >Users who want this behaviour can use --allow-empty-message or create an alias
> > >with that option.  The functionality already exists.  I use aliases extensively in my
> > >development and I know others do as well, so this shouldn't be an impediment if
> > >you're working on projects where this is acceptable.
> > >
[...]
>
> There is nothing stopping you using '.' as the commit message which is
> as informative as when it is empty. Hence this enforcement of non-empty
> commit message does not serve the stated purpose.

My apologies if this proposal has already been made in this or prior discussions - the list server and gmail are having another disagreement, so I think I'm a few hours out of date.

I believe the main argument *for* allowing empty commit messages by
default is "we shouldn't make it hard to do what you want to do, if
you can fix it later", and the main argument *against* is "for most
people (non-advanced users), what you do initially is what you end up
pushing, or at least trying to push, and fixing things later is *hard*
- it requires a much deeper understanding of git than most people
otherwise necessarily need to develop".

In that sense, allowing people to create empty commit messages when they shouldn't, is often "trapping" them into a commit history that is less valuable (or even acceptable) than they might otherwise have achieved.

While I therefore disagree with Aevar's proposal to "allow empty, and advise", I do think the notion of giving advice makes perfect sense - let's do it the other way around, with an advice message something like:

--- Empty commit messages aren't normally allowed, as they reduce the understandability of the commit history. If you do need to create a commit with an empty message, you can do so by providing the '--allow-empty-message' argument to 'git commit'. ---

Has this already been considered/discussed? Would it meet the objectives of those folks saying "the rejection of empty messages wasted my time", while also keeping the spirit of "we should make it easy to do the right thing and harder to do the wrong thing, especially for beginners"?

Thanks, Tao

Previous: Michal SuchánekNext: rsbecker@nexbridge.com
Message 14 of 29 in “Make commit messages optional”
  1. jurgen_gjoncari@icloud.comApr 8, 2022
  2. Christian CouderApr 8, 2022
  3. Ævar Arnfjörð BjarmasonApr 8, 2022
  4. Erik Cervin EdinApr 8, 2022
  5. Ævar Arnfjörð BjarmasonApr 11, 2022
  6. Junio C HamanoApr 11, 2022
  7. Michal SuchánekApr 11, 2022
  8. Junio C HamanoApr 11, 2022
  9. Philip OakleyApr 8, 2022
  10. Phillip SusiApr 8, 2022
  11. brian m. carlsonApr 8, 2022
  12. rsbecker@nexbridge.comApr 8, 2022
  13. Michal SuchánekApr 9, 2022
  14. Tao KlerksApr 10, 2022
  15. rsbecker@nexbridge.comApr 10, 2022
  16. rsbecker@nexbridge.comApr 10, 2022
  17. Tao KlerksApr 10, 2022
  18. Jonathan NiederApr 13, 2022
  19. demerphqApr 11, 2022
  20. rsbecker@nexbridge.comApr 11, 2022
  21. Ævar Arnfjörð BjarmasonApr 11, 2022
  22. Tao KlerksApr 11, 2022
  23. Junio C HamanoApr 11, 2022
  24. Michal SuchánekApr 11, 2022
  25. tytsoApr 11, 2022
  26. Ævar Arnfjörð BjarmasonApr 11, 2022
  27. Theodore Ts'oApr 14, 2022
  28. Ævar Arnfjörð BjarmasonApr 14, 2022
  29. Junio C HamanoApr 14, 2022

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.