From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Chris Johnsen <chris_johnsen@pobox.com>,
Miklos Vajna <vmiklos@frugalware.org>
Subject: Re: [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit
Date: Sun, 8 Mar 2009 10:42:40 -0400 [thread overview]
Message-ID: <20090308144240.GA30794@coredump.intra.peff.net> (raw)
In-Reply-To: <1236418251-16947-1-git-send-email-chris_johnsen@pobox.com>
On Sat, Mar 07, 2009 at 03:30:51AM -0600, Chris Johnsen wrote:
> +test_expect_code 1 'cherry-pick an empty commit' '
> +
> + git checkout master &&
> + git cherry-pick empty-branch
> +
> +'
Hmm. This test fails for me on FreeBSD. However, it seems to be related
to a shell portability issue with the test suite. The extra newline
inside the shell snippet seems to lose the last status. The following
works fine for me with bash or dash:
-- >8 --
#!/bin/sh
test_description='test that shell handles whitespace in eval'
. ./test-lib.sh
test_expect_code 1 'no newline' 'false'
test_expect_code 1 'one newline' 'false
'
test_expect_code 1 'extra newline' 'false
'
test_done
-- 8< --
but on a FreeBSD 6.1 box generates:
* ok 1: no newline
* ok 2: one newline
* FAIL 3: 1
extra newline false
With this minimal example, you can see that the problem is not some
subtle bug in the test suite:
-- >8 --
#!/bin/sh
eval 'false'
echo status is $?
eval 'false
'
echo status is $?
eval 'false
'
echo status is $?
-- 8< --
generates:
status is 1
status is 1
status is 0
which means that any tests of the form
test_expect_success description '
contents
'
are not actually having their exit code checked properly, and are just
claiming success regardless of what happened. So this definitely needs
to be addressed, I think. I'm not sure of the best course of action,
though. Our options include:
1. Declare appended newline a forbidden style, fix all existing cases
in the test suite, and be on the lookout for new ones.
The biggest problem with this option is that we have no automated
way of policing. Such tests will just silently pass on the broken
platform.
2. Have test_run_ canonicalize the snippet by removing trailing
newlines.
3. Declare FreeBSD's /bin/sh unfit for git consumption, and require
bash for the test suite.
I think (2) is the most reasonable option of those choices.
We could also try to convince FreeBSD that it's a bug, but that doesn't
change the fact that the tests are broken on every existing version.
-Peff
next prev parent reply other threads:[~2009-03-08 14:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-07 9:30 [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit Chris Johnsen
2009-03-07 11:15 ` Johannes Schindelin
2009-03-07 22:57 ` Chris Johnsen
2009-03-08 1:19 ` Johannes Schindelin
2009-03-08 4:14 ` Junio C Hamano
2009-03-08 21:09 ` Chris Johnsen
2009-03-08 21:53 ` Junio C Hamano
2009-03-08 14:42 ` Jeff King [this message]
2009-03-08 15:09 ` Jeff King
2009-03-08 19:45 ` Junio C Hamano
2009-03-10 18:17 ` Jeff King
2009-03-10 18:25 ` Tomas Carnecky
2009-03-10 19:33 ` Tomas Carnecky
2009-03-10 23:57 ` Chris Johnsen
2009-03-11 0:30 ` Jeff King
2009-03-11 11:08 ` Mike Ralphson
2009-03-11 17:02 ` Mike Ralphson
2009-03-22 9:41 ` Jeff King
2009-03-22 21:58 ` Junio C Hamano
2009-03-22 22:38 ` Jeff King
2009-03-09 17:36 ` Brandon Casey
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=20090308144240.GA30794@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=chris_johnsen@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=vmiklos@frugalware.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;
as well as URLs for NNTP newsgroup(s).