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

Re: Make commit messages optional

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 11, 2022, 20:10 UTC
Message-ID
<220411.86k0bvidja.gmgdl@evledraar.gmail.com>
In-Reply-To
<YlRyHR5rvG5P/Acr@mit.edu>
On Mon, Apr 11 2022, tytso wrote:
Show 23 quoted lines
> On Mon, Apr 11, 2022 at 12:19:51PM +0200, Ævar Arnfjörð Bjarmason wrote:
>> > 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".
>> 
>> Yes, maybe it won't be viable to go in that direction, but re this in my
>> [1]:
>> 	
>> 	But I'm also pretty sure that those people are engaged in a proxy war,
>> 	and we should just attack the "problem" directly instead. I.e. 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.
>
> So possible options we could consider:
>
> 1) Do nothing.  If users want to override the current behavior they
> can just put in their .git/config or ~/.gitconfig file:
>
> [alias]
>    commit = commit --allow-empty-message

You cannot use aliases to override built-in commands, so this won't work.

Show 26 quoted lines
> 2) Add some kind of explicit git-config option which could then be
> added to their .git/config or ~/.gitconfig:
>
> [commit]
>    allow-empty-description = true
>
> 3) Change the default, so that --allow-empty-message is always
> implied, and hope that novices can figure out git rebase -i without
> shooting themselves in the foot.
>
> 4) Enforce git push doesn't push commits with empty commits,
> implemented on the client side.  This could be implemented via a
> pre-push hook script.
>
> 5)  Enforce git push doesn't push commits with empty commits,
> implemented on the server side.This could be implemented via a
> pre-receive hook script.
>
> I will note that only options 2 and 3 require source code changes to
> git.  The rest can effectively be done via config file changes; for
> the hook files, we could provide example scripts to make it easier for
> people to choose that particular option.
>
> And of these options, only one option, #3, requires imposing someone's
> preference (which does appear to be in the minority) on everyone
> else.

We could add configuration or whatever, but the topic of this thread is whether we should change the *default*. I think it's better to stick to that.

Previous: tytsoNext: Theodore Ts'o
Message 26 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.