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

Re: [PATCH 1/2] relative_path should honor dos_drive_prefix

From
Torsten Bögershausen <tboegi@web.de>
Date
Sep 18, 2013, 14:29 UTC
Message-ID
<5239B8B1.5050605@web.de>
In-Reply-To
<5238AE60.1010700@kdbg.org>
On 2013-09-17 21.32, Johannes Sixt wrote:
Show 50 quoted lines
> Am 17.09.2013 10:24, schrieb Jiang Xin:
>> I have checked the behavior of UNC path on Windows (msysGit):
>>
>> * I can cd to a UNC path:
>>
>>     cd //server1/share1/path
>>
>> * can cd to other share:
>>
>>     cd ../../share2/path
>>
>> * and can cd to other server's share:
>>
>>     cd ../../../server2/share/path
>>
>> That means relative_path(path1, path2) support UNC paths out of the box.
>> We only need to check both path1 and path2 are UNC paths, or both not.
> 
> Your tests are flawed. You issued the commands in bash, which (or rather
> MSYS) does everything for you that you need to make it work. But in
> reality it does not, because the system cannot apply .. to //server/share:
> 
> $ git ls-remote //srv/public/../repos/his/setups.git
> fatal: '//srv/public/../repos/his/setups.git' does not appear to be a
> git repository
> fatal: Could not read from remote repository.
> 
> Please make sure you have the correct access rights
> and the repository exists.
> 
> even though the repository (and //srv/public, let me assure) exists:
> 
> $ git ls-remote //srv/repos/his/setups.git
> bea489b0611a72c41f133343fdccbd3e2b9f80b5        HEAD
> ...
> 
> The situation does not change with your latest round (v3).
> 
> Please let me suggest not to scratch where there is no itch. ;) Your
> round v2 was good enough.
> 
> If you really want to check UNC paths, then you must compare two path
> components after the the double-slash, not just one.
> 
> Furthermore, you should audit all code that references
> is_absolute_path(), relative_path(), normalize_path_copy(), and possibly
> a few others whether the functions or call sites need improvement.
> That's worth a separate patch.
> 
> -- Hannes

I tend to agree here. The V2 patch fixed a regression. This should be one commit on its own: Documentation/SubmittingPatches: (1) Make separate commits for logically separate changes.

Fixing a bug is a good thing, thanks for working on this,

The support for UNC paths is a new feature, and this deserves a seperate commit. /Torsten

Previous: Johannes SixtNext: Jiang Xin
Message 31 of 48 in “Regression in e02ca72: git svn rebase is broken on Windows”
  1. TvangesteSep 10, 2013
  2. Johannes SchindelinSep 10, 2013
  3. TvangesteSep 10, 2013
  4. Johannes SchindelinSep 10, 2013
  5. TvangesteSep 10, 2013
  6. Johannes SixtSep 10, 2013
  7. TvangesteSep 10, 2013
  8. Junio C HamanoSep 10, 2013
  9. Karsten BleesSep 10, 2013
  10. Jiang XinSep 11, 2013
  11. Jiang XinSep 11, 2013
  12. Johannes SixtSep 11, 2013
  13. 1/2 relative_path should honor dos_drive_prefixJiang Xin, Sep 12, 2013
  14. 2/2 Use simpler relative_path when set_git_dirJiang Xin, Sep 12, 2013
  15. Johannes SixtSep 12, 2013
  16. TvangesteSep 12, 2013
  17. Torsten BögershausenSep 12, 2013
  18. Junio C HamanoSep 12, 2013
  19. Johannes SixtSep 12, 2013
  20. Junio C HamanoSep 12, 2013
  21. Jiang XinSep 13, 2013
  22. Junio C HamanoSep 13, 2013
  23. Jiang XinSep 17, 2013
  24. 1/3 test: use unambigous leading path (/foo) for mingwJiang Xin, Sep 17, 2013
  25. 2/3 relative_path should honor DOS and UNC pathsJiang Xin, Sep 17, 2013
  26. Junio C HamanoSep 17, 2013
  27. Jiang XinSep 18, 2013
  28. Junio C HamanoSep 18, 2013
  29. 3/3 Use simpler relative_path when set_git_dirJiang Xin, Sep 17, 2013
  30. Johannes SixtSep 17, 2013
  31. Torsten BögershausenSep 18, 2013
  32. Jiang XinSep 20, 2013
  33. 0/3 relative path regression fixJiang Xin, Sep 20, 2013
  34. 1/3 test: use unambigous leading path (/foo) for mingwJiang Xin, Sep 20, 2013
  35. Sebastian SchuberthOct 10, 2013
  36. Jiang XinOct 14, 2013
  37. 0/3 relative path regression fixJiang Xin, Oct 14, 2013
  38. 1/3 test: use unambigous leading path (/foo) for MSYSJiang Xin, Oct 14, 2013
  39. Sebastian SchuberthOct 14, 2013
  40. Eric SunshineOct 14, 2013
  41. 2/3 relative_path should honor dos-drive-prefixJiang Xin, Oct 14, 2013
  42. 3/3 Use simpler relative_path when set_git_dirJiang Xin, Oct 14, 2013
  43. 2/3 relative_path should honor dos-driver-prefixJiang Xin, Sep 20, 2013
  44. Sebastian SchuberthOct 10, 2013
  45. 3/3 Use simpler relative_path when set_git_dirJiang Xin, Sep 20, 2013
  46. Torsten BögershausenSep 13, 2013
  47. Karsten BleesSep 12, 2013
  48. Torsten BögershausenSep 18, 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.