Thread (4 messages) flat view 4 messages, 2 authors, 2021-06-10

Re: [Bug report] git format-patch + git am doesn't preserve original commit message

From: Jeff King <hidden>
Date: 2021-06-10 16:29:44

On Thu, Jun 10, 2021 at 05:36:43PM +0200, Nikita Bobko wrote:
Oh, I see, thank you, it works.

But actually, I am not sure that it's "expected" behavior. I would
expect git to preserve original message by default without any
additional flags. Shouldn't `--keep-non-patch` flag in `git am` be
enabled by default then?
I'd be hesitant to change that, since it would break any communities
using other tags. I think 17635fc900 (mailinfo: -b option keeps
[bracketed] strings that is not a [PATCH] marker, 2009-07-15) has some
examples.

In your example, I think passing "-k" to both git-format-patch and
git-am is the right solution. But presumably that's a toy example. In
the real world, the person running "am" is probably not the same as the
one running format-patch (and if it is, probably something like
cherry-pick is a better solution anyway).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help