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

Re: [PATCH] commit & merge: modularize the empty message validator

From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Date
Jul 14, 2017, 17:49 UTC
Message-ID
<1500054552.18990.8.camel@gmail.com>
In-Reply-To
<xmqqiniww37i.fsf@gitster.mtv.corp.google.com>
On Thu, 2017-07-13 at 12:23 -0700, Junio C Hamano wrote:
Show 5 quoted lines
> All good points; if it bothers you that "commit" and "merge" define
> "emptyness" of the buffer differently too much, I think you could
> persuade me to unify them to "the buffer _must_ contain no bytes",
> i.e. not special-casing sign-off lines only "commit".
> 
Intereseting, let me give it a try.

To persuade you with this, I have to convince you that the current behaviour (special-casing of sign-off lines) is defective and/or biased. It really is for quite a few reasons,

            * Though it's not apparent, it indirectly seems to be hindering
            (to some extent) the idea of including the sign-off (or) other
            trailers which *can't be modified* by the user.
            IOW, the current behaviour seems make the contributors/users
            falsely believe (at least to some extent) that git *does* have
            trailers for commit messages and thus preventing them from coming
            up with ideas that could make "untouchable trailers" a reality.
            Thus, consider "the buffer _must_ contain no bytes" hoping this
            would initiate a "Butterfly effect" :)
        * Looking from an implementation perspective, it's biased in that
        it checks only for sign-offs. Making it work in general is
        difficult as there's no standard definition for the term
        <trailer>. That's because it varies with respect to usage, I
        think. Different people/projects may consider different lines to
        be trailer lines. A few examples are,
            * Bug:
            * Fixes:
            * Change-id:
            * Helped-by:
        Moreover, some people may wish to have commit messages that only
        have such trailers (e.g. "Fixes:"). So, it's difficult to do a
        generalized implementation that aborts when the message is empty
        or consists only of trailers.
        Thus, consider "the buffer _must_ contain no bytes" because it's
        not easy to define what a <trailer> means and special casing
        "sign-off" is biased.
        * Imagine a hypothetical version of git that aborts when the
        <message> is empty though a <trailer> is present. This would
        quite possibly instigate controversies as the "hypothetical git"
        reduces the "valid commit messages" and would quite possibly
        reject a commit message as "empty" (which is uncommunicative)
        though a previous version (which did not have this change)
        accepted a similar message.
        SO, bringing in the Occam's razor, let's choose the option that's
        the simplest and makes the fewest assumptions.

Thus, I conclude that the considering a commit message consisting only of <trailer>s as empty isn't a good idea and should be dropped.

-- 
Kaartic
Previous: Junio C HamanoNext: Kaartic Sivaraam
Message 17 of 24 in “Why doesn't merge fail if message has only sign-off?”
  1. Kaartic SivaraamJul 2, 2017
  2. Junio C HamanoJul 3, 2017
  3. Kaartic SivaraamJul 4, 2017
  4. merge-message: change meaning of "empty merge message"Kaartic Sivaraam, Jul 6, 2017
  5. Kevin DaudtJul 6, 2017
  6. Kaartic SivaraamJul 6, 2017
  7. commit & merge: modularize the empty message validatorKaartic Sivaraam, Jul 11, 2017
  8. Kaartic SivaraamJul 11, 2017
  9. Junio C HamanoJul 11, 2017
  10. Kaartic SivaraamJul 13, 2017
  11. Junio C HamanoJul 13, 2017
  12. Kaartic SivaraamJul 14, 2017
  13. Christian BrabandtJul 17, 2017
  14. Junio C HamanoJul 17, 2017
  15. Kaartic SivaraamJul 13, 2017
  16. Junio C HamanoJul 13, 2017
  17. Kaartic SivaraamJul 14, 2017
  18. Kaartic SivaraamJul 15, 2017
  19. branch: change the error messages to be more meaningfulKaartic Sivaraam, Aug 21, 2017
  20. Kaartic SivaraamAug 21, 2017
  21. commit: change the meaning of an empty commit messageKaartic Sivaraam, Aug 21, 2017
  22. Junio C HamanoAug 24, 2017
  23. Kaartic SivaraamAug 31, 2017
  24. Kaartic SivaraamOct 2, 2017

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.