Re: Make commit messages optional

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 9, 2022 at 1:32 PM Michal Suchánek <msuchanek@xxxxxxx> wrote:
>
> On Fri, Apr 08, 2022 at 07:32:03PM -0400, rsbecker@xxxxxxxxxxxxx wrote:
> > On April 8, 2022 6:30 PM, brian m. carlson wrote:
> > >On 2022-04-08 at 03:35:04, jurgen_gjoncari@xxxxxxxxxx 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.
> > >
[...]
> > >
> > >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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux