git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C Hamano
Message 3 of 3 in “t2003: work around path mangling issue on Windows”
  1. t2003: work around path mangling issue on WindowsJohannes Sixt, Mar 20, 2013
  2. Junio C HamanoMar 20, 2013
  3. Johannes SixtMar 21, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.