From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] test-lib: some shells do not let $? propagate into an eval
Date: Thu, 6 May 2010 04:57:20 -0400 [thread overview]
Message-ID: <20100506085720.GA31873@coredump.intra.peff.net> (raw)
In-Reply-To: <20100506084045.GA25917@progeny.tock>
On Thu, May 06, 2010 at 03:41:10AM -0500, Jonathan Nieder wrote:
> I tried the cleanup_ret idea; test_run_ ended up looking like this:
>
> test_cleanup=:
> eval >&3 2>&4 "$1"
> eval_ret=$?
> eval >&3 2>&4 ":; $test_cleanup"
> cleanup_ret=?
> (exit "$test_ret") && (exit "$cleanup_ret")
> eval_ret=$?
Maybe it is just me, but those last two lines would be much more
readable as:
if test "$eval_ret" = 0; then
eval_ret=$cleanup_ret
fi
assuming your "$test_ret" was supposed to be $eval_ret.
> That breaks the principle of keeping the ugliness in test_when_finished.
> So here’s the minimal fix.
I don't know that we have necessarily have that principle. The most
important thing is that ugliness not escape to the test scripts
themselves, where we have to write many thousands of (hopefully
readable) lines.
But...
> -- 8< --
> Subject: test-lib: some shells do not let $? propagate into an eval
This fix looks fine to me, and I tested it on FreeBSD 8.0. So:
Acked-by: Jeff King <peff@peff.net>
> I was also surprised to see this migrate to maint so quickly, but I
> was happy to see it broke early and loudly.
I think Junio is much more carefree with changes that only touch test
infrastructure, as they cannot possibly be breaking git itself for
anybody.
> Because there is some unhappiness with the feature[1], it might make
To clarify my position, I am not that negative on the feature. I just
think it is a bit of a fool's errand, and I don't want to personally
spend any time on making it happen. If you think it is worth proceeding
and you can do so without breaking anything[1], I won't object.
[1] Yes, I am teasing you. But probably the complex part is now done,
and you and others can use test_when_finished() at will now, and we can
see if it actually makes anybody's life better.
-Peff
next prev parent reply other threads:[~2010-05-06 8:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 5:39 1.7.2 cycle will open soon Junio C Hamano
2010-05-06 5:52 ` Jeff King
2010-05-06 6:44 ` Jonathan Nieder
2010-05-06 6:54 ` Jeff King
2010-05-06 8:41 ` [PATCH] test-lib: some shells do not let $? propagate into an eval Jonathan Nieder
2010-05-06 8:57 ` Jeff King [this message]
2010-05-06 20:20 ` Junio C Hamano
2010-05-06 7:06 ` 1.7.2 cycle will open soon Johannes Sixt
2010-05-06 7:49 ` Jeff King
2010-05-06 8:01 ` Jonathan Nieder
2010-05-06 6:57 ` Johannes Sixt
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=20100506085720.GA31873@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.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 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).