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

Re: [PATCH 2/2] git-sh-setup: work around Cygwin path handling gotchas

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
May 24, 2012, 18:27 UTC
Message-ID
<4FBE7DA9.8040309@ramsay1.demon.co.uk>
In-Reply-To
<7vaa116ulx.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 11 quoted lines
> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
> 
>> However, you could imagine adding code to accommodate external windows
>> programs. If we limit ourselves to the text editor, for example, I could
>> imagine something like the diff attached below to fix up the C based git
>> programs. (You would need to make similar changes to the shell and perl
>> scripts which launch the text editor).
> 
> If you _only_ allow editors that understands windows style paths, your
> patch may make sense, but doesn't it break editors that wants only POSIX
> style paths?
Yes.
(If it wasn't clear, I included the code to show what I *didn't* want to see!).

Cygwin built text editors will, of course, work fine with POSIX paths, but may also work with win32 paths as well. For example, vim supports win32 paths just fine (it's the *only* editor I tested).

I would not be surprised if vim is not alone in that; I think it mainly depends on whether the editor attempts to "interpret" the parameter, or simply treats it as an opaque token to be passed straight to [f]open() [1].

Equally, I suspect some cygwin built editors will fail miserably (maybe they try to interpret the parameter as an scp-like url, say). I don't know and I'm not about to test every cygwin text editor to find out!

So, in my opinion, adding code to explicitly support win32 paths, while possible, is likely to open up a can-o-worms (even if this support were opt-in via config). I would prefer that we don't go there. :-D

ATB, Ramsay Jones

[1] Which is why git already supports win32 paths to a certain degree. For example, the following will work as expected:

  $ git config --global core.excludesfile 'C:/cygwin/home/ramsay/.gitignore'
(ie git will read and use the given .gitignore file without problem)
Previous: Junio C Hamano
Message 32 of 32 in “Git commit path vs rebase path”
  1. Steven PennyMay 6, 2012
  2. Junio C HamanoMay 7, 2012
  3. Johannes SixtMay 8, 2012
  4. Steven PennyMay 8, 2012
  5. Johannes SixtMay 8, 2012
  6. Steven PennyMay 8, 2012
  7. Junio C HamanoMay 8, 2012
  8. Junio C HamanoMay 8, 2012
  9. Steven PennyMay 8, 2012
  10. Junio C HamanoMay 9, 2012
  11. Steven PennyMay 9, 2012
  12. Ramsay JonesMay 10, 2012
  13. Steven PennyMay 11, 2012
  14. Ramsay JonesMay 13, 2012
  15. Steven PennyMay 13, 2012
  16. Johannes SixtMay 14, 2012
  17. Ramsay JonesMay 15, 2012
  18. Johannes SixtMay 16, 2012
  19. Ramsay JonesMay 17, 2012
  20. Junio C HamanoMay 17, 2012
  21. 0/2 Re: Git commit path vs rebase pathJunio C Hamano, May 16, 2012
  22. 1/2 git-sh-setup: define workaround wrappers before they are usedJunio C Hamano, May 16, 2012
  23. Ramsay JonesMay 17, 2012
  24. 2/2 git-sh-setup: work around Cygwin path handling gotchasJunio C Hamano, May 16, 2012
  25. Steven PennyMay 16, 2012
  26. Junio C HamanoMay 16, 2012
  27. Ramsay JonesMay 17, 2012
  28. Junio C HamanoMay 18, 2012
  29. Steven PennyMay 19, 2012
  30. Ramsay JonesMay 21, 2012
  31. Junio C HamanoMay 21, 2012
  32. Ramsay JonesMay 24, 2012

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.