Re: [PATCH 1/2] subtree: fix the GIT_EXEC_PATH sanity check to work on Windows
- From
Jeff King <peff@peff.net>
- Date
- Jun 15, 2021, 11:18 UTC
- Message-ID
- <YMiMaG2nYHYZKofJ@coredump.intra.peff.net>
- In-Reply-To
- <0c409e32-423b-a4bb-22b9-a43cd1c802f2@gmail.com>
On Tue, Jun 15, 2021 at 06:05:08PM +0700, Bagas Sanjaya wrote:
Show 12 quoted lines
> Hi Jeff, > > > 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 > > > > What is the POSIX equivalent then of?
I don't think there is an equivalent for "-p". But regular "type" is probably sufficient for this use (the "-p" is just suppressing aliases and functions).
It would be nice if there was a more robust test in general, though (after all, I could have something called "cygpath" on a non-Windows system). I don't know what options there are to get info from bash, though.
(I'd also clarify that I haven't been carefully following this thread, so take any suggestion or comments from me with a grain of salt. I mostly jumped in because it looked like there was a communication confusion).
-Peff