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

Re: [PATCH v4 5/6] send-email: --in-reply-to=<file> populate header fields

From
SGSamuel GROOT <samuel.groot@grenoble-inp.org>
Date
Jun 14, 2016, 22:35 UTC
Message-ID
<5221a7c5-3f4b-4061-6fc2-5019d784e03f@grenoble-inp.org>
In-Reply-To
<vpqoa7asnkw.fsf@anie.imag.fr>
On 06/09/2016 11:45 AM, Matthieu Moy wrote:
Show 25 quoted lines
> Samuel GROOT <samuel.groot@grenoble-inp.org> writes:
>
>> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
>> index edbba3a..21776f0 100644
>> --- a/Documentation/git-send-email.txt
>> +++ b/Documentation/git-send-email.txt
>> @@ -84,13 +84,16 @@ See the CONFIGURATION section for 'sendemail.multiEdit'.
>>  	the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not
>>  	set, as returned by "git var -l".
>>
>> ---in-reply-to=<identifier>::
>> +--in-reply-to=<Message-Id|email_file>::
>>  	Make the first mail (or all the mails with `--no-thread`) appear as a
>> -	reply to the given Message-Id, which avoids breaking threads to
>> -	provide a new patch series.
>> +	reply to the given Message-Id (given directly by argument or via the email
>> +	file), which avoids breaking threads to provide a new patch series.
>>  	The second and subsequent emails will be sent as replies according to
>>  	the `--[no]-chain-reply-to` setting.
>>  +
>> +Furthermore, if the argument is an email file, parse it and populate header
>> +fields appropriately for the reply.
>
> "populate header fields appropriately" would seem obscure to someone not
> having followed this converation. At least s/fields/To: and Cc: fields/.

We weren't sure how precise the documentation had to be, and tried to keep it concise.

Show 12 quoted lines
>> --- a/git-send-email.perl
>> +++ b/git-send-email.perl
>> @@ -55,6 +55,7 @@ git send-email --dump-aliases
>>      --[no-]bcc              <str>  * Email Bcc:
>>      --subject               <str>  * Email "Subject:"
>>      --in-reply-to           <str>  * Email "In-Reply-To:"
>> +    --in-reply-to          <file>  * Populate header fields appropriately.
>
> Likewise. To avoid an overly long line, I'd write just "Populate
> To/Cc/In-reply-to".
>
> Probably <file> should be <email_file>.
Thanks, will do in v5.
Show 18 quoted lines
>> +if ($initial_reply_to && -f $initial_reply_to) {
>> +	my $error = validate_patch($initial_reply_to);
>> +	die "fatal: $initial_reply_to: $error\nwarning: no patches were sent\n"
>> +		if $error;
>> +
>> +	open my $fh, "<", $initial_reply_to or die "can't open file $initial_reply_to";
>> +	my $mail = Git::parse_email($fh);
>> +	close $fh;
>> +
>> +	my $initial_sender = $sender || $repoauthor || $repocommitter || '';
>
> This is duplicated from the "if ($compose) { ... my $tpl_sender = ..." a
> bit later in the existing file. It would be better to get this "my
> $initial_sender = ..." out of your "if" and use $initial_sender directly
> later IMHO.
>
> Actually, $initial_sender does not seem to be a good variable name. It's
> not really "initial", right?
$sender looks like a better name, I will work on that, thanks!
Show 15 quoted lines
>> +	my $prefix_re = "";
>> +	my $subject_re = $mail->{"subject"}[0];
>> +	if ($subject_re =~ /^[^Re:]/) {
>> +		$prefix_re = "Re: ";
>> +	}
>> +	$initial_subject = $prefix_re . $subject_re;
>
> Why introduce $prefix_re. You can just
>
> 	my $subject = $mail->{"subject"}[0];
> 	if (...) {
>         	$subject = "Re: " . $subject;
>         }
>
> (preferably using sensible as '...' as noted by Junio ;-) ).
I will keep Junio's suggestion :-)
> In previous iterations of this series, you had issues with non-ascii
> characters in at least To: and Cc: fields (perhaps in the Subject field
> too?). Are they solved? I don't see any tests about it ...
Non-ascii characters are still an issue, I will work on that next week.
Previous: Matthieu MoyNext: Samuel GROOT
Message 92 of 96 in “send-email: new --quote-mail option”
  1. 0/2 send-email: new --quote-mail optionTom Russello, May 23, 2016
  2. 1/2 send-email: new option to quote an email and reply toTom Russello, May 23, 2016
  3. Eric WongMay 23, 2016
  4. Matthieu MoyMay 23, 2016
  5. Samuel GROOTMay 23, 2016
  6. Samuel GROOTMay 24, 2016
  7. Matthieu MoyMay 24, 2016
  8. Aaron SchrabMay 24, 2016
  9. Tom RusselloMay 25, 2016
  10. Eric WongMay 24, 2016
  11. Matthieu MoyMay 23, 2016
  12. Samuel GROOTMay 24, 2016
  13. Matthieu MoyMay 25, 2016
  14. Junio C HamanoMay 25, 2016
  15. Matthieu MoyMay 25, 2016
  16. Junio C HamanoMay 25, 2016
  17. Matthieu MoyMay 25, 2016
  18. Samuel GROOTMay 26, 2016
  19. Matthieu MoyMay 27, 2016
  20. 2/2 t9001: adding --quote-mail option testTom Russello, May 23, 2016
  21. Matthieu MoyMay 23, 2016
  22. Matthieu MoyMay 23, 2016
  23. Samuel GROOTMay 23, 2016
  24. 0/2 send-email: new --quote-email optionTom Russello, May 27, 2016
  25. 1/2 send-email: quote-email populates the fieldsTom Russello, May 27, 2016
  26. Matthieu MoyMay 28, 2016
  27. Tom RusselloMay 29, 2016
  28. 2/2 send-email: quote-email quotes the message bodyTom Russello, May 27, 2016
  29. Matthieu MoyMay 28, 2016
  30. Tom RusselloMay 29, 2016
  31. 0/6 send-email: cleaner tests and quote emailTom Russello, Jun 7, 2016
  32. 1/6 t9001: non order-sensitive file comparisonTom Russello, Jun 7, 2016
  33. Junio C HamanoJun 8, 2016
  34. Samuel GROOTJun 8, 2016
  35. Junio C HamanoJun 8, 2016
  36. Samuel GROOTJun 8, 2016
  37. Matthieu MoyJun 9, 2016
  38. Samuel GROOTJun 13, 2016
  39. Matthieu MoyJun 9, 2016
  40. Tom RusselloJun 9, 2016
  41. 2/6 t9001: check email address is in Cc: fieldTom Russello, Jun 7, 2016
  42. Matthieu MoyJun 9, 2016
  43. Samuel GROOTJun 13, 2016
  44. 3/6 t9001: shorten send-email's outputTom Russello, Jun 7, 2016
  45. Eric WongJun 8, 2016
  46. Samuel GROOTJun 8, 2016
  47. Matthieu MoyJun 9, 2016
  48. 4/6 send-email: create email parser subroutineTom Russello, Jun 7, 2016
  49. 5/6 send-email: --in-reply-to=<file> populates the fieldsTom Russello, Jun 7, 2016
  50. 6/6 send-email: add option --cite to quote the message bodyTom Russello, Jun 7, 2016
  51. (unknown)Samuel GROOT, Jun 8, 2016
  52. 1/6 t9001: non order-sensitive file comparisonSamuel GROOT, Jun 8, 2016
  53. Remi Galan AlfonsoJun 8, 2016
  54. Samuel GROOTJun 8, 2016
  55. Junio C HamanoJun 8, 2016
  56. Samuel GROOTJun 8, 2016
  57. Junio C HamanoJun 8, 2016
  58. Samuel GROOTJun 8, 2016
  59. 2/6 t9001: check email address is in Cc: fieldSamuel GROOT, Jun 8, 2016
  60. Junio C HamanoJun 8, 2016
  61. Samuel GROOTJun 8, 2016
  62. 3/6 send-email: shorten send-email's outputSamuel GROOT, Jun 8, 2016
  63. Junio C HamanoJun 8, 2016
  64. Samuel GROOTJun 8, 2016
  65. Junio C HamanoJun 8, 2016
  66. Samuel GROOTJun 8, 2016
  67. Matthieu MoyJun 9, 2016
  68. Samuel GROOTJun 13, 2016
  69. 4/6 send-email: create email parser subroutineSamuel GROOT, Jun 8, 2016
  70. Junio C HamanoJun 8, 2016
  71. Eric SunshineJun 8, 2016
  72. Junio C HamanoJun 8, 2016
  73. Samuel GROOTJun 8, 2016
  74. Junio C HamanoJun 8, 2016
  75. Samuel GROOTJun 8, 2016
  76. Samuel GROOTJun 8, 2016
  77. Eric SunshineJun 8, 2016
  78. Junio C HamanoJun 8, 2016
  79. Samuel GROOTJun 8, 2016
  80. Eric WongJun 9, 2016
  81. Samuel GROOTJun 13, 2016
  82. Eric WongJun 13, 2016
  83. Samuel GROOTJun 14, 2016
  84. Eric SunshineJun 9, 2016
  85. Samuel GROOTJun 13, 2016
  86. Samuel GROOTJun 8, 2016
  87. Eric WongJun 8, 2016
  88. 5/6 send-email: --in-reply-to=<file> populate header fieldsSamuel GROOT, Jun 8, 2016
  89. Junio C HamanoJun 8, 2016
  90. Samuel GROOTJun 14, 2016
  91. Matthieu MoyJun 9, 2016
  92. Samuel GROOTJun 14, 2016
  93. 6/6 send-email: add option --cite to quote the message bodySamuel GROOT, Jun 8, 2016
  94. Matthieu MoyJun 9, 2016
  95. Samuel GROOTJun 14, 2016
  96. Tom RusselloJun 15, 2016

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.