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, 16:57 UTC
Message-ID
<CAEVs+zbCj0Zv0t4_WG6y2jcLoXwHy-Mu-LH31c_QgFaE9i3HtQ@mail.gmail.com>
In-Reply-To
<20170905153636.tsmlq3wv7ztpc67z@sigill.intra.peff.net>
On Tue, Sep 5, 2017 at 11:36 AM, Jeff King <peff@peff.net> wrote:
Show 5 quoted lines
> So I'd argue that "git commit -F" is doing a reasonable
> thing, and "commit-tree -F" should probably change to match it (because
> it's inconsistent, and because if anything the plumbing commit-tree
> should err more on the side of not touching its input than the porcelain
> commit command).

I would agree that "commit-tree -F" should change to match the behavior of "git commit -F --cleanup=verbatim". I feel pretty strongly that this type of cleanup logic shouldn't be done in a plumbing command, though I'm not sure it is a big enough deal to change behavior/compatibility for everyone.

Show 5 quoted lines
>   $ tree=$(git write-tree)
>   $ commit=$(printf end | git commit-tree $tree)
>   $ git cat-file commit $commit | xxd
>   ...
>   00000090: 3034 3030 0a0a 656e 64                   0400..end

Yup, confusion #2. I was using "-F -" which I see now is a different code path. Reading via stdin without "-F -" _is_ the verbatim option. This difference burned someone else on the mailing list as well. See:

https://public-inbox.org/git/CACAUoX6zT0wXxCLXK+sk0e4hgfD_A_EWWKvWnTOXK0-hzw7BUg@mail.gmail.com/
Probably more reason that "-F" should be 'verbatim' by default.
~Ross
Previous: Jeff KingNext: Jeff King
Message 5 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.