Thread (3 messages) 3 messages, 3 authors, 2016-06-15

Re: [PATCH] t9100: fix breakage when SHELL_PATH is not /bin/sh

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:08:09

Jeff King [off-list ref] writes:
I'm confused why it matters. write_script() unconditionally calls "chmod
+x", doesn't it?
Yeah, that was exactly my thought, too.  Sorry for not noticing that
this depended the "interpreter" exactly be /bin/sh, though (it is
not even executed).
I just double-checked its definition in test-lib-function.sh; am I
missing some Windows-specific magic that kicks in?
quoted
So why not just prefix it with `SHELL_PATH=/bin/sh`?
But then what is write_script buying us?
The correct way to write a script for a specific interpreter is to
give a second parameter to write_script, i.e.

		write_script exec.sh /bin/sh </dev/null &&

and the answer to the question is "it will save us one line".

The version in 'master' that does

                echo "#!/bin/sh" >exec.sh &&
                chmod +x exec.sh &&

should be equivalent, so dropping that hunk from the patch is the
right resolution perhaps?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help