Re: [PATCH] merge: Honor prepare-commit-msg return code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> prepare-commit-msg hook is run when committing to prepare the log
>> message. If the exit-status is non-zero, the commit should be aborted.
>
> I was scratching my head why you CC'ed Jay, until I dug up 65969d4
> (merge: honor prepare-commit-msg hook, 2011-02-14).

I did as suggested in "SubmittingPatches" :)

>> +test_expect_success 'with failing hook (merge)' '
>> +
>> +     git checkout -B other HEAD@{1} &&
>> +     echo "more" >> file &&
>> +     git add file &&
>> +     chmod -x $HOOK &&
>
> I have a feeling that this will break folks without POSIXPERM
> prerequisite.

It felt wrong when I did it, but kept it consistent within the file.
It indeed looks older than other test files I've seen so far but I
don't feel like I know the test general-style-and-policy enough to fix
it myself either.

> diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
> index bc497bc..3573751 100755
> --- a/t/t7505-prepare-commit-msg-hook.sh
> +++ b/t/t7505-prepare-commit-msg-hook.sh
> @@ -172,11 +172,12 @@ test_expect_success 'with failing hook (merge)' '
>         git checkout -B other HEAD@{1} &&
>         echo "more" >> file &&
>         git add file &&
> -       chmod -x $HOOK &&
> +       rm -f "$HOOK" &&
>         git commit -m other &&
> -       chmod +x $HOOK &&
> +       write_script "$HOOK" <<-EOF
> +       exit 1
> +       EOF
>         git checkout - &&
> -       head=`git rev-parse HEAD` &&
>         test_must_fail git merge other
>
>  '

What about moving the hook file then ? Not very important to me, just
a suggestion as it would keep the shebang.

Cheers,
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]