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

Re: [PATCH v2 3/4] git-p4: Fix t9815 git-p4-submit-fail test case on OS X

From
PWPete Wyckoff <pw@padd.com>
Date
Oct 4, 2015, 20:18 UTC
Message-ID
<20151004201823.GA8366@padd.com>
In-Reply-To
<90C13A5C-AB19-4E5C-A317-15B3D182444D@gmail.com>
larsxschneider@gmail.com wrote on Sun, 04 Oct 2015 11:44 -0700:
Show 22 quoted lines
> 
> On 04 Oct 2015, at 11:23, Junio C Hamano <gitster@pobox.com> wrote:
> 
> > larsxschneider@gmail.com writes:
> > 
> >> +		if test_have_prereq CYGWIN; then
> >> +			: # NOOP
> >> +		elif test_have_prereq DARWIN; then
> >> +			stat -f %Sp text | egrep ^-r-- &&
> >> +			stat -f %Sp text+x | egrep ^-r-x
> >> +		else
> >> 			stat --format=%A text | egrep ^-r-- &&
> >> 			stat --format=%A text+x | egrep ^-r-x
> >> 		fi
> > 
> > Not a new problem but why do we need "stat" here?
> > 
> > Shouldn't "test -r", "! test -x", and their usual friends be
> > sufficient for the purpose of the test and are more portable?
> 
> Good question. The stat call was introduced with df9c545 by Pete Wyckoff.
> @Pete, @Luke: Are you aware of any particular reason for stat?

I think you could do this all with test. The key is to make sure the files are readable, not writable, and either executable or not. Cygwin and darwin oddities were not on my radar 3 years ago.

See also 4cea4d6 (git p4 test: use test_chmod for cygwin, 2013-01-26) for the description I wrote about what this test is trying to verify.

		-- Pete
Previous: Lars SchneiderNext: Torsten Bögershausen
Message 10 of 16 in “Add Travis CI support”
  1. 0/4 Add Travis CI supportlarsxschneider@gmail.com, Oct 4, 2015
  2. 1/4 Add Travis CI supportlarsxschneider@gmail.com, Oct 4, 2015
  3. Johannes SchindelinOct 5, 2015
  4. 2/4 Add prereq to detect OS Xlarsxschneider@gmail.com, Oct 4, 2015
  5. Junio C HamanoOct 4, 2015
  6. Lars SchneiderOct 4, 2015
  7. 3/4 git-p4: Fix t9815 git-p4-submit-fail test case on OS Xlarsxschneider@gmail.com, Oct 4, 2015
  8. Junio C HamanoOct 4, 2015
  9. Lars SchneiderOct 4, 2015
  10. Pete WyckoffOct 4, 2015
  11. Torsten BögershausenOct 5, 2015
  12. 4/4 git-p4: Disable t9819 git-p4-case-folding test on OS Xlarsxschneider@gmail.com, Oct 4, 2015
  13. Junio C HamanoOct 4, 2015
  14. Lars SchneiderOct 4, 2015
  15. Junio C HamanoOct 4, 2015
  16. Johannes SchindelinOct 5, 2015

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.