Re: [PATCH jk/checkout-attribute-lookup] t2003: work around path mangling issue on Windows
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 21, 2013, 06:46 UTC
- Message-ID
- <514AACD5.3010106@viscovery.net>
- In-Reply-To
- <7vli9if159.fsf@alter.siamese.dyndns.org>
Am 3/20/2013 18:10, schrieb Junio C Hamano:
Show 12 quoted lines
> Johannes Sixt <j.sixt@viscovery.net> writes: > >> From: Johannes Sixt <j6t@kdbg.org> >> >> MSYS bash considers the part "/g" in the sed expression "s/./=/g" as an >> absolute path after an assignment, and mangles it to a C:/something >> string. Do not attract bash's attention by avoiding the equals sign. > > If this breakage is about path mangling, I suspect it may be cleaner > to work it around by not using / as the pattern separator, e.g. > > sed -e s!.!=!g
Half a year down the road you'd scratch your head why you were not using '/' as separator. As the replacement character is irrelevant here, it's better to exchange that. Therefore, I still prefer my version.
> Or perhaps use SHELL_PATH to point at a more reasonable > implementation of shell that does not have such an idiocy?
Well, POSIX and DOS paths look inherently different, particularly absolute paths. You can't write a reasonably portable shell script if the shell doesn't help in some way.
Not to mention that the supply of POSIX shells on Windows is inherently scarce.
-- Hannes