git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@univ-lyon1.fr>
To: Junio C Hamano <gitster@pobox.com>
Cc: Payre Nathan <second.payre@gmail.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>,
	ALBERTIN TIMOTHEE p1514771  <timothee.albertin@etu.univ-lyon1.fr>,
	BENSOUSSAN--BOHM DANIEL p1507430 
	<daniel.bensoussan--bohm@etu.univ-lyon1.fr>,
	Tom Russello <tom.russello@grenoble-inp.org>
Subject: Re: [PATCH 1/2] quote-email populates the fields
Date: Wed, 01 Nov 2017 12:04:01 +0100	[thread overview]
Message-ID: <q7h97evaxntq.fsf@orange.lip.ens-lyon.fr> (raw)
In-Reply-To: <607ed87207454d1098484b0ffbc6916f@BPMBX2013-01.univ-lyon1.fr> (Junio C. Hamano's message of "Wed, 1 Nov 2017 02:44:56 +0000")

Junio C Hamano <gitster@pobox.com> writes:

> Payre Nathan <second.payre@gmail.com> writes:
>
>> From: Tom Russello <tom.russello@grenoble-inp.org>
>>
>> ---
>
> Missing something here???

To clarify for Nathan, Thimothee and Danial: the cover-letter is an
introduction send before the patch series. It can be needed to explain
the overall approach followed by the series. But in general, it does not
end up in the Git history, i.e. after the review is finished, the
cover-letter is forgotten.

OTOH, the commit messages for each patch is what ends up in the Git
history. This is what people will find later when running e.g. "git
blame", "git bisect" or so. Clearly the future user examining history
expects more than "quote-email populates the fields" (which was a good
reminder during development, but is actually a terrible subject line for
a final version).

A quick advice: if in doubt, prefer writing explanations in commit
message rather than the cover letter. If still in doubt, write the
explanations twice: once quickly in the cover letter and once more
detailed in the commit message.

>  * Do not call this option "quote" anything; you are not quoting,
>    just using some info from the given file.  
>
>    I wonder if we can simply reuse "--in-reply-to" option for this
>    purpose.  If it is a message id and not a file on the filesystem,
>    we behave just as before.  Otherwise we try to open it as a file
>    and grab the "Message-ID:" header from it and use it.

There's a possible ambiguity since user may in theory want to run
"--in-reply-to=msgid" with a file named msgid and still want the old
behavior. But: a real message-id is typically something rather cryptic
and it is safe to assume that users won't have a file named exactly like
an actual message id containing something which isn't the message in
question.

The main drawback I see in re-using "--in-reply-to" is that typos are
hard to miss. For example, running

  git send-email --in-reply-to=msgi

when the user actually wanted msgid would trigger a different behavior
instead of raising an error (no such file or directory). I think it's
acceptable: in the current form of send-email, we're already not
user-friendly to users when they write a typo in the --in-reply-to
argument (and we can't really detect typos anyway).

>> +if ($quote_email) {
>> +	my $error = validate_patch($quote_email);
>> +	die "fatal: $quote_email: $error\nwarning: no patches were sent\n"
>> +		if $error;
>
> validate_patch() calls sendemail-validate hook that is expecting to
> be fed a patch email you are going to send out that might have
> errors so that it can catch it and save you from embarrassment.  The
> file you are feeding it is *NOT* what you are going to send out, but
> is what you are responding to with your patch.  Even if it had an
> embarassing error as a patch, that is not something you care about
> (and it is something you received, so catching this late won't save
> the sender from embarrassment anyway).

I think the intention was to detect cases when $quote_email is not a
patch at all (and give a proper error message instead of trying to
continue with probably absurd behavior).

But I agree that there's no point in being too strict here, and if that
was the intension then it should be documented with a comment.

-- 
Matthieu Moy
https://matthieu-moy.fr/

  parent reply	other threads:[~2017-11-01 11:04 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 [this message]
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
     [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=q7h97evaxntq.fsf@orange.lip.ens-lyon.fr \
    --to=matthieu.moy@univ-lyon1.fr \
    --cc=daniel.bensoussan--bohm@etu.univ-lyon1.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).