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

2013-09-19 Thread Jiang Xin
2013/9/18 Johannes Sixt j...@kdbg.org: 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:

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

2013-09-18 Thread Torsten Bögershausen
On 2013-09-17 21.32, Johannes Sixt wrote: 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:

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

2013-09-17 Thread Jiang Xin
2013/9/13 Junio C Hamano gits...@pobox.com: Jiang Xin worldhello@gmail.com writes: 2013/9/13 Junio C Hamano gits...@pobox.com: For systems that need POSIX escape hatch for Apollo Domain ;-), we would need a bit more work. When both path1 and path2 begin with a double-dash, we would

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

2013-09-17 Thread Johannes Sixt
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

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

2013-09-13 Thread Torsten Bögershausen
On 13.09.13 06:55, Jiang Xin wrote: 2013/9/13 Junio C Hamano gits...@pobox.com: For systems that need POSIX escape hatch for Apollo Domain ;-), we would need a bit more work. When both path1 and path2 begin with a double-dash, we would need to check if they match up to the next slash, so

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

2013-09-12 Thread Tvangeste
Thank you, this fixes the problem with `git svn rebase` on Windows for me. --Tvangeste On Thu, Sep 12, 2013 at 11:12 AM, Jiang Xin worldhello@gmail.com wrote: Tvangeste found that the relative_path function could not work properly on Windows if in and prefix have dos driver prefix.

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

2013-09-12 Thread Torsten Bögershausen
On 2013-09-12 11.12, Jiang Xin wrote: Tvangeste found that the relative_path function could not work properly on Windows if in and prefix have dos driver prefix. ($gmane/234434) e.g., When execute: test-path-utils relative_path C:/a/b D:/x/y, should return C:/a/b, but returns ../../C:/a/b,

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

2013-09-12 Thread Karsten Blees
Am 12.09.2013 11:12, schrieb Jiang Xin: Tvangeste found that the relative_path function could not work properly on Windows if in and prefix have dos driver prefix. ($gmane/234434) e.g., When execute: test-path-utils relative_path C:/a/b D:/x/y, should return C:/a/b, but returns

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

2013-09-12 Thread Junio C Hamano
Torsten Bögershausen tbo...@web.de writes: +static int have_same_root(const char *path1, const char *path2) +{ +int is_abs1, is_abs2; + +is_abs1 = is_absolute_path(path1); +is_abs2 = is_absolute_path(path2); +return (is_abs1 is_abs2 !strncasecmp(path1, path2, 1)) ||

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

2013-09-12 Thread Johannes Sixt
Am 12.09.2013 16:13, schrieb Torsten Bögershausen: On 2013-09-12 11.12, Jiang Xin wrote: +static int have_same_root(const char *path1, const char *path2) +{ +int is_abs1, is_abs2; + +is_abs1 = is_absolute_path(path1); +is_abs2 = is_absolute_path(path2); +return (is_abs1

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

2013-09-12 Thread Junio C Hamano
Johannes Sixt j...@kdbg.org writes: Am 12.09.2013 16:13, schrieb Torsten Bögershausen: On 2013-09-12 11.12, Jiang Xin wrote: +static int have_same_root(const char *path1, const char *path2) +{ + int is_abs1, is_abs2; + + is_abs1 = is_absolute_path(path1); + is_abs2 =

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

2013-09-12 Thread Jiang Xin
2013/9/13 Junio C Hamano gits...@pobox.com: For systems that need POSIX escape hatch for Apollo Domain ;-), we would need a bit more work. When both path1 and path2 begin with a double-dash, we would need to check if they match up to the next slash, so that - //host1/usr/src and

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

2013-09-12 Thread Junio C Hamano
Jiang Xin worldhello@gmail.com writes: 2013/9/13 Junio C Hamano gits...@pobox.com: For systems that need POSIX escape hatch for Apollo Domain ;-), we would need a bit more work. When both path1 and path2 begin with a double-dash, we would need to check if they match up to the next