Re: [PATCH v2 4/4] t/Makefile: introduce TEST_SHELL_PATH
- From
Jeff King <peff@peff.net>
- Date
- Dec 21, 2017, 09:47 UTC
- Message-ID
- <20171221094749.GA23160@sigill.intra.peff.net>
- In-Reply-To
- <xmqqmv2kq66p.fsf@gitster.mtv.corp.google.com>
On Fri, Dec 15, 2017 at 08:58:22AM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes: > > > I think (4) and (5) are the only things that actually change the > > behavior in a meaningful way. But they're a bit more hacky and > > repetitive than I'd like. Especially given that I'm not really sure > > we're solving an interesting problem. I'm happy enough with the patch as > > shown, and I do not recall anybody complaining about the current > > behavior of these options. > > OK. Thanks for thinking it through.
I took one final look at this, wondering if it ought to follow the "write to BUILD-OPTIONS only if set" pattern that some other variables do. But I think that just ends up more confusing, because of the way we use the variable from both the Makefile and test-lib.sh. So it makes this work:
make make -C t TEST_SHELL_PATH=whatever
but not quite this:
make TEST_SHELL_PATH=one make -C t TEST_SHELL_PATH=two
because in the second case, we use "two" to invoke the test script, but a "--tee" re-exec would use "one". Which is pretty subtle.
I really wish there was a way for a shell script to find out which interpreter it was currently using, but I couldn't come up with a portable way to do so (on some systems, /proc/$$/exe works, but that's obviously not something we should count on).
So anyway. I think I'm OK with the series as-is.
-Peff