git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 8, 2016, 19:43 UTC
Message-ID
<xmqqlh6v7zu0.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160208193509.GA30554@sigill.intra.peff.net>
Jeff King <peff@peff.net> 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).

Show 6 quoted lines
> I just double-checked its definition in test-lib-function.sh; am I
> missing some Windows-specific magic that kicks in?
>
>> 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?

Previous: Jeff KingNext: Jeff King
Message 7 of 13 in “t9100: fix breakage when SHELL_PATH is not /bin/sh”
  1. t9100: fix breakage when SHELL_PATH is not /bin/shMichael J Gruber, Feb 7, 2016
  2. Jeff KingFeb 8, 2016
  3. Michael J GruberFeb 8, 2016
  4. Jeff KingFeb 8, 2016
  5. Johannes SchindelinFeb 8, 2016
  6. Jeff KingFeb 8, 2016
  7. Junio C HamanoFeb 8, 2016
  8. Jeff KingFeb 8, 2016
  9. Johannes SchindelinFeb 9, 2016
  10. Junio C HamanoFeb 9, 2016
  11. Johannes SchindelinFeb 8, 2016
  12. Junio C HamanoFeb 8, 2016
  13. Johannes SchindelinFeb 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.