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

Re: Hardcoded #!/bin/sh in t5532 causes problems on Solaris

From
Jeff King <peff@peff.net>
Date
Apr 9, 2016, 22:37 UTC
Message-ID
<20160409223738.GA1738@sigill.intra.peff.net>
In-Reply-To
<57098259.1060608@jupiterrise.com>
On Sun, Apr 10, 2016 at 12:29:45AM +0200, Tom G. Christensen wrote:
Show 7 quoted lines
> On 09/04/16 23:04, Jeff King wrote:
> >I did some quick grepping around, and I suspect you may run
> >into the same thing in other places (e.g., t3404.40 looks
> >like a similar case).
> 
> There are only a few tests that fail and just t5532.3 seems affected by this
> issue.
Hmm. t3404.40 does this:
        echo "#!/bin/sh" > $PRE_COMMIT &&
	echo "test -z \"\$(git diff --cached --check)\"" >>$PRE_COMMIT &&
	chmod a+x $PRE_COMMIT &&

So I'm pretty sure that $PRE_COMMIT script should be barfing each time it is called on Solaris. I think the test itself doesn't notice because "/bin/sh barfed" and "the pre-commit check said no" look the same from git's perspective (both non-zero exits), and we test only cases where we expect the hook to fail.

I think that particular test could simplify its pre-commit hook to just "exit 1".

I didn't dig into any other cases, so that might be the only one. If you're not seeing problems, I'm not inclined to explore each one manually.

> I applied this to 2.8.1 and as expected the test now passes on Solaris.
Thanks.
-Peff
Previous: Tom G. ChristensenNext: Junio C Hamano
Message 4 of 14 in “Hardcoded #!/bin/sh in t5532 causes problems on Solaris”
  1. Tom G. ChristensenApr 9, 2016
  2. Jeff KingApr 9, 2016
  3. Tom G. ChristensenApr 9, 2016
  4. Jeff KingApr 9, 2016
  5. Junio C HamanoApr 10, 2016
  6. Junio C HamanoApr 10, 2016
  7. Eric SunshineApr 10, 2016
  8. Junio C HamanoApr 11, 2016
  9. Jeff KingApr 11, 2016
  10. Jeff KingApr 11, 2016
  11. Junio C HamanoApr 12, 2016
  12. Junio C HamanoApr 12, 2016
  13. Jeff KingApr 12, 2016
  14. Jeff KingApr 12, 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.