All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "W. Trevor King" <wking@tremily.us>
Cc: Git <git@vger.kernel.org>
Subject: Re: [PATCH] docs/git-mailinfo: Mention the manual separator (---)
Date: Tue, 30 Sep 2014 14:12:58 -0700	[thread overview]
Message-ID: <xmqqiok4rew5.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: 28b04f1c17f2cc2fe252948bc0b7bb10df24b489.1411571629.git.wking@tremily.us

"W. Trevor King" <wking@tremily.us> writes:

> And explain how it interacts with the scissors setting.
>
> Signed-off-by: W. Trevor King <wking@tremily.us>
> ---
> The three-dash limit comes from f0658cf2 (restrict the patch
> filtering, 2007-03-12), but I couldn't find any associated
> documentation.  Since the effect is so similar to the scissors line, I
> thought about adding the information to the --scissors entry.  The
> manual separator is really independent from the scissors though, so I
> settled on explaining both separators in the DESCRIPTION.
>
> This patch is against 'maint'.
>
>  Documentation/git-mailinfo.txt | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt
> index 164a3c6..6c6c527 100644
> --- a/Documentation/git-mailinfo.txt
> +++ b/Documentation/git-mailinfo.txt
> @@ -21,6 +21,29 @@ written out to the standard output to be used by 'git am'
>  to create a commit.  It is usually not necessary to use this
>  command directly.  See linkgit:git-am[1] instead.
>  
> +The commit message extracted from the e-mail depends on the scissors
> +setting (see '--[no-]scissors' in the OPTIONS section). ...

It encourages a wrong way to look at it to phrase it like this.

The scissors marker is not about commit log message alone, as you
can have in-body headers like From: and Subject: to override them
after the marker, and also in-body headers before the scissors are
ignored (it is not even "We read From: from the part before the
scissors but then let it be overriden with another From: after the
scissors" ).  The right way to look at it is this: "The scissors
line will cause everything before it discarded and Git pretends as
if the body of the message begins after it".

If we are extending the documentation on "---", it should also
mention the caveats, namely, it is encouraged to indent the extra
message by a SP or something to make sure that it is not mistaken as
part of the patch.  I suspect that this omission from this patch
stems from "content after the separator is discarded", which is not
the case.  Content after the separator is fed to "git apply" as a
patch.  "apply" may "discard" non-patch and the end result may be
that the garbage disappears, but that is not the primary reason why
it does not appear in the resulting log message.  If anything, "---"
separates between the log part from patch part.

The second example concentrates too heavily on log message which
makes it a not-very-good addition as-is.

> +Besides the
> +scissors option (which discards content before the scissors), you can
> +also use '---' as a separator (which discards content after the
> +separator).  For example, without scissors you can have a body like
> +this:
> +
> +------------
> +Your commit message.
> +---
> +Comments that aren't part of the commit message.
> +------------
> +
> +With scissors, you can have a body like this:
> +
> +------------
> +Comments that aren't part of the commit message.
> +--->8---
> +Your commit message.
> +---
> +More comments that aren't part of the commit message.
> +------------
> +
>  
>  OPTIONS
>  -------

  reply	other threads:[~2014-09-30 21:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 15:25 [PATCH] docs/git-mailinfo: Mention the manual separator (---) W. Trevor King
2014-09-30 21:12 ` Junio C Hamano [this message]
2014-09-30 21:48   ` W. Trevor King
2014-09-30 22:37     ` Junio C Hamano

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=xmqqiok4rew5.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=wking@tremily.us \
    /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.