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

Re: Make commit messages optional

From
EEErik Cervin Edin <erik@cervined.in>
Date
Apr 8, 2022, 19:25 UTC
Message-ID
<CA+JQ7M-uSatD4=HHxaqe4yVAJ5WGuWC_BprX4hnfKSrt6-1GEg@mail.gmail.com>
In-Reply-To
<220408.86r167bxra.gmgdl@evledraar.gmail.com>
At the risk of bikeshedding.

The case in favor of not allowing empty commit messages by default is that most of the time, empty commit messages are useless.

I've written my fair share of poor commit messages (-,..., wip, foo). Sometimes I've fixed that retroactively, sometimes not. The advantage I see with empty commit messages is that it's more ubiquitous to "write something better" or "whatever". The downside is I can't git log --grep '^$' to find them.

On Fri, Apr 8, 2022 at 7:47 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 5 quoted lines
>
> I think one of the best things about git's design is how in most other
> areas we've really leaned into that design ethos. I.e. you can commit
> whatever train-of-thought garbage you want, but we make it really easy
> to interactively rebase all of that before pushing (or "finalizing") it.

True. But this is power-user territory. AFAIK, very few users rebase -i and very few tools support interactive rebasing. Those that do probably have no problem aliasing git commit to adapt to that workflow on their own, without different defaults.

Show 5 quoted lines
> E.g. I wouldn't mind if we made pushes start failing (probably guarded
> by appropriate isatty() checks) if the user was pushing content without
> commit messages, unless some option were overridden, or we could start
> sternly warning about that. Ditto for merging a branch into another one
> (especially if we can see it's the default branch).

I could see this being a potentially nice option but also pretty much .git/hooks/pre-push.sample but with rev-list --grep '^$' (which doesn't appear to work)

> it's not
> a problem that some commit somewhere has an empty message, rather it's
> that such a commit gets "propagated". A better place to check for it is
> then at the point of point of propagation.

I agree in spirit, but also feel obliged to point out the immutability of commit messages in most user workflows. In such workflows, the propagation in a sense becomes the point of commiting.

My experience is that in most typical GUI workflows, the writing of a commit message is not a very high point of friction. These environments typically instead favor larger commits due to friction of staging/unstaging. In such situations, it's more important to write a commit message that at least says *something*.

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 4 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.