All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Fix 'git am' in-body header continuations
Date: Mon, 3 Apr 2017 11:00:09 -0700	[thread overview]
Message-ID: <f5763dab-b829-f216-a377-8a71fc4f0c1e@google.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1704021746180.22832@i7.lan>

This looks good to me.

On 04/02/2017 05:49 PM, Linus Torvalds wrote:
>
> From: Linus Torvalds <torvalds@linux-foundation.org>
> Date: Sat, 1 Apr 2017 12:14:39 -0700
> Subject: [PATCH] Fix 'git am' in-body header continuations
>
> An empty line should stop any pending in-body headers, and start the
> actual body parsing.
>
> This also modifies the original test for the in-body headers to actually
> have a real commit body that starts with spaces, and changes the test to
> check that the long line matches _exactly_, and doesn't get extra data
> from the body.
>
> Fixes:6b4b013f1884 ("mailinfo: handle in-body header continuations")
> Cc: Jonathan Tan <jonathantanmy@google.com>
> Cc: Jeff King <peff@peff.net>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> ---
> diff --git a/t/t4150-am.sh b/t/t4150-am.sh
> index 89a5bacac..44807e218 100755
> --- a/t/t4150-am.sh
> +++ b/t/t4150-am.sh
> @@ -983,7 +983,9 @@ test_expect_success 'am works with multi-line in-body headers' '
>  	rm -fr .git/rebase-apply &&
>  	git checkout -f first &&
>  	echo one >> file &&
> -	git commit -am "$LONG" --author="$LONG <long@example.com>" &&
> +	git commit -am "$LONG
> +
> +    Body test" --author="$LONG <long@example.com>" &&

Instead of "Body test", I would write something more descriptive like 
"Not a continuation line because of blank line above", but I'm fine with 
either.

>  	git format-patch --stdout -1 >patch &&
>  	# bump from, date, and subject down to in-body header
>  	perl -lpe "
> @@ -997,7 +999,7 @@ test_expect_success 'am works with multi-line in-body headers' '
>  	git am msg &&
>  	# Ensure that the author and full message are present
>  	git cat-file commit HEAD | grep "^author.*long@example.com" &&
> -	git cat-file commit HEAD | grep "^$LONG"
> +	git cat-file commit HEAD | grep "^$LONG$"
>  '
>
>  test_done
>

  reply	other threads:[~2017-04-03 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03  0:49 [PATCH] Fix 'git am' in-body header continuations Linus Torvalds
2017-04-03 18:00 ` Jonathan Tan [this message]
2017-04-04  6:48   ` 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=f5763dab-b829-f216-a377-8a71fc4f0c1e@google.com \
    --to=jonathantanmy@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.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.
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.