git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>,
	antoine.delaite@ensimag.grenoble-inp.fr,
	remi.galan-alfonso@ensimag.grenoble-inp.fr,
	remi.lespinet@ensimag.grenoble-inp.fr,
	guillaume.pages@ensimag.grenoble-inp.fr,
	louis--alexandre.stuber@ensimag.grenoble-inp.fr
Subject: Re: [PATCH 1/2] rebase -i: demonstrate incorrect behavior of post-rewrite hook with exec
Date: Thu, 21 May 2015 17:12:35 -0400	[thread overview]
Message-ID: <CAPig+cRFwruC8DwPhH_=Jb8YAZPB5J2e0F2NBob3zLPGoMLWgA@mail.gmail.com> (raw)
In-Reply-To: <1432231982-31314-2-git-send-email-Matthieu.Moy@imag.fr>

On Thu, May 21, 2015 at 2:13 PM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> 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.
> [...]
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
> diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
> index ea2e0d4..ecef820 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

Broken &&-chain.

> +       echo something >bar &&
> +       git add bar &&
> +       # Fail 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
> +       verify_hook_input
> +'
> +
>  test_done
> --
> 2.4.1.171.g060e6ae.dirty

  reply	other threads:[~2015-05-21 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 18:13 [PATCH 0/2] fix post-rewrite hook with 'git rebase -i --exec' Matthieu Moy
2015-05-21 18:13 ` [PATCH 1/2] rebase -i: demonstrate incorrect behavior of post-rewrite hook with exec Matthieu Moy
2015-05-21 21:12   ` Eric Sunshine [this message]
2015-05-22  6:35     ` Matthieu Moy
2015-05-21 18:13 ` [PATCH 2/2] rebase -i: fix post-rewrite hook with failed exec command Matthieu Moy

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='CAPig+cRFwruC8DwPhH_=Jb8YAZPB5J2e0F2NBob3zLPGoMLWgA@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=antoine.delaite@ensimag.grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=guillaume.pages@ensimag.grenoble-inp.fr \
    --cc=louis--alexandre.stuber@ensimag.grenoble-inp.fr \
    --cc=remi.galan-alfonso@ensimag.grenoble-inp.fr \
    --cc=remi.lespinet@ensimag.grenoble-inp.fr \
    /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;
as well as URLs for NNTP newsgroup(s).