From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 29BFA1F5AE for ; Thu, 10 Jun 2021 15:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbhFJPNK (ORCPT ); Thu, 10 Jun 2021 11:13:10 -0400 Received: from cloud.peff.net ([104.130.231.41]:51424 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbhFJPNK (ORCPT ); Thu, 10 Jun 2021 11:13:10 -0400 Received: (qmail 8096 invoked by uid 109); 10 Jun 2021 15:11:13 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 10 Jun 2021 15:11:13 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 31228 invoked by uid 111); 10 Jun 2021 15:11:13 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 10 Jun 2021 11:11:13 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 10 Jun 2021 11:11:12 -0400 From: Jeff King To: Nikita Bobko Cc: git@vger.kernel.org Subject: Re: [Bug report] git format-patch + git am doesn't preserve original commit message Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Jun 10, 2021 at 05:04:58PM +0200, Nikita Bobko wrote: > Steps to reproduce: > ``` > git init > git commit --allow-empty -m 'root' > echo foo > foo > git add . > git commit -m '[tag] foo' > git checkout @~ > git format-patch master~..master > cat 0001-tag-foo.patch | git am > ``` > Expected: commit message generated by `git am` is `[tag] foo` > Actual: commit message generated by `git am` is `foo` This is working as intended. See the "-k" option of git-am and git-mailinfo (and also "-b" for mailinfo). -Peff