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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



larsxschneider@xxxxxxxxx wrote on Sun, 04 Oct 2015 11:44 -0700:
> 
> On 04 Oct 2015, at 11:23, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> 
> > larsxschneider@xxxxxxxxx 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]