Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Emily Shaffer <nasamuffin@google.com>,
	Git List <git@vger.kernel.org>,
	michael.strawbridge@amd.com
Subject: Re: bug report: cover letter is inheriting last patch's message ID with send-email
Date: Wed, 17 May 2023 13:20:55 -0700	[thread overview]
Message-ID: <CAD=FV=WxB8bqKZSkGQYuPxJ6BeA5fbNWcwfiTyhktn83bzCHfg@mail.gmail.com> (raw)
In-Reply-To: <xmqqfs7upvvw.fsf@gitster.g>

Hi,

On Wed, May 17, 2023 at 1:04 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Doug Anderson <dianders@chromium.org> writes:
>
> > Yes. It exists in all of the patches except 0000-cover-letter.patch.
> > ...but when the mail gets actually sent the cover letter and last
> > patch (0006 in the case I reported) end up sharing the same Change ID.
> > With older versions of git send-email the cover letter would get an
> > auto-generated Message-Id.
>
> Yeah, I think the patch I sent in the thread should help; I'd
> appreciate it if you folks can test and verify.

Yup, tested. It works!


> >> I suspect that
> >> is the root cause of the problem; if 000[1-6]-*.patch already has
> >> their own Message-ID: because --thread is used when running
> >> git-format-patch, they would also have In-Reply-To: and References:,
> >> but there is no way for them to reference 0000-cover-letter.patch
> >> (because format-patch did not get a chance to generate Message-ID to
> >> it), is there?
> >
> > The patches were generated with git-format-patch but the Message-ID
> > was added by patman [1]. The Message-ID encodes the local Change-Id
> > which can make it easier to associate one version of the same patch
> > with another (same reason gerrit uses Change-Id) [2]. There is no
> > Change-Id associated with the cover letter so patman doesn't bother
> > adding one there and has always just let it be auto-generated.
>
> > We
> > could certainly change patman to make up a Message-Id for the cover
> > letter, but there is no real need.
>
> This is a tangent, as I think the earlier patch should fix the
> regression, but wouldn't a recipient of such a series have a hard
> time to locate and group the patches in the same series with the
> cover letter, without having In-Reply-To: or References: that links
> the later message back to the initial message (i.e. cover letter)?
> Assigning a Message-ID to the cover, and referencing it from the
> patches via In-Reply-To:, is what is commonly done, I think, for
> that kind of threading.

It has always magically worked.

For instance, looking at a patch series I sent before the regression.
You can see the cover letter here with an automatically-assigned
Message-Id:

https://lore.kernel.org/linux-arm-kernel/20230504221349.1535669-1-dianders@chromium.org/

You can then look at patch #1, which had a Message-Id assigned to it
by patman (by simply adding a "Message-Id" line to the patch file
after git format-patch but before calling git send-email):

https://lore.kernel.org/linux-arm-kernel/20230504151100.v4.1.I8cbb2f4fa740528fcfade4f5439b6cdcdd059251@changeid/

You can see that it properly references the cover letter. Specifically
in the raw message you can see:

In-Reply-To: <20230504221349.1535669-1-dianders@chromium.org>
References: <20230504221349.1535669-1-dianders@chromium.org>

-Doug

      reply	other threads:[~2023-05-17 20:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 18:38 bug report: cover letter is inheriting last patch's message ID with send-email Emily Shaffer
2023-05-17 19:01 ` Junio C Hamano
2023-05-17 19:22   ` Junio C Hamano
2023-05-17 20:14     ` Doug Anderson
2023-05-17 20:21       ` Junio C Hamano
2023-05-18  0:51     ` Michael Strawbridge
2023-05-18  1:06       ` Junio C Hamano
2023-05-17 19:24   ` Doug Anderson
2023-05-17 20:04     ` Junio C Hamano
2023-05-17 20:20       ` Doug Anderson [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

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

  git send-email \
    --in-reply-to='CAD=FV=WxB8bqKZSkGQYuPxJ6BeA5fbNWcwfiTyhktn83bzCHfg@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=michael.strawbridge@amd.com \
    --cc=nasamuffin@google.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.
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).