git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] git-send-email.perl: fix In-Reply-To for second and subsequent patches

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 19, 2010, 18:26 UTC
Message-ID
<7v4oci11k6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1287481964-8883-1-git-send-email-ospite@studenti.unina.it>
Antonio Ospite <ospite@studenti.unina.it> writes:
Show 5 quoted lines
> Make second and subsequent patches appear as replies to the first patch,
> even when an initial In-Reply-To is supplied; this is the typical
> behaviour we want when we send a series with cover letter in reply to
> some discussion, and this is also what the man page says about
> the --in-reply-to option.
I am not so sure if that is what the documentation says.
 1. When --in-reply-to gives $reply_to, the first one becomes a reply to
    that message, with or without --chain-reply-to.
 2. When --chain-reply-to is in effect, all the messages are strung
    together to form a single chain.  The first message may be in reply to
    the $reply_to given by --in-reply-to command line option (see
    previous), or the root of the discussion thread.  The second one is a
    response to the first one, and the third one is a response to the
    second one, etc.
 3. When --chain-reply-to is not in effect:
    a. When --in-reply-to is used, too, the second and the subsequent ones
       become replies to $reply_to.  Together with the first rule, all
       messages become replies to $reply_to given by --in-reply-to.
    b. When --in-reply-to is not used, presumably the second and
       subsequent ones become replies to the first one, which would be the
       root.

The documentation is reasonably clear about the 1., 2. and 3a. above, I think, even though I do not think 3b. is clearly specified.

If you are changing 3a. above so that the first message becomes a response to $reply_to, and the second one becomes a response to the first message (and the third and subsequent ones too when --chain-reply-to is not in effect), you would need to update the documentation as well. Even if it might be of good kind, it would be a change of the established behaviour.

Show 18 quoted lines
> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
> index a298eb0..410b85f 100755
> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -295,6 +295,20 @@ test_expect_success $PREREQ 'Valid In-Reply-To when prompting' '
>  	! grep "^In-Reply-To: < *>" msgtxt1
>  '
>  
> +test_expect_success $PREREQ 'In-Reply-To in second patch with --thread' '
> +	clean_fake_sendmail &&
> +	git send-email \
> +		--from="Example <nobody@example.com>" \
> +		--to=nobody@example.com \
> +		--thread \
> +		--in-reply-to="<unique-message-id@example.com>" \
> +		--smtp-server="$(pwd)/fake.sendmail" \
> +		$patches $patches \
> +		2>errors
You are breaking the && chain here.
> +        # The second patch should be seen as reply to the first one
> +        test $(sed -n -e "s/^In-Reply-To:\(.*\)/\1/p" msgtxt2) = $(sed -n -e "s/^Message-Id:\(.*\)/\1/p" msgtxt1)
> +'

You would need to test the interaction with --chain-reply-to as well, so there should be another test, and you would probably need three messages fed to send-email not just two to see the effect of the interaction.

Thanks.
Previous: Antonio OspiteNext: Junio C Hamano
Message 5 of 19 in “git-send-email.perl: fix In-Reply-To for second and subsequent patches”
  1. git-send-email.perl: fix In-Reply-To for second and subsequent patchesAntonio Ospite, Oct 14, 2010
  2. Jonathan NiederOct 14, 2010
  3. Antonio OspiteOct 15, 2010
  4. git-send-email.perl: fix In-Reply-To for second and subsequent patchesAntonio Ospite, Oct 19, 2010
  5. Junio C HamanoOct 19, 2010
  6. Junio C HamanoOct 19, 2010
  7. Antonio OspiteOct 19, 2010
  8. Antonio OspiteOct 26, 2010
  9. git-send-email.perl: make initial In-Reply-To apply only to first emailAntonio Ospite, Nov 5, 2010
  10. Matthieu MoyNov 5, 2010
  11. Junio C HamanoNov 9, 2010
  12. Antonio OspiteNov 10, 2010
  13. Junio C HamanoNov 10, 2010
  14. [PATCHi v4] git-send-email.perl: make initial In-Reply-To apply only to first emailAntonio Ospite, Nov 12, 2010
  15. Junio C HamanoNov 12, 2010
  16. Junio C HamanoNov 12, 2010
  17. Antonio OspiteNov 12, 2010
  18. Jonathan NiederNov 5, 2010
  19. Antonio OspiteNov 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.