From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Tom G. Christensen" <tgc@jupiterrise.com>,
Elia Pinto <gitter.spiros@gmail.com>,
git@vger.kernel.org
Subject: Re: Hardcoded #!/bin/sh in t5532 causes problems on Solaris
Date: Tue, 12 Apr 2016 09:58:20 -0700 [thread overview]
Message-ID: <xmqqvb3mrcgj.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160411173224.GE4011@sigill.intra.peff.net> (Jeff King's message of "Mon, 11 Apr 2016 13:32:25 -0400")
Jeff King <peff@peff.net> writes:
> On Sat, Apr 09, 2016 at 05:37:43PM -0700, Junio C Hamano wrote:
>
>> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
>> index b79f442..d96d0e4 100755
>> --- a/t/t3404-rebase-interactive.sh
>> +++ b/t/t3404-rebase-interactive.sh
>> @@ -555,10 +555,9 @@ test_expect_success 'rebase a detached HEAD' '
>> test_expect_success 'rebase a commit violating pre-commit' '
>>
>> mkdir -p .git/hooks &&
>> - PRE_COMMIT=.git/hooks/pre-commit &&
>> - echo "#!/bin/sh" > $PRE_COMMIT &&
>> - echo "test -z \"\$(git diff --cached --check)\"" >> $PRE_COMMIT &&
>> - chmod a+x $PRE_COMMIT &&
>> + write_script .git/hooks/pre-commit <<-\EOF &&
>> + test -z "$(git diff --cached --check)"
>> + EOF
>
> Looks good and is the minimal change. I kind of wonder if the example
> would be more clear, though, as just:
>
> write_script .git/hooks/pre-commit <<-\EOF &&
> exit 1
> EOF
> echo whatever >file1 &&
> ...
>
> I don't think we ever actually need the pre-commit check to pass, as we
> simply override it with --no-verify. But I dunno. Maybe people find it
> easier to read with a pseudo-realistic example (it took me a minute to
> realize the trailing whitespace in the content was important).
I was mostly worried about closing the door for future enhancement
where there are multiple commits to be replayed, some of which fail
and others pass the test. Unconditional "exit 1" would have to be
reverted when it happens.
> It could also stand to clean up its hook with test_when_finished. The
> next test resorts to "rm -rf" on the hooks directory at the beginning.
> Yuck.
Yeah, that may be an accident waiting to happen.
next prev parent reply other threads:[~2016-04-12 16:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-09 20:27 Hardcoded #!/bin/sh in t5532 causes problems on Solaris Tom G. Christensen
2016-04-09 21:04 ` Jeff King
2016-04-09 22:29 ` Tom G. Christensen
2016-04-09 22:37 ` Jeff King
2016-04-10 0:37 ` Junio C Hamano
2016-04-10 19:01 ` Junio C Hamano
2016-04-10 21:51 ` Eric Sunshine
2016-04-11 16:42 ` Junio C Hamano
2016-04-11 17:27 ` Jeff King
2016-04-11 17:32 ` Jeff King
2016-04-12 16:58 ` Junio C Hamano [this message]
2016-04-12 17:12 ` Junio C Hamano
2016-04-12 17:23 ` Jeff King
2016-04-12 17:22 ` 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=xmqqvb3mrcgj.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitter.spiros@gmail.com \
--cc=peff@peff.net \
--cc=tgc@jupiterrise.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.