From: Junio C Hamano <gitster@pobox.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: git@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH RFC] log-tree: let format-patch not indent notes
Date: Thu, 25 Sep 2014 10:24:53 -0700 [thread overview]
Message-ID: <xmqqeguzboka.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1411661409-24562-1-git-send-email-u.kleine-koenig@pengutronix.de> ("Uwe Kleine-König"'s message of "Thu, 25 Sep 2014 18:10:09 +0200")
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> Commit logs as shown by git-log are usually indented by four spaces so
> here it makes sense to do the same for commit notes.
>
> However when using format-patch to create a patch for submission via
> e-mail the commit log isn't indented and also the "Notes:" header isn't
> really useful. So consequently don't indent and skip the header in this
> case. This also removes the empty line between the end-of-commit marker
> and the start of the notes.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> This commit changes the output of format-patch (applied on this commit) from:
>
> ...
> case.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>
> Notes:
> This commit changes the output of format-patch (applied on this commit) from:
>
> to
>
> ...
> case.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> This commit changes the output of format-patch (applied on this commit) from:
>
> which I consider to be more useful.
I suspect that is fairly subjective, as the current one is in that
form because those who wrote this feature first, reviewed, applied
would have considered it more useful, isn't it?
Because I never send out a format-patch output without looking it
over in an editor, I know I can easily remove it if I find the
"Notes:" out of place in the output, but if the "Notes:" thing
weren't there in the first place I may scratch my head trying to
figure out where to update it if the information there were stale,
so for that reason I'd find it more useful to have Notes: to remind
me where that information comes from.
But that is just my personal preference and I am willing to be
persuaded either way with a better argument than "to me it looks
nicer".
As to indenting, because the material after three-dashes is meant to
be fed to "git apply" or "patch", I'd prefer to keep it to avoid
having to worry about a payload that may look like part of a patch.
This preference is a bit stronger than the presence/absence of
"Notes:".
Thanks.
> log-tree.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/log-tree.c b/log-tree.c
> index bcee7c596696..c1d73d8fecdf 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -585,7 +585,8 @@ void show_log(struct rev_info *opt)
> int raw;
> struct strbuf notebuf = STRBUF_INIT;
>
> - raw = (opt->commit_format == CMIT_FMT_USERFORMAT);
> + raw = (opt->commit_format == CMIT_FMT_USERFORMAT) ||
> + (opt->commit_format == CMIT_FMT_EMAIL);
> format_display_notes(commit->object.sha1, ¬ebuf,
> get_log_output_encoding(), raw);
> ctx.notes_message = notebuf.len
next prev parent reply other threads:[~2014-09-25 17:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-25 16:10 [PATCH RFC] log-tree: let format-patch not indent notes Uwe Kleine-König
2014-09-25 17:24 ` Junio C Hamano [this message]
2014-09-25 18:08 ` Uwe Kleine-König
2014-09-25 17:56 ` Jeff King
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=xmqqeguzboka.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=u.kleine-koenig@pengutronix.de \
/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.