All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Russello <tom.russello@grenoble-inp.org>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: git@vger.kernel.org, jordan.de-gea@grenoble-inp.org,
	erwan.mathoniere@grenoble-inp.org, samuel.groot@grenoble-inp.org,
	e@80x24.org, aaron@schrab.com, gitster@pobox.com
Subject: Re: [RFC-PATCH v2 2/2] send-email: quote-email quotes the message body
Date: Sun, 29 May 2016 13:41:14 +0200	[thread overview]
Message-ID: <6f76c691-c822-a9bc-4568-819e4ff31491@grenoble-inp.org> (raw)
In-Reply-To: <vpqlh2ujkg8.fsf@anie.imag.fr>

On 05/28/16 17:01, Matthieu Moy wrote:
>> Currently, `send-email` without `--compose` implies `--annotate`.
>
> I don't get it. Did you mean s/without/with/? Even if so, this is not
> exactly true: "git send-email --compose -1" will open the editor only
> for the cover-letter, while adding --annotate will also open it for the
> patch.

We meant that the default behavior of `--quote-email` (i.e. without
--compose enabled) will open the editor with the given patches in
argument and will quote the message body in the first one.

> (Note: we discussed this off-list already, but I'll try to summarize my
> thoughts here)
>
> I don't have strong opinion on this, but I think there's a difference
> between launching the editor directly on the input patch files
> (resulting in _user_'s edit being done directly on them) and having the
> script modify it in-place (resulting in automatic changes done directly
> on the user's files).
>
> I usually use "git send-email" directly without using "git
> format-patch", so I'm not the best juge. But I can imagine a flow like
>
> 1) run "git send-email *.patch"
>
> 2) start editting
>
> 3) notice there's something wrong, give up for now (answer 'q' when git
>    send-email prompts for confirmation, or kill it via Control-C in a
>    terminal)
>
> 4) run "git send-email *.patch" again
>
> 5) be happy that changes done at 2) are still there.
>
> With --quote-email, it's different. The scenario above would result in
>
> 5') WTF, why is the email quoted twice?

Actually the Control-C during the edition will cancel all the
annotations written (including the cited email).

> Unfortunately, I don't really have a solution for this. My first thought
> was that we should copy the files to a temporary location before
> starting the editor (that what I'm used to when using "git send-email"
> without "git format-patch"), but that would prevent 5) above.

It's already what we did: the first original patch is copied in a
temporary file. However, if the edition went well (i.e. the editor
closed by the user), the temporary file will erase the original one.

>> @@ -109,7 +109,10 @@ is not set, this will be prompted for.
>>  --quote-email=<email_file>::
>>  	Reply to the given email and automatically populate the "To:",
"Cc:" and
>>  	"In-Reply-To:" fields. If `--compose` is set, this will also fill the
>> -	subject field with "Re: [<email_file>'s subject]".
>> +	subject field with "Re: [<email_file>'s subject]" and quote the
message body
>> +	of <email_file>.
>
> I'd add "in the introductory message".

Agreed.

>> +	while (<$fh>) {
>> +		# Only for files containing crlf line endings
>> +		s/\r//g;
>
> The comment doesn't really say what it does.
>
> What about "turn crlf line endings into lf-only"?

Yes, I completely agree this suggestion.

> When writing comment, always try to ask the question "why?" more than
> "what?". This part is possibly controversial, think about a contributor
> finding this piece of code later without having followed the current
> conversation. He'd probably expect an explanation about why you need a
> temp file here and not elsewhere.

Thank you for the advice, I'll keep it in mind.

>> +	open my $c, "<", $original_file
>> +	or die "Failed to open $original_file : " . $!;
>> +
>> +	open my $c2, ">", $tmp_file
>> +		or die "Failed to open $tmp_file : " . $!;
>
> No space before :.

Sorry, I copied the previous error messages.

> When the spec says "if --compose ... then ...", "after the triple-dash",
> and "in the first patch", one would expect at least one test with
> --compose and one without, something to check that the insertion was
> done below the triple-dash, and one test with two patches, checking that
> the second patch is not altered by --quote-email.

Yes, indeed. I'll add these tests in the next version.

Thank you for the review.

  reply	other threads:[~2016-05-29 11:41 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 19:30 [RFC-PATCH 0/2] send-email: new --quote-mail option Tom Russello
2016-05-23 19:30 ` [RFC-PATCH 1/2] send-email: new option to quote an email and reply to Tom Russello
2016-05-23 19:55   ` Eric Wong
2016-05-23 20:07     ` Matthieu Moy
2016-05-23 22:10       ` Samuel GROOT
2016-05-24 12:43     ` Samuel GROOT
2016-05-24 12:49       ` Matthieu Moy
2016-05-24 22:30         ` Aaron Schrab
2016-05-25  0:04           ` Tom Russello
2016-05-24 21:23       ` Eric Wong
2016-05-23 20:00   ` Matthieu Moy
2016-05-24 23:31     ` Samuel GROOT
2016-05-25  6:29       ` Matthieu Moy
2016-05-25 15:40         ` Junio C Hamano
2016-05-25 16:56           ` Matthieu Moy
2016-05-25 18:15             ` Junio C Hamano
2016-05-25 18:31               ` Matthieu Moy
2016-05-26  0:08                 ` Samuel GROOT
2016-05-27  9:06                   ` Matthieu Moy
2016-05-23 19:30 ` [RFC-PATCH 2/2] t9001: adding --quote-mail option test Tom Russello
2016-05-23 20:05   ` Matthieu Moy
2016-05-23 19:38 ` [RFC-PATCH 0/2] send-email: new --quote-mail option Matthieu Moy
2016-05-23 19:56   ` Samuel GROOT
2016-05-27 17:11 ` [RFC-PATCH v2 0/2] send-email: new --quote-email option Tom Russello
2016-05-27 17:11   ` [RFC-PATCH v2 1/2] send-email: quote-email populates the fields Tom Russello
2016-05-28 14:35     ` Matthieu Moy
2016-05-29 23:38       ` Tom Russello
2016-05-27 17:11   ` [RFC-PATCH v2 2/2] send-email: quote-email quotes the message body Tom Russello
2016-05-28 15:01     ` Matthieu Moy
2016-05-29 11:41       ` Tom Russello [this message]
2016-06-07 14:01   ` [PATCH v3 0/6] send-email: cleaner tests and quote email Tom Russello
2016-06-07 14:01     ` [PATCH v3 1/6] t9001: non order-sensitive file comparison Tom Russello
2016-06-08  1:07       ` Junio C Hamano
2016-06-08  8:23         ` Samuel GROOT
2016-06-08 16:09           ` Junio C Hamano
2016-06-08 16:46             ` Samuel GROOT
2016-06-09  6:01               ` Matthieu Moy
2016-06-13 22:21                 ` Samuel GROOT
2016-06-09  5:51         ` Matthieu Moy
2016-06-09  8:15           ` Tom Russello
2016-06-07 14:01     ` [PATCH v3 2/6] t9001: check email address is in Cc: field Tom Russello
2016-06-09  5:55       ` Matthieu Moy
2016-06-13 22:23         ` Samuel GROOT
2016-06-07 14:01     ` [PATCH v3 3/6] t9001: shorten send-email's output Tom Russello
2016-06-08  8:36       ` Eric Wong
2016-06-08  9:30         ` Samuel GROOT
2016-06-09  6:03       ` Matthieu Moy
2016-06-07 14:01     ` [PATCH v3 4/6] send-email: create email parser subroutine Tom Russello
2016-06-07 14:05       ` [PATCH v3 5/6] send-email: --in-reply-to=<file> populates the fields Tom Russello
2016-06-07 14:05         ` [PATCH v3 6/6] send-email: add option --cite to quote the message body Tom Russello
2016-06-08 13:01     ` (unknown), Samuel GROOT
2016-06-08 13:01       ` [PATCH v4 1/6] t9001: non order-sensitive file comparison Samuel GROOT
2016-06-08 14:22         ` Remi Galan Alfonso
2016-06-08 14:29           ` Samuel GROOT
2016-06-08 16:56         ` Junio C Hamano
2016-06-08 19:21           ` Samuel GROOT
2016-06-08 17:17         ` Junio C Hamano
2016-06-08 19:19           ` Samuel GROOT
2016-06-08 13:01       ` [PATCH v4 2/6] t9001: check email address is in Cc: field Samuel GROOT
2016-06-08 17:34         ` Junio C Hamano
2016-06-08 19:23           ` Samuel GROOT
2016-06-08 13:01       ` [PATCH v4 3/6] send-email: shorten send-email's output Samuel GROOT
2016-06-08 17:37         ` Junio C Hamano
2016-06-08 19:18           ` Samuel GROOT
2016-06-08 19:33             ` Junio C Hamano
2016-06-08 19:40               ` Samuel GROOT
2016-06-09  6:17         ` Matthieu Moy
2016-06-13 22:19           ` Samuel GROOT
2016-06-08 13:01       ` [PATCH v4 4/6] send-email: create email parser subroutine Samuel GROOT
2016-06-08 17:58         ` Junio C Hamano
2016-06-08 18:12           ` Eric Sunshine
2016-06-08 18:32             ` Junio C Hamano
2016-06-08 19:26               ` Samuel GROOT
2016-06-08 19:31                 ` Junio C Hamano
2016-06-08 19:42                   ` Samuel GROOT
2016-06-08 19:30             ` Samuel GROOT
2016-06-08 20:13               ` Eric Sunshine
2016-06-08 20:17                 ` Junio C Hamano
2016-06-08 23:54                   ` Samuel GROOT
2016-06-09  0:21                     ` Eric Wong
2016-06-13 22:18                       ` Samuel GROOT
2016-06-13 22:47                         ` Eric Wong
2016-06-14 22:18                           ` Samuel GROOT
2016-06-09  6:51                     ` Eric Sunshine
2016-06-13 22:15                       ` Samuel GROOT
2016-06-08 19:36           ` Samuel GROOT
2016-06-08 20:38         ` Eric Wong
2016-06-08 13:07       ` [PATCH v4 5/6] send-email: --in-reply-to=<file> populate header fields Samuel GROOT
2016-06-08 18:23         ` Junio C Hamano
2016-06-14 22:26           ` Samuel GROOT
2016-06-09  9:45         ` Matthieu Moy
2016-06-14 22:35           ` Samuel GROOT
2016-06-08 13:08       ` [PATCH v4 6/6] send-email: add option --cite to quote the message body Samuel GROOT
2016-06-09 11:49         ` Matthieu Moy
2016-06-14 22:53           ` Samuel GROOT
2016-06-15 22:21           ` Tom Russello

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=6f76c691-c822-a9bc-4568-819e4ff31491@grenoble-inp.org \
    --to=tom.russello@grenoble-inp.org \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=aaron@schrab.com \
    --cc=e@80x24.org \
    --cc=erwan.mathoniere@grenoble-inp.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jordan.de-gea@grenoble-inp.org \
    --cc=samuel.groot@grenoble-inp.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.