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

Re: [PATCH v2] fix pushing to //server/share/dir on Windows

From
Jeff King <peff@peff.net>
Date
Dec 15, 2016, 11:01 UTC
Message-ID
<20161215110155.it7ptkbju5etmnpn@sigill.intra.peff.net>
In-Reply-To
<c8501e28-db8a-5b6e-717c-5bda1e63c2e7@web.de>
On Thu, Dec 15, 2016 at 08:30:52AM +0100, Torsten Bögershausen wrote:
Show 21 quoted lines
> > > Would it be reasonable to
> > > write:
> > > 
> > >    /* Copy initial part of absolute path, converting separators on Windows */
> > >    const char *end = src + offset_1st_component(src);
> > >    while (src < end) {
> > > 	  char c = *src++;
> > > 	  if (c == '\\')
> > > 		  c = '/';
> > > 	  *dst++ = c;
> > >    }
> > Makes a lot of sense! I haven't had an opportunity, though, to test
> > on Windows.
> I'm not sure, if a conversion should be done here, in this part of code.
> To my knowledge,
> 
> C:\dir1\file
> is the same
> as
> C:/dir1/file
> and that is handled by windows.

I don't have an opinion either way on what Windows would want, but note that the function already _does_ convert separators to slashes. With Johannes's original patch, you'd end up with a mix, like:

  \\server\share/dir1/file

So this conversion is really just retaining the original behavior, and making it consistent throughout the path.

Which isn't to say that the function as it currently exists isn't a little bit buggy. :)

One of the points of normalizing, though, is that Git can then do textual comparisons between the output. So I think there's value in having a canonical internal representation, even if the OS could handle more exotic ones.

-Peff
Previous: Torsten BögershausenNext: Junio C Hamano
Message 6 of 8 in “fix pushing to //server/share/dir paths on Windows”
  1. fix pushing to //server/share/dir paths on WindowsJohannes Sixt, Dec 13, 2016
  2. Junio C HamanoDec 13, 2016
  3. Jeff KingDec 14, 2016
  4. fix pushing to //server/share/dir on WindowsJohannes Sixt, Dec 14, 2016
  5. Torsten BögershausenDec 15, 2016
  6. Jeff KingDec 15, 2016
  7. Junio C HamanoDec 15, 2016
  8. Johannes SchindelinDec 19, 2016

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.