Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] rebase -i: demonstrate incorrect behavior of post-rewrite
Date: Fri, 22 May 2015 07:22:22 -0700	[thread overview]
Message-ID: <xmqq1ti8heu9.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <0000014d7bc3f7a5-332dd95f-907f-4f46-a5d6-6b9e5dc70b0a-000000@eu-west-1.amazonses.com> (Matthieu Moy's message of "Fri, 22 May 2015 13:15:50 +0000")

Matthieu Moy <Matthieu.Moy@imag.fr> writes:

> The 'exec' command is sending the current commit to stopped-sha, which is
> supposed to contain the original commit (before rebase). As a result, if
> an 'exec' command fails, the next 'git rebase --continue' will send the
> current commit as <old-sha1> to the post-rewrite hook.
>
> The test currently fails with :
>
> --- expected.data       2015-05-21 17:55:29.000000000 +0000
> +++ [...]post-rewrite.data      2015-05-21 17:55:29.000000000 +0000
> @@ -1,2 +1,3 @@
>  2362ae8e1b1b865e6161e6f0e165ffb974abf018 488028e9fac0b598b70cbeb594258a917e3f6fab
> +488028e9fac0b598b70cbeb594258a917e3f6fab 488028e9fac0b598b70cbeb594258a917e3f6fab
>  babc8a4c7470895886fc129f1a015c486d05a351 8edffcc4e69a4e696a1d4bab047df450caf99507

Indent displayed material like the above a bit, please.
And please sign-off your patches.

> ---
>  t/t5407-post-rewrite-hook.sh | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
> index ea2e0d4..53a4062 100755
> --- a/t/t5407-post-rewrite-hook.sh
> +++ b/t/t5407-post-rewrite-hook.sh
> @@ -212,4 +212,21 @@ EOF
>  	verify_hook_input
>  '
>  
> +test_expect_failure 'git rebase -i (exec)' '
> +	git reset --hard D &&
> +	clear_hook_input &&
> +	FAKE_LINES="edit 1 exec_false 2" git rebase -i B &&
> +	echo something >bar &&
> +	git add bar &&
> +	# Fails because of exec false
> +	test_must_fail git rebase --continue &&
> +	git rebase --continue &&
> +	echo rebase >expected.args &&
> +	cat >expected.data <<EOF &&
> +$(git rev-parse C) $(git rev-parse HEAD^)
> +$(git rev-parse D) $(git rev-parse HEAD)
> +EOF

By using a dash to start the here-document like this:

	cat >expect <<-\EOF &&
	$(git rev-parse C) $(git rev-parse HEAD^)
        ...
        EOF

you can tab-indent the contents and the end marker at the same level
to make it easier to read.

> +	verify_hook_input
> +'
> +
>  test_done
>
>
> ---
> https://github.com/git/git/pull/138

  reply	other threads:[~2015-05-22 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 13:15 [PATCH 2/2] rebase -i: fix post-rewrite hook with failed exec command Matthieu Moy
2015-05-22 13:15 ` [PATCH 1/2] rebase -i: demonstrate incorrect behavior of post-rewrite Matthieu Moy
2015-05-22 14:22   ` Junio C Hamano [this message]
2015-05-22 14:52     ` Matthieu Moy
2015-05-22 15:59       ` Junio C Hamano
2015-06-01 22:17         ` Roberto Tyley
2015-05-22 15:44     ` 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=xmqq1ti8heu9.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox