git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Payre Nathan <second.payre@gmail.com>
Cc: git@vger.kernel.org, matthieu.moy@univ-lyon1.fr,
	timothee.albertin@etu.univ-lyon1.fr,
	daniel.bensoussan--bohm@etu.univ-lyon1.fr,
	Tom Russello <tom.russello@grenoble-inp.org>
Subject: Re: [PATCH 2/2] send-email: quote-email quotes the message body
Date: Wed, 01 Nov 2017 15:40:00 +0900	[thread overview]
Message-ID: <xmqqa806tscf.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171030223444.5052-3-nathan.payre@etu.univ-lyon1.fr> (Payre Nathan's message of "Mon, 30 Oct 2017 23:34:44 +0100")

Payre Nathan <second.payre@gmail.com> writes:

> From: Tom Russello <tom.russello@grenoble-inp.org>
>
> ---
>  Documentation/git-send-email.txt |  4 +-
>  git-send-email.perl              | 80 ++++++++++++++++++++++++++++++++++++++--
>  t/t9001-send-email.sh            | 19 +++++++++-
>  3 files changed, 97 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index 710b5ff32..329af66af 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -107,7 +107,9 @@ Only necessary if --compose is also set.  If --compose
>  is not set, this will be prompted for.
>  
>  --quote-email=<email_file>::
> -	Fill appropriately header fields for the reply to the given email.
> +	Fill appropriately header fields for the reply to the given email and quote
> +	the message body in the cover letter if `--compose` is set or otherwise
> +	after the triple-dash in the first patch given.

Hmmm.  I have a strong suspicion that people want an option to
trigger the feature from just 1/2 but not 2/2 some of the time.
Sure, removing the unwanted lines in the compose editor may be easy,
but it feels wasteful use of user's time to include the lines of
text from the original only to have them removed.

Also, if you are not offering these two as separate features, there
isn't much point splitting them into two patches.

> @@ -743,6 +768,9 @@ if ($compose) {
>  	my $tpl_sender = $sender || $repoauthor || $repocommitter || '';
>  	my $tpl_subject = $initial_subject || '';
>  	my $tpl_reply_to = $initial_reply_to || '';
> +	my $tpl_quote = $message_quoted &&
> +		"\nGIT: Please, trim down irrelevant sections in the quoted message\n".
> +		"GIT: to keep your email concise.\n" . $message_quoted || '';
>  
>  	print $c <<EOT1, Git::prefix_lines("GIT: ", __ <<EOT2), <<EOT3;
>  From $tpl_sender # This line is ignored.
> @@ -756,7 +784,7 @@ EOT2
>  From: $tpl_sender
>  Subject: $tpl_subject
>  In-Reply-To: $tpl_reply_to
> -
> +$tpl_quote
>  EOT3

OK, by emitting it into $compose_filename as part of the front
matter, you get the "do we have to do mime?" etc. for free, which
sort-of makes sense.

> @@ -821,9 +849,53 @@ EOT3
>  		$compose = -1;
>  	}
>  } elsif ($annotate) {
> -	do_edit(@files);
> +	if ($quote_email) {
> +		my $quote_email_filename = ($repo ?
> +			tempfile(".gitsendemail.msg.XXXXXX",
> +				DIR => $repo->repo_path()) :
> +			tempfile(".gitsendemail.msg.XXXXXX",
> +				DIR => "."))[1];
> +
> +		# Insertion in a temporary file to keep the original file clean
> +		# in case of cancellation/error.
> +		do_insert_quoted_message($quote_email_filename, $files[0]);
> +
> +		my $tmp = $files[0];
> +		$files[0] = $quote_email_filename;
> +
> +		do_edit(@files);
> +
> +		# Erase the original patch if the edition went well
> +		move($quote_email_filename, $tmp);
> +		$files[0] = $tmp;
> +	} else {
> +		do_edit(@files);
> +	}
>  }

  reply	other threads:[~2017-11-01  6:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 22:34 [PATCH 0/2] New send-email option --quote-email Payre Nathan
2017-10-30 22:34 ` [PATCH 1/2] quote-email populates the fields Payre Nathan
2017-11-01  2:44   ` Junio C Hamano
2017-11-09  8:49     ` Nathan PAYRE
     [not found]   ` <607ed87207454d1098484b0ffbc6916f@BPMBX2013-01.univ-lyon1.fr>
2017-11-01 11:04     ` Matthieu Moy
2017-11-01 18:12       ` Stefan Beller
2017-10-30 22:34 ` [PATCH 2/2] send-email: quote-email quotes the message body Payre Nathan
2017-11-01  6:40   ` Junio C Hamano [this message]
     [not found]   ` <0db6387ef95b4fafbd70068be9e4f7c5@BPMBX2013-01.univ-lyon1.fr>
2017-11-01 11:12     ` Matthieu Moy

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqa806tscf.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=daniel.bensoussan--bohm@etu.univ-lyon1.fr \
    --cc=git@vger.kernel.org \
    --cc=matthieu.moy@univ-lyon1.fr \
    --cc=second.payre@gmail.com \
    --cc=timothee.albertin@etu.univ-lyon1.fr \
    --cc=tom.russello@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).