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