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

Re: [Bug] commit-tree shouldn't append an extra newline to commit messages

From
Ross Kabus <rkabus@aerotech.com>
Date
Sep 5, 2017, 15:09 UTC
Message-ID
<CAEVs+zbbWQuM-=5d04bkpTu38Mr4PyczskNhni5K1u_nzh-2Qw@mail.gmail.com>
In-Reply-To
<20170902083319.lcugfpkkk5lahieb@sigill.intra.peff.net>
On Sat, Sep 2, 2017 at 4:33 AM, Jeff King <peff@peff.net> wrote:
> But I am confused by your "inconsistent with git commit porcelain"
> comment. The porcelain git-commit definitely _does_ add a newline if one
> isn't present (and in fact runs the whole thing through git-stripspace
> to clean up whitespace oddities).

Ok I figured out my confusion. The repository I am working with did commits with "git commit --cleanup=verbatim" thus do not have a newline. This is why I thought there was an inconsistency.

> So I don't think "inconsistent with git-commit" is a compelling
> argument, unless I'm missing something.

Agreed, but now I guess I would argue that it is inconsistent because it lacks a "verbatim" option like git-commit has. I would like to see an argument like this for commit-tree but a clean way to add this option didn't immediately jump out at me.

> And definitely it does not when taking the message in via stdin.

I'm not seeing this, I see commit-tree as adding a new line even via stdin (and the code seems to corroborate this), unless I missed something.

~Ross
Previous: Jeff KingNext: Jeff King
Message 3 of 10 in “[Bug] commit-tree shouldn't append an extra newline to commit messages”
  1. Ross KabusSep 1, 2017
  2. Jeff KingSep 2, 2017
  3. Ross KabusSep 5, 2017
  4. Jeff KingSep 5, 2017
  5. Ross KabusSep 5, 2017
  6. Jeff KingSep 5, 2017
  7. Ross KabusSep 5, 2017
  8. Ross KabusSep 5, 2017
  9. Jeff KingSep 7, 2017
  10. Junio C HamanoSep 5, 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.