Re: [PATCH 1/2] subtree: fix the GIT_EXEC_PATH sanity check to work on Windows

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

 



On Tue, Jun 15, 2021 at 11:33:58AM +0900, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
> 
> >> `test FILE1 -ef FILE2` checks wether the inode is the same.  And it's
> >> POSIX, so I'm assuming that it's sufficiently portable, though I
> >> haven't actually tested whether things other than Bash implement it.
> >
> > It's not POSIX. From
> > https://pubs.opengroup.org/onlinepubs/009695399/utilities/test.html:
> >
> > 	Some additional primaries newly invented or from the KornShell
> > 	appeared in an early proposal as part of the conditional command
> > 	([[]]): s1 > s2, s1 < s2, str = pattern, str != pattern,
> > 	f1 -nt f2, f1 -ot f2, and f1 -ef f2.
> >
> > Having said that, it appears that Bash implements it (what non-standard
> > behavior _doesn't_ it implement ;-))
> >
> > And since Git for Windows ships with Bash, we can actually use it!
> 
> So,... is contrib/subtree for Windows only?

I read it as "this workaround is needed only on Windows, and will kick
in only there; on other platforms, the "-ef" code will not run at all,
so we don't have to worry about its portability".

But having seen the earlier part of the thread, it looks like "are we on
Windows" is predicated on "! type -p cygpath", which seems a bit loose.
I also think "-p" is a bash-ism, so we'd want to avoid it before
determining whether we're on Windows to avoid a chicken-and-egg on other
platforms.

-Peff



[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]

  Powered by Linux