All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org, sbeller@google.com,
	computersforpeace@gmail.com, Johannes.Schindelin@gmx.de
Subject: Re: [PATCH v2] sequencer: require trailing NL in footers
Date: Tue, 25 Apr 2017 17:07:41 -0700	[thread overview]
Message-ID: <20170426000741.GS28740@aiede.svl.corp.google.com> (raw)
In-Reply-To: <20170425235741.32546-1-jonathantanmy@google.com>

Jonathan Tan wrote:

> Reported-by: Brian Norris <computersforpeace@gmail.com>
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
[...]
>  sequencer.c              | 11 +++++++++++
>  t/t3511-cherry-pick-x.sh | 14 ++++++++++++++
>  2 files changed, 25 insertions(+)

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

This is still pretty subtle (using the added newline that is added after
a non-footer to turn the invalid footer into a valid one), but

 * it is clear from the code that it will work correctly
 * the new test ensures we'll continue to support this case
 * it is understandable after a little head scratching
 * I'm hoping the subtlety will go away once the code learns to deal
   with ordinary non-footer text that has a missing newline

[...]
> --- a/t/t3511-cherry-pick-x.sh
> +++ b/t/t3511-cherry-pick-x.sh
> @@ -208,6 +208,20 @@ test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists fo
>  	test_cmp expect actual
>  '
>  
> +test_expect_success 'cherry-pick -x handles commits with no NL at end of message' '
> +	pristine_detach initial &&
> +	sha1=$(printf "title\n\nSigned-off-by: a" | git commit-tree -p initial mesg-with-footer^{tree}) &&

nit: Should this use a more typical sign-off line with an email
address, to avoid a false-positive success in case git becomes more
strict about its signoffs in the future?

Something like

	printf "title\n\nSigned-off-by: S. I. Gner <signer@example.com>" >msg &&
	sha1=$(git commit-tree -p initial mesg-with-footer^{tree} <msg) &&
	...

Thanks,
Jonathan

  reply	other threads:[~2017-04-26  0:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 22:01 [GIT 2.12.2 REGRESSION] git cherry-pick -x Brian Norris
2017-04-21 22:10 ` Stefan Beller
2017-04-21 22:13   ` Jeff King
2017-04-25 19:06 ` [PATCH] sequencer: require trailing NL in footers Jonathan Tan
2017-04-25 21:04   ` Stefan Beller
2017-04-25 21:51     ` Jonathan Tan
2017-04-25 21:56       ` Stefan Beller
2017-04-25 22:05         ` Johannes Schindelin
2017-04-25 23:39           ` Jonathan Nieder
2017-04-25 22:30         ` Brian Norris
2017-04-26 20:31           ` Brian Norris
2017-04-25 21:56   ` Johannes Schindelin
2017-04-25 23:34   ` Jonathan Nieder
2017-04-25 23:57   ` [PATCH v2] " Jonathan Tan
2017-04-26  0:07     ` Jonathan Nieder [this message]
2017-04-26  2:08       ` Junio C Hamano
2017-04-26  9:09         ` Johannes Schindelin
2017-04-26 20:50   ` [PATCH v3] sequencer: add newline before adding footers Jonathan Tan

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=20170426000741.GS28740@aiede.svl.corp.google.com \
    --to=jrnieder@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=computersforpeace@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    --cc=sbeller@google.com \
    /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.