Subject: Re: [PATCH jk/checkout-attribute-lookup] t2003: work around path mangling issue on Windows

From: Johannes Sixt <[email-masked]>
Date: Thu, 21 Mar 2013 07:46:45 +0100

Am 3/20/2013 18:10, schrieb Junio C Hamano:
> Johannes Sixt <[email-masked]> writes:
> 
>> From: Johannes Sixt <[email-masked]>
>>
>> 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