{"thread":{"id":"28028","subject":"[PATH 0/2] On Cygwin support both UNIX and DOS style path-names","startedAt":"2011-08-05T16:10:12Z","lastAt":"2011-08-13T17:34:37Z","messageCount":19,"participants":["Pascal Obry","Erik Faye-Lund","Junio C Hamano","Ramsay Jones","Johannes Sixt","Vijay Lakshminarayanan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"172980","messageId":"1312560614-20772-1-git-send-email-pascal@obry.net","threadId":"28028","inReplyTo":null,"subject":"[PATH 0/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-05T16:10:12Z","receivedAt":"2011-08-05T16:10:12Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"This is the second version of this serie after Theo review. It includes\nthe patch from Theo first and mine after.\n\nLet me know if it looks ok. Thanks.\n"},{"id":"172981","messageId":"1312560614-20772-2-git-send-email-pascal@obry.net","threadId":"28028","inReplyTo":"1312560614-20772-1-git-send-email-pascal@obry.net","subject":"[PATCH 1/2] git-compat-util: add generic find_last_dir_sep that respects is_dir_sep","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-05T16:10:13Z","receivedAt":"2011-08-05T16:10:13Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"From: Theo Niessink <theo@taletn.com>\n\nMove MinGW's find_last_dir_sep to git-compat-util.h, so it can also be used\non other platforms that define is_dir_sep, e.g. Cygwin.\n\nSigned-off-by: Theo Niessink <theo@taletn.com>\nAcked-by: Pascal Obry <pascal@obry.net>\n---\n compat/mingw.h    |    9 ---------\n git-compat-util.h |   12 ++++++++++++\n 2 files changed, 12 insertions(+), 9 deletions(-)\n\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex ce9dd98..547568b 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -300,15 +300,6 @@ int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format\n \n #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n #define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n-static inline char *mingw_find_last_dir_sep(const char *path)\n-{\n-\tchar *ret = NULL;\n-\tfor (; *path; ++path)\n-\t\tif (is_dir_sep(*path))\n-\t\t\tret = (char *)path;\n-\treturn ret;\n-}\n-#define find_last_dir_sep mingw_find_last_dir_sep\n #define PATH_SEP ';'\n #define PRIuMAX \"I64u\"\n \ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex ddfbf77..c2c94cd 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -211,6 +211,18 @@ extern char *gitbasename(char *);\n #define has_dos_drive_prefix(path) 0\n #endif\n \n+#if !defined(find_last_dir_sep) && defined(is_dir_sep)\n+static inline char *compat_find_last_dir_sep(const char *path)\n+{\n+\tchar *ret = NULL;\n+\tfor (; *path; ++path)\n+\t\tif (is_dir_sep(*path))\n+\t\t\tret = (char *)path;\n+\treturn ret;\n+}\n+#define find_last_dir_sep compat_find_last_dir_sep\n+#endif\n+\n #ifndef is_dir_sep\n #define is_dir_sep(c) ((c) == '/')\n #endif\n-- \n1.7.6.404.g5d2fc\n"},{"id":"172982","messageId":"1312560614-20772-3-git-send-email-pascal@obry.net","threadId":"28028","inReplyTo":"1312560614-20772-1-git-send-email-pascal@obry.net","subject":"[PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-05T16:10:14Z","receivedAt":"2011-08-05T16:10:14Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"In fact Cygwin supports both, so make Git agree with this.\nThe failing case is when a file is committed in a sub-dir of the\nrepository using a log message from a file specified with a DOS\nstyle path-name. To reproduce:\n\n   $ cd src\n   $ git commit -F c:\\tmp\\log.txt file.c\n   fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n   or directory.\n\nSigned-off-by: Pascal Obry <pascal@obry.net>\n---\n compat/cygwin.h |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/compat/cygwin.h b/compat/cygwin.h\nindex a3229f5..de9737c 100644\n--- a/compat/cygwin.h\n+++ b/compat/cygwin.h\n@@ -7,3 +7,6 @@ extern stat_fn_t cygwin_lstat_fn;\n \n #define stat(path, buf) (*cygwin_stat_fn)(path, buf)\n #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)\n+\n+#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n+#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n-- \n1.7.6.404.g5d2fc\n"},{"id":"172987","messageId":"CABPQNSYSzsY-CQdi6iJQftsY1ufMpxkax=eQLgopVxMC6LoxfA@mail.gmail.com","threadId":"28028","inReplyTo":"1312560614-20772-3-git-send-email-pascal@obry.net","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-08-05T17:29:01Z","receivedAt":"2011-08-05T17:29:01Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Aug 5, 2011 at 6:10 PM, Pascal Obry <pascal@obry.net> wrote:\n> In fact Cygwin supports both, so make Git agree with this.\n> The failing case is when a file is committed in a sub-dir of the\n> repository using a log message from a file specified with a DOS\n> style path-name. To reproduce:\n>\n>   $ cd src\n>   $ git commit -F c:\\tmp\\log.txt file.c\n>   fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>   or directory.\n\nCygwin is a unix-layer on top of Windows, designed to play by the\nPOSIX-rules. So why would you want to support Windows-style paths on\nCygwin?\n\nIf you want a Git that handles Windows paths, use Git for Windows...\n"},{"id":"172988","messageId":"4E3C29D9.5060305@obry.net","threadId":"28028","inReplyTo":"CABPQNSYSzsY-CQdi6iJQftsY1ufMpxkax=eQLgopVxMC6LoxfA@mail.gmail.com","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-05T17:35:21Z","receivedAt":"2011-08-05T17:35:21Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Le 05/08/2011 19:29, Erik Faye-Lund a écrit :\n> Cygwin is a unix-layer on top of Windows, designed to play by the\n> POSIX-rules. So why would you want to support Windows-style paths on\n> Cygwin?\n\nBecause cygwin toolset does support \\.\n\n> If you want a Git that handles Windows paths, use Git for Windows...\n\nNote that Windows is a special case as even the Win32 API does support \\ \nand /, so every tool on Windows seems to handle nicely this. Why not \nGit, be it Cygwin/Git. If it does not break anything else.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"172989","messageId":"CABPQNSYQ9D7NO5cx_o3csAe4bQ40kOd1f5gATUXDb7r4n3GhdA@mail.gmail.com","threadId":"28028","inReplyTo":"4E3C29D9.5060305@obry.net","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-08-05T17:39:50Z","receivedAt":"2011-08-05T17:39:50Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Aug 5, 2011 at 7:35 PM, Pascal Obry <pascal@obry.net> wrote:\n> Le 05/08/2011 19:29, Erik Faye-Lund a écrit :\n>>\n>> Cygwin is a unix-layer on top of Windows, designed to play by the\n>> POSIX-rules. So why would you want to support Windows-style paths on\n>> Cygwin?\n>\n> Because cygwin toolset does support \\.\n>\n\nAre you saying that the built-in Cygwin tools (like ls etc) support\nWindows-style paths (C:\\path\\to\\file)? If that is the case, I\ncompletely understand the desire to accept Windows-paths.\n\n>> If you want a Git that handles Windows paths, use Git for Windows...\n>\n> Note that Windows is a special case as even the Win32 API does support \\ and\n> /, so every tool on Windows seems to handle nicely this. Why not Git, be it\n> Cygwin/Git. If it does not break anything else.\n\nIf the Cygwin-tools does not support drive-prefixes (i.e \"C:\\\") but\ndoes support both slashes as path-separators, then I agree with the\npatch but not with the commit message.\n"},{"id":"172990","messageId":"7vipqb3g1w.fsf@alter.siamese.dyndns.org","threadId":"28028","inReplyTo":"1312560614-20772-3-git-send-email-pascal@obry.net","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-05T17:48:43Z","receivedAt":"2011-08-05T17:48:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pascal Obry <pascal@obry.net> writes:\n\n> In fact Cygwin supports both, so make Git agree with this.\n> The failing case is when a file is committed in a sub-dir of the\n> repository using a log message from a file specified with a DOS\n> style path-name. To reproduce:\n>\n>    $ cd src\n>    $ git commit -F c:\\tmp\\log.txt file.c\n>    fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>    or directory.\n>\n> Signed-off-by: Pascal Obry <pascal@obry.net>\n> ---\n>  compat/cygwin.h |    3 +++\n>  1 files changed, 3 insertions(+), 0 deletions(-)\n>\n> diff --git a/compat/cygwin.h b/compat/cygwin.h\n> index a3229f5..de9737c 100644\n> --- a/compat/cygwin.h\n> +++ b/compat/cygwin.h\n> @@ -7,3 +7,6 @@ extern stat_fn_t cygwin_lstat_fn;\n>  \n>  #define stat(path, buf) (*cygwin_stat_fn)(path, buf)\n>  #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)\n> +\n> +#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n> +#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n\nI wonder if these two that are the same as mingw should further be\nconsolidated into one implementation, something like below.\n\nNote that I am just wondering, not suggesting, without knowing which is\nbetter.\n\n compat/cygwin.h   |    5 ++---\n compat/mingw.h    |    3 +--\n git-compat-util.h |   11 ++++-------\n 3 files changed, 7 insertions(+), 12 deletions(-)\n\ndiff --git a/compat/cygwin.h b/compat/cygwin.h\nindex de9737c..ef0889b 100644\n--- a/compat/cygwin.h\n+++ b/compat/cygwin.h\n@@ -1,12 +1,11 @@\n #include <sys/types.h>\n #include <sys/stat.h>\n \n+#define DOS_STYLE_DIR_SEP 1\n+\n typedef int (*stat_fn_t)(const char*, struct stat*);\n extern stat_fn_t cygwin_stat_fn;\n extern stat_fn_t cygwin_lstat_fn;\n \n #define stat(path, buf) (*cygwin_stat_fn)(path, buf)\n #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)\n-\n-#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n-#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex 547568b..26ca0ef 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -298,8 +298,7 @@ int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format\n  * git specific compatibility\n  */\n \n-#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n-#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n+#define DOS_STYLE_DIR_SEP 1\n #define PATH_SEP ';'\n #define PRIuMAX \"I64u\"\n \ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex c2c94cd..133f331 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -211,7 +211,9 @@ extern char *gitbasename(char *);\n #define has_dos_drive_prefix(path) 0\n #endif\n \n-#if !defined(find_last_dir_sep) && defined(is_dir_sep)\n+#if defined(DOS_STYLE_DIR_SEP)\n+#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n+#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n static inline char *compat_find_last_dir_sep(const char *path)\n {\n \tchar *ret = NULL;\n@@ -221,13 +223,8 @@ static inline char *compat_find_last_dir_sep(const char *path)\n \treturn ret;\n }\n #define find_last_dir_sep compat_find_last_dir_sep\n-#endif\n-\n-#ifndef is_dir_sep\n+#else\n #define is_dir_sep(c) ((c) == '/')\n-#endif\n-\n-#ifndef find_last_dir_sep\n #define find_last_dir_sep(path) strrchr(path, '/')\n #endif\n \n"},{"id":"172991","messageId":"CABPQNSb2O2JrQ8QeRAq5teizmRzE-b=dDKKB=ba-=DL3eDPL6w@mail.gmail.com","threadId":"28028","inReplyTo":"CABPQNSYQ9D7NO5cx_o3csAe4bQ40kOd1f5gATUXDb7r4n3GhdA@mail.gmail.com","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-08-05T17:51:45Z","receivedAt":"2011-08-05T17:51:45Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Aug 5, 2011 at 7:39 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n> On Fri, Aug 5, 2011 at 7:35 PM, Pascal Obry <pascal@obry.net> wrote:\n>> Le 05/08/2011 19:29, Erik Faye-Lund a écrit :\n>>>\n>>> Cygwin is a unix-layer on top of Windows, designed to play by the\n>>> POSIX-rules. So why would you want to support Windows-style paths on\n>>> Cygwin?\n>>\n>> Because cygwin toolset does support \\.\n>>\n>\n> Are you saying that the built-in Cygwin tools (like ls etc) support\n> Windows-style paths (C:\\path\\to\\file)? If that is the case, I\n> completely understand the desire to accept Windows-paths.\n>\n>>> If you want a Git that handles Windows paths, use Git for Windows...\n>>\n>> Note that Windows is a special case as even the Win32 API does support \\ and\n>> /, so every tool on Windows seems to handle nicely this. Why not Git, be it\n>> Cygwin/Git. If it does not break anything else.\n>\n> If the Cygwin-tools does not support drive-prefixes (i.e \"C:\\\") but\n> does support both slashes as path-separators, then I agree with the\n> patch but not with the commit message.\n>\n\ncorrection: if that is the case, I agree with the is_dir_sep-part, but\nnot the has_dos_drive_prefix-part of the patch (and also not the\nexample from the commit message)\n"},{"id":"172992","messageId":"CABPQNSb96xdiL=POyrM-vR1f_KN6s+0UwnZ4E3pZ8NoTfSixzw@mail.gmail.com","threadId":"28028","inReplyTo":"7vipqb3g1w.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-08-05T17:58:18Z","receivedAt":"2011-08-05T17:58:18Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Aug 5, 2011 at 7:48 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Pascal Obry <pascal@obry.net> writes:\n>\n>> In fact Cygwin supports both, so make Git agree with this.\n>> The failing case is when a file is committed in a sub-dir of the\n>> repository using a log message from a file specified with a DOS\n>> style path-name. To reproduce:\n>>\n>>    $ cd src\n>>    $ git commit -F c:\\tmp\\log.txt file.c\n>>    fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>>    or directory.\n>>\n>> Signed-off-by: Pascal Obry <pascal@obry.net>\n>> ---\n>>  compat/cygwin.h |    3 +++\n>>  1 files changed, 3 insertions(+), 0 deletions(-)\n>>\n>> diff --git a/compat/cygwin.h b/compat/cygwin.h\n>> index a3229f5..de9737c 100644\n>> --- a/compat/cygwin.h\n>> +++ b/compat/cygwin.h\n>> @@ -7,3 +7,6 @@ extern stat_fn_t cygwin_lstat_fn;\n>>\n>>  #define stat(path, buf) (*cygwin_stat_fn)(path, buf)\n>>  #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)\n>> +\n>> +#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n>> +#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n>\n> I wonder if these two that are the same as mingw should further be\n> consolidated into one implementation, something like below.\n>\n> Note that I am just wondering, not suggesting, without knowing which is\n> better.\n\nIMO this becomes a bit hard to read as you have to ping-pong between\nsources to understand exactly what that flag does. We have\ncompat/win32.h, perhaps we should move the macros there and include it\nfrom both compat/mingw.h and compat/cygwin.h instead (given that we're\ngoing to do this, of course)?\n"},{"id":"172993","messageId":"4E3C38FB.4030002@obry.net","threadId":"28028","inReplyTo":"CABPQNSYQ9D7NO5cx_o3csAe4bQ40kOd1f5gATUXDb7r4n3GhdA@mail.gmail.com","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-05T18:39:55Z","receivedAt":"2011-08-05T18:39:55Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Le 05/08/2011 19:39, Erik Faye-Lund a écrit :\n> Are you saying that the built-in Cygwin tools (like ls etc) support\n> Windows-style paths (C:\\path\\to\\file)? If that is the case, I\n> completely understand the desire to accept Windows-paths.\n\nExactly.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"173010","messageId":"4E3CE6D9.4050600@obry.net","threadId":"28028","inReplyTo":"7vipqb3g1w.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-06T07:01:45Z","receivedAt":"2011-08-06T07:01:45Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Le 05/08/2011 19:48, Junio C Hamano a écrit :\n> I wonder if these two that are the same as mingw should further be\n> consolidated into one implementation, something like below.\n\nFine with me.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"173214","messageId":"4E416D4A.40602@ramsay1.demon.co.uk","threadId":"28028","inReplyTo":"1312560614-20772-3-git-send-email-pascal@obry.net","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-08-09T17:24:26Z","receivedAt":"2011-08-09T17:24:26Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Pascal Obry wrote:\n> In fact Cygwin supports both, so make Git agree with this.\n> The failing case is when a file is committed in a sub-dir of the\n> repository using a log message from a file specified with a DOS\n> style path-name. To reproduce:\n> \n>    $ cd src\n>    $ git commit -F c:\\tmp\\log.txt file.c\n>    fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>    or directory.\n\nHmm, are you using bash or cmd.exe? Using bash I get the following:\n\n    $ cd src\n    $ git commut -F c:\\tmp\\log.txt file.c\n    fatal: could not read file 'src/c:tmplog.txt': No such file or directory\n    $ \n\nWhich is what I would expect of (any) posix shell, viz:\n\n    $ ls c:\\\n    > ^C\n    $ ls c:\\\\\n    AUTOEXEC.BAT*            NTDETECT.COM*               WATCOM/       msysgit/\n    CMPNENTS/                Program Files/              WINDOWS/      msysgit-old/\n    CONFIG.SYS*              RECYCLER/                   boot.ini*     ntldr*\n    Documents and Settings/  SUPPORT/                    cygwin/       pagefile.sys\n    I386/                    SWSTAMP.TXT*                cygwintemp/   ssl/\n    IO.SYS*                  System Volume Information/  dm/           uname/\n    MSDOS.SYS*               TOOLSCD/                    dm840/        zlib/\n    MSOCache/                VALUEADD/                   hiberfil.sys\n    $ \n\nIf you want to use cmd.exe as your shell, I suspect msysGit (Git For Windows)\nmay be a better fit.\n\nATB,\nRamsay Jones\n"},{"id":"173215","messageId":"4E416DC9.2080907@ramsay1.demon.co.uk","threadId":"28028","inReplyTo":"CABPQNSYSzsY-CQdi6iJQftsY1ufMpxkax=eQLgopVxMC6LoxfA@mail.gmail.com","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-08-09T17:26:33Z","receivedAt":"2011-08-09T17:26:33Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Erik Faye-Lund wrote:\n> On Fri, Aug 5, 2011 at 6:10 PM, Pascal Obry <pascal@obry.net> wrote:\n>> In fact Cygwin supports both, so make Git agree with this.\n>> The failing case is when a file is committed in a sub-dir of the\n>> repository using a log message from a file specified with a DOS\n>> style path-name. To reproduce:\n>>\n>>   $ cd src\n>>   $ git commit -F c:\\tmp\\log.txt file.c\n>>   fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>>   or directory.\n> \n> Cygwin is a unix-layer on top of Windows, designed to play by the\n> POSIX-rules. So why would you want to support Windows-style paths on\n> Cygwin?\n> \n> If you want a Git that handles Windows paths, use Git for Windows...\n\nIndeed, I have to agree. This takes the cygwin port in the wrong\ndirection ...\n\nATB,\nRamsay Jones\n"},{"id":"173216","messageId":"4E416EA9.1010401@ramsay1.demon.co.uk","threadId":"28028","inReplyTo":"4E3C29D9.5060305@obry.net","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-08-09T17:30:17Z","receivedAt":"2011-08-09T17:30:17Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Pascal Obry wrote:\n> Le 05/08/2011 19:29, Erik Faye-Lund a écrit :\n>> Cygwin is a unix-layer on top of Windows, designed to play by the\n>> POSIX-rules. So why would you want to support Windows-style paths on\n>> Cygwin?\n> \n> Because cygwin toolset does support \\.\n\nHmm, if you don't mind escaping it in bash all the time!\n\n> \n>> If you want a Git that handles Windows paths, use Git for Windows...\n> \n> Note that Windows is a special case as even the Win32 API does support \\ \n> and /, so every tool on Windows seems to handle nicely this. Why not \n> Git, be it Cygwin/Git. If it does not break anything else.\n\nHmm, I wouldn't be too sure of that, either ...\n\nATB,\nRamsay Jones\n"},{"id":"173219","messageId":"4E418EC3.4070904@kdbg.org","threadId":"28028","inReplyTo":"1312560614-20772-3-git-send-email-pascal@obry.net","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2011-08-09T19:47:15Z","receivedAt":"2011-08-09T19:47:15Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 05.08.2011 18:10, schrieb Pascal Obry:\n> In fact Cygwin supports both, so make Git agree with this.\n> The failing case is when a file is committed in a sub-dir of the\n> repository using a log message from a file specified with a DOS\n> style path-name. To reproduce:\n> \n>    $ cd src\n>    $ git commit -F c:\\tmp\\log.txt file.c\n>    fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>    or directory.\n\nDo you also want to support this:\n\n     $ git add src\\file.c\n\ni.e., backslash in pathspec? Then you need more than this:\n\n> +#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n> +#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n\nIn particular, you have to enable backslash processing in\nsetup.c:prefix_filename(), but then you lose the ability to escape\nspecial characters with the backslash.\n\n-- Hannes\n"},{"id":"173222","messageId":"4E419AB3.7090405@obry.net","threadId":"28028","inReplyTo":"4E416D4A.40602@ramsay1.demon.co.uk","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-09T20:38:11Z","receivedAt":"2011-08-09T20:38:11Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Le 09/08/2011 19:24, Ramsay Jones a écrit :\n> Pascal Obry wrote:\n>> In fact Cygwin supports both, so make Git agree with this.\n>> The failing case is when a file is committed in a sub-dir of the\n>> repository using a log message from a file specified with a DOS\n>> style path-name. To reproduce:\n>>\n>>     $ cd src\n>>     $ git commit -F c:\\tmp\\log.txt file.c\n>>     fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>>     or directory.\n>\n> Hmm, are you using bash or cmd.exe? Using bash I get the following:\n\nbash.\n\n>\n>      $ cd src\n>      $ git commut -F c:\\tmp\\log.txt file.c\n>      fatal: could not read file 'src/c:tmplog.txt': No such file or directory\n>      $\n>\n> Which is what I would expect of (any) posix shell, viz:\n>\n>      $ ls c:\\\n>      >  ^C\n>      $ ls c:\\\\\n>      AUTOEXEC.BAT*            NTDETECT.COM*               WATCOM/       msysgit/\n>      CMPNENTS/                Program Files/              WINDOWS/      msysgit-old/\n>      CONFIG.SYS*              RECYCLER/                   boot.ini*     ntldr*\n>      Documents and Settings/  SUPPORT/                    cygwin/       pagefile.sys\n>      I386/                    SWSTAMP.TXT*                cygwintemp/   ssl/\n>      IO.SYS*                  System Volume Information/  dm/           uname/\n>      MSDOS.SYS*               TOOLSCD/                    dm840/        zlib/\n>      MSOCache/                VALUEADD/                   hiberfil.sys\n\nExactly, \\\\ this is what I have used and this is the bug. Cygwin \nsupports ls c:\\\\ so should Cygwin/Git. My quoted example was missing the \nescape \\.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"173228","messageId":"871uwunfx8.fsf@gmail.com","threadId":"28028","inReplyTo":"4E416D4A.40602@ramsay1.demon.co.uk","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Vijay Lakshminarayanan","fromEmail":"laksvij@gmail.com","sentAt":"2011-08-10T02:44:51Z","receivedAt":"2011-08-10T02:44:51Z","isPatch":true,"sender":{"key":"laksvij@gmail.com","avatar":null},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Pascal Obry wrote:\n>> In fact Cygwin supports both, so make Git agree with this.\n>> The failing case is when a file is committed in a sub-dir of the\n>> repository using a log message from a file specified with a DOS\n>> style path-name. To reproduce:\n>> \n>>    $ cd src\n>>    $ git commit -F c:\\tmp\\log.txt file.c\n>>    fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>>    or directory.\n>\n> Hmm, are you using bash or cmd.exe? Using bash I get the following:\n>\n>     $ cd src\n>     $ git commut -F c:\\tmp\\log.txt file.c\n>     fatal: could not read file 'src/c:tmplog.txt': No such file or directory\n>     $ \n>\n> Which is what I would expect of (any) posix shell, viz:\n>\n>     $ ls c:\\\n>     > ^C\n>     $ ls c:\\\\\n>     AUTOEXEC.BAT*            NTDETECT.COM*               WATCOM/       msysgit/\n>     CMPNENTS/                Program Files/              WINDOWS/      msysgit-old/\n>     CONFIG.SYS*              RECYCLER/                   boot.ini*     ntldr*\n>     Documents and Settings/  SUPPORT/                    cygwin/       pagefile.sys\n>     I386/                    SWSTAMP.TXT*                cygwintemp/   ssl/\n>     IO.SYS*                  System Volume Information/  dm/           uname/\n>     MSDOS.SYS*               TOOLSCD/                    dm840/        zlib/\n>     MSOCache/                VALUEADD/                   hiberfil.sys\n>     $ \n\nFWIW, I use git on Cygwin and it works quite well.  Cygwin supports\nWindows paths when quoted.  So\n\n$ ls 'C:\\Users\\vijay\\Desktop'\n\nworks as expected.  This is very useful when you're copying paths from,\nsay, Windows Explorer, to Cygwin.\n\n> ATB,\n> Ramsay Jones\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n-- \nCheers\n~vijay\n\nGnus should be more complicated.\n"},{"id":"173450","messageId":"4E443D1B.60306@ramsay1.demon.co.uk","threadId":"28028","inReplyTo":"4E419AB3.7090405@obry.net","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-08-11T20:35:39Z","receivedAt":"2011-08-11T20:35:39Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Pascal Obry wrote:\n> Le 09/08/2011 19:24, Ramsay Jones a écrit :\n>> Pascal Obry wrote:\n>>> In fact Cygwin supports both, so make Git agree with this.\n>>> The failing case is when a file is committed in a sub-dir of the\n>>> repository using a log message from a file specified with a DOS\n>>> style path-name. To reproduce:\n>>>\n>>>     $ cd src\n>>>     $ git commit -F c:\\tmp\\log.txt file.c\n>>>     fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n>>>     or directory.\n>> Hmm, are you using bash or cmd.exe? Using bash I get the following:\n> \n> bash.\n\nAh, OK. The example in your commit message looked odd (ie incorrect) which\nmade me think that you were probably using cnd.exe, so ...\n\n>>      $ cd src\n>>      $ git commut -F c:\\tmp\\log.txt file.c\n>>      fatal: could not read file 'src/c:tmplog.txt': No such file or directory\n>>      $\n>>\n>> Which is what I would expect of (any) posix shell, viz:\n>>\n>>      $ ls c:\\\n>>      >  ^C\n>>      $ ls c:\\\\\n>>      AUTOEXEC.BAT*            NTDETECT.COM*               WATCOM/       msysgit/\n>>      CMPNENTS/                Program Files/              WINDOWS/      msysgit-old/\n>>      CONFIG.SYS*              RECYCLER/                   boot.ini*     ntldr*\n>>      Documents and Settings/  SUPPORT/                    cygwin/       pagefile.sys\n>>      I386/                    SWSTAMP.TXT*                cygwintemp/   ssl/\n>>      IO.SYS*                  System Volume Information/  dm/           uname/\n>>      MSDOS.SYS*               TOOLSCD/                    dm840/        zlib/\n>>      MSOCache/                VALUEADD/                   hiberfil.sys\n> \n> Exactly, \\\\ this is what I have used and this is the bug. Cygwin \n> supports ls c:\\\\ so should Cygwin/Git. My quoted example was missing the \n> escape \\.\n\n ... could you please correct your commit message. Thanks!\n\nATB,\nRamsay Jones\n"},{"id":"173454","messageId":"4E46B5AD.5050806@obry.net","threadId":"28028","inReplyTo":"4E443D1B.60306@ramsay1.demon.co.uk","subject":"Re: [PATCH 2/2] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-08-13T17:34:37Z","receivedAt":"2011-08-13T17:34:37Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Le 11/08/2011 22:35, Ramsay Jones a écrit :\n>   ... could you please correct your commit message. Thanks!\n\nDone, thanks for your review.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"}]}