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

Re: Git Bug - diff in commit message.

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 8, 2011, 17:27 UTC
Message-ID
<7v39g7x7v1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1315493353942-6772145.post@n2.nabble.com>
anikey <arty.anikey@gmail.com> writes:
> Hi, peops. I'm pretty much sure that's a bug.
I am not Peops, but will try to help ;-).

As "rebase" is essentially "format-patch" output piped into "am", unindented diff in a random place inside the commit message will be indistingushable from the beginning of the patch. You cannot have an unadulterated "diff" output in your commit message for this reason, and this is not likely to change.

Often what people do is to indent them, as the reason they quote patch in the message is to make it serve as a supporting material. Incidentally, that makes the resulting commit log message easier to read as well; e.g.

        Fix bloop bug
        An earlier commit had this patch that is quite bogus.
            diff --git a/bloop.php b/bloop.php
            index 937da74..0e8440d 100644
            --- a/bloop.php
            +++ b/bloop.php
            @@ -42,7 +42,7 @@
            ...
        The assignment to frotz in the above hunk should happen after
        nitfol variable is initialized.
        This patch fixes it.
        Signed-off-by: Cont Ributer <contributor@example.com>
Previous: Junio C Hamano
Message 9 of 9 in “Git Bug - diff in commit message.”
  1. anikeySep 8, 2011
  2. Michael WittenSep 8, 2011
  3. Thomas RastSep 9, 2011
  4. Johannes SixtSep 9, 2011
  5. Junio C HamanoSep 9, 2011
  6. Junio C HamanoOct 11, 2011
  7. Martin von ZweigbergkOct 24, 2011
  8. Junio C HamanoOct 25, 2011
  9. Junio C HamanoSep 8, 2011

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.