git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Nikita Bobko <nikitabobko@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [Bug report] git format-patch + git am doesn't preserve original commit message
Date: Thu, 10 Jun 2021 12:29:41 -0400	[thread overview]
Message-ID: <YMI99TBbZ1zCFE1V@coredump.intra.peff.net> (raw)
In-Reply-To: <CAMJzOtx9D7KthsUi7eLcmz7rszOQh8t=-VhXeOGDX1CMV1iERQ@mail.gmail.com>

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

      reply	other threads:[~2021-06-10 16:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 15:04 [Bug report] git format-patch + git am doesn't preserve original commit message Nikita Bobko
2021-06-10 15:11 ` Jeff King
2021-06-10 15:36   ` Nikita Bobko
2021-06-10 16:29     ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMI99TBbZ1zCFE1V@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=nikitabobko@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).