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

Re: [RFC] send-email: avoid duplicate In-Reply-To and References headers

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2017, 01:41 UTC
Message-ID
<xmqq60kggp8r.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170212003432.GA19519@starla>
Eric Wong <e@80x24.org> writes:
Show 12 quoted lines
> When parsing an mbox, it is possible to get existing In-Reply-To
> and References headers blindly appended into the headers of
> message we generate.   This is probably the wrong thing to do
> and we should prioritize what was given in the command-line,
> cover letter, and previously-sent messages.
>
> One example I've noticed in the wild was:
>
> https://public-inbox.org/git/20161111124541.8216-17-vascomalmeida@sapo.pt/raw
> ---
>  I'm not completely sure this is what Vasco was doing in that
>  message, so it's an RFC for now...

I think it is sensibleto give priority to the --in-reply-to option given from the command line over the in-file one. I am not sure if we want to drop references, though. Wouldn't it make more sense to just add what we got from the command line to what we read from the file? I dunno.

Show 22 quoted lines
>  git-send-email.perl | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 068d60b3e6..5ab3d8585c 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1543,7 +1543,13 @@ foreach my $t (@files) {
>  			elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) {
>  				push @xh, $_;
>  			}
> -
> +			elsif (/^(?:References|In-Reply-To):/i) {
> +				if (defined $initial_reply_to || $thread) {
> +					warn
> +"Ignoring $_ header in mbox body since it conflicts with\n
> +--in-reply-to and --thread switches\n"
> +				}
> +			}
>  		} else {
>  			# In the traditional
>  			# "send lots of email" format,
Previous: Eric WongNext: Eric Wong
Message 2 of 4 in “[RFC] send-email: avoid duplicate In-Reply-To and References headers”
  1. Eric WongFeb 12, 2017
  2. Junio C HamanoFeb 12, 2017
  3. Eric WongFeb 12, 2017
  4. Junio C HamanoFeb 12, 2017

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.