{"thread":{"id":"41782","subject":"[PATCH 1/4] config --show-origin: report paths with forward slashes","startedAt":"2016-03-22T17:42:34Z","lastAt":"2016-04-04T20:42:21Z","messageCount":42,"participants":["Johannes Schindelin","Junio C Hamano","Jonathan Nieder","Torsten Bögershausen","Lars Schneider","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"281447","messageId":"cover.1458668543.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":null,"subject":"[PATCH 0/4] Git for Windows fixes in preparation for 2.8.0","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-22T17:42:34Z","receivedAt":"2016-03-22T17:42:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The t1300 and t9115 tests regressed on Windows. These patches fix that.\n\n\nJohannes Schindelin (4):\n  config --show-origin: report paths with forward slashes\n  Make t1300-repo-config resilient to being run via 'sh -x'\n  t1300: fix the new --show-origin tests on Windows\n  mingw: skip some tests in t9115 due to file name issues\n\n compat/mingw.h                           |  6 ++++++\n path.c                                   |  3 +++\n t/t1300-repo-config.sh                   | 23 ++++++++++++++---------\n t/t9115-git-svn-dcommit-funky-renames.sh |  4 ++--\n 4 files changed, 25 insertions(+), 11 deletions(-)\n\n-- \n2.7.4.windows.1\n"},{"id":"281446","messageId":"8beb1c208e33e1de8f272caa22fb7a0b662ca4cc.1458668543.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458668543.git.johannes.schindelin@gmx.de","subject":"[PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-22T17:42:40Z","receivedAt":"2016-03-22T17:42:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Windows, the backslash is the native directory separator, but all\nsupported Windows versions also accept the forward slash in most\ncircumstances.\n\nOur tests expect forward slashes.\n\nRelative paths are generated by Git using forward slashes.\n\nSo let's try to be consistent and use forward slashes in the $HOME part\nof the paths reported by `git config --show-origin`, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/mingw.h | 6 ++++++\n path.c         | 3 +++\n 2 files changed, 9 insertions(+)\n\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex 8c5bf50..c008694 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -396,6 +396,12 @@ static inline char *mingw_find_last_dir_sep(const char *path)\n \t\t\tret = (char *)path;\n \treturn ret;\n }\n+static inline void convert_slashes(char *path)\n+{\n+\tfor (; *path; path++)\n+\t\tif (*path == '\\\\')\n+\t\t\t*path = '/';\n+}\n #define find_last_dir_sep mingw_find_last_dir_sep\n int mingw_offset_1st_component(const char *path);\n #define offset_1st_component mingw_offset_1st_component\ndiff --git a/path.c b/path.c\nindex 8b7e168..969b494 100644\n--- a/path.c\n+++ b/path.c\n@@ -584,6 +584,9 @@ char *expand_user_path(const char *path)\n \t\t\tif (!home)\n \t\t\t\tgoto return_null;\n \t\t\tstrbuf_addstr(&user_path, home);\n+#ifdef GIT_WINDOWS_NATIVE\n+\t\t\tconvert_slashes(user_path.buf);\n+#endif\n \t\t} else {\n \t\t\tstruct passwd *pw = getpw_str(username, username_len);\n \t\t\tif (!pw)\n-- \n2.7.4.windows.1\n"},{"id":"281448","messageId":"b4df45088aa68d8410895f66a814dd6780e2e451.1458668543.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458668543.git.johannes.schindelin@gmx.de","subject":"[PATCH 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-22T17:42:49Z","receivedAt":"2016-03-22T17:42:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"One of this developer's primary tools to diagnose broken regression\ntests is to run the test script using 'sh -x t... -i -v' to find out\n*which* call *actually* demonstrates the symptom.\n\nHence it is pretty counterproductive if the test script behaves\ndifferently when being run via 'sh -x', in particular when using\ntest_cmp or test_i18ncmp on redirected stderr.\n\nSo let's use grep instead of test_cmp/test_i18ncmp to verify that stderr\nlooks as expected.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t1300-repo-config.sh | 8 ++------\n 1 file changed, 2 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 8867ce1..0236fe2 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -699,17 +699,13 @@ test_expect_success 'invalid unit' '\n \techo 1auto >expect &&\n \tgit config aninvalid.unit >actual &&\n \ttest_cmp expect actual &&\n-\tcat >expect <<-\\EOF &&\n-\tfatal: bad numeric config value '\\''1auto'\\'' for '\\''aninvalid.unit'\\'' in file .git/config: invalid unit\n-\tEOF\n \ttest_must_fail git config --int --get aninvalid.unit 2>actual &&\n-\ttest_i18ncmp expect actual\n+\tgrep \"^fatal: bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit$\" actual\n '\n \n test_expect_success 'invalid stdin config' '\n-\techo \"fatal: bad config line 1 in standard input \" >expect &&\n \techo \"[broken\" | test_must_fail git config --list --file - >output 2>&1 &&\n-\ttest_cmp expect output\n+\tgrep \"^fatal: bad config line 1 in standard input $\" output\n '\n \n cat > expect << EOF\n-- \n2.7.4.windows.1\n"},{"id":"281450","messageId":"a43d6d1f46a90eea9083f329ad0dfb17915c38a1.1458668543.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458668543.git.johannes.schindelin@gmx.de","subject":"[PATCH 3/4] t1300: fix the new --show-origin tests on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-22T17:42:55Z","receivedAt":"2016-03-22T17:42:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Windows, we have that funny situation where the test script can refer\nto POSIX paths because it runs in a shell that uses a POSIX emulation\nlayer (\"MSYS2 runtime\"). Yet, git.exe does *not* understand POSIX paths\nat all but only pure Windows paths.\n\nSo let's just convert the POSIX paths to Windows paths before passing\nthem on to Git, using `pwd` (which is already modified on Windows to\noutput Windows paths).\n\nWhile fixing the new tests on Windows, we also have to exclude the tests\nthat want to write a file with a name that is illegal on Windows\n(unfortunately, there is more than one test trying to make use of that\nfile).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t1300-repo-config.sh | 15 ++++++++++++---\n 1 file changed, 12 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 0236fe2..18eb769 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -1232,6 +1232,15 @@ test_expect_success 'set up --show-origin tests' '\n \tEOF\n '\n \n+if test_have_prereq MINGW\n+then\n+\t# convert to Windows paths\n+\tHOME=\"$(pwd)\"\n+\tINCLUDE_DIR=\"$HOME/include\"\n+\texport HOME INCLUDE_DIR\n+\tgit config -f .gitconfig include.path \"$INCLUDE_DIR/absolute.include\"\n+fi\n+\n test_expect_success '--show-origin with --list' '\n \tcat >expect <<-EOF &&\n \t\tfile:$HOME/.gitconfig\tuser.global=true\n@@ -1304,7 +1313,7 @@ test_expect_success 'set up custom config file' '\n \tEOF\n '\n \n-test_expect_success '--show-origin escape special file name characters' '\n+test_expect_success !MINGW '--show-origin escape special file name characters' '\n \tcat >expect <<-\\EOF &&\n \t\tfile:\"file\\\" (dq) and spaces.conf\"\tuser.custom=true\n \tEOF\n@@ -1333,7 +1342,7 @@ test_expect_success '--show-origin stdin with file include' '\n \ttest_cmp expect output\n '\n \n-test_expect_success '--show-origin blob' '\n+test_expect_success !MINGW '--show-origin blob' '\n \tcat >expect <<-\\EOF &&\n \t\tblob:a9d9f9e555b5c6f07cbe09d3f06fe3df11e09c08\tuser.custom=true\n \tEOF\n@@ -1342,7 +1351,7 @@ test_expect_success '--show-origin blob' '\n \ttest_cmp expect output\n '\n \n-test_expect_success '--show-origin blob ref' '\n+test_expect_success !MINGW '--show-origin blob ref' '\n \tcat >expect <<-\\EOF &&\n \t\tblob:\"master:file\\\" (dq) and spaces.conf\"\tuser.custom=true\n \tEOF\n-- \n2.7.4.windows.1\n"},{"id":"281449","messageId":"7b4eca83305ec05af6434ff80269ba563f2d581d.1458668543.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458668543.git.johannes.schindelin@gmx.de","subject":"[PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-22T17:43:00Z","receivedAt":"2016-03-22T17:43:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"These two tests wanted to write file names which are incompatible with\nWindows' file naming rules.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t9115-git-svn-dcommit-funky-renames.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex 0990f8d..864395e 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -93,7 +93,7 @@ test_expect_success 'git svn rebase works inside a fresh-cloned repository' '\n # > to special UNICODE characters in the range 0xf000 to 0xf0ff (the\n # > \"Private use area\") when creating or accessing files.\n prepare_a_utf8_locale\n-test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n+test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit' '\n \tLC_ALL=$a_utf8_locale &&\n \texport LC_ALL &&\n \tneq=$(printf \"\\201\\202\") &&\n@@ -105,7 +105,7 @@ test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n '\n \n # See the comment on the above test for setting of LC_ALL.\n-test_expect_success 'svn.pathnameencoding=cp932 rename on dcommit' '\n+test_expect_success !MINGW 'svn.pathnameencoding=cp932 rename on dcommit' '\n \tLC_ALL=$a_utf8_locale &&\n \texport LC_ALL &&\n \tinf=$(printf \"\\201\\207\") &&\n-- \n2.7.4.windows.1\n"},{"id":"281455","messageId":"xmqqfuviieq4.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"cover.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 0/4] Git for Windows fixes in preparation for 2.8.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-22T17:50:43Z","receivedAt":"2016-03-22T17:50:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> The t1300 and t9115 tests regressed on Windows. These patches fix that.\n\nThanks, it might be probably too late for 2.8.0 final to do\nback-and-forth reviews, but lets see how it goes.\n\n\n>\n>\n> Johannes Schindelin (4):\n>   config --show-origin: report paths with forward slashes\n>   Make t1300-repo-config resilient to being run via 'sh -x'\n>   t1300: fix the new --show-origin tests on Windows\n>   mingw: skip some tests in t9115 due to file name issues\n>\n>  compat/mingw.h                           |  6 ++++++\n>  path.c                                   |  3 +++\n>  t/t1300-repo-config.sh                   | 23 ++++++++++++++---------\n>  t/t9115-git-svn-dcommit-funky-renames.sh |  4 ++--\n>  4 files changed, 25 insertions(+), 11 deletions(-)\n"},{"id":"281457","messageId":"xmqqbn66iedh.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"8beb1c208e33e1de8f272caa22fb7a0b662ca4cc.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-22T17:58:18Z","receivedAt":"2016-03-22T17:58:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> On Windows, the backslash is the native directory separator, but\n> all supported Windows versions also accept the forward slash in\n> most circumstances.\n>\n> Our tests expect forward slashes.\n>\n> Relative paths are generated by Git using forward slashes.\n\n... and the paths tracked by Git (in the index) use slashes.\n\n> So let's try to be consistent and use forward slashes in the $HOME\n> part of the paths reported by `git config --show-origin`, too.\n\nOK, sounds sensible.\n\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  compat/mingw.h | 6 ++++++\n>  path.c         | 3 +++\n>  2 files changed, 9 insertions(+)\n>\n> diff --git a/compat/mingw.h b/compat/mingw.h\n> index 8c5bf50..c008694 100644\n> --- a/compat/mingw.h\n> +++ b/compat/mingw.h\n> @@ -396,6 +396,12 @@ static inline char *mingw_find_last_dir_sep(const char *path)\n>  \t\t\tret = (char *)path;\n>  \treturn ret;\n>  }\n> +static inline void convert_slashes(char *path)\n> +{\n> +\tfor (; *path; path++)\n> +\t\tif (*path == '\\\\')\n> +\t\t\t*path = '/';\n> +}\n>  #define find_last_dir_sep mingw_find_last_dir_sep\n>  int mingw_offset_1st_component(const char *path);\n>  #define offset_1st_component mingw_offset_1st_component\n> diff --git a/path.c b/path.c\n> index 8b7e168..969b494 100644\n> --- a/path.c\n> +++ b/path.c\n> @@ -584,6 +584,9 @@ char *expand_user_path(const char *path)\n>  \t\t\tif (!home)\n>  \t\t\t\tgoto return_null;\n>  \t\t\tstrbuf_addstr(&user_path, home);\n> +#ifdef GIT_WINDOWS_NATIVE\n> +\t\t\tconvert_slashes(user_path.buf);\n> +#endif\n\nHmm, I wonder if we want to do this at a bit lower level, e.g.\n\n    1. have a fallback for other platforms in git-compat-util.h\n\n    #ifndef get_HOME\n    #define get_HOME() getenv(\"HOME\")\n    #endif\n\n    2. have the one that does convert-slashes for mingw\n\n    static inline const char *mingw_getenv_HOME(void) {\n    \t... do convert-slashes on the result of getenv(\"HOME\");\n    }\n    #define get_HOME() mingw_getenv_HOME()\n\n    3. Instead of the above patch to path.c, change the line before\n       the precontext with s/getenv(\"HOME\")/get_HOME()/\n\nOr even lower, inside mingw_getenv() and catch variables that deal\nwith paths (not just HOME but PATH, TMP, TMPDIR, etc.)\n\n>  \t\t} else {\n>  \t\t\tstruct passwd *pw = getpw_str(username, username_len);\n>  \t\t\tif (!pw)\n"},{"id":"281460","messageId":"20160322175948.GG28749@google.com","threadId":"41782","inReplyTo":"b4df45088aa68d8410895f66a814dd6780e2e451.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2016-03-22T17:59:48Z","receivedAt":"2016-03-22T17:59:48Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n\n> --- a/t/t1300-repo-config.sh\n> +++ b/t/t1300-repo-config.sh\n> @@ -699,17 +699,13 @@ test_expect_success 'invalid unit' '\n>  \techo 1auto >expect &&\n>  \tgit config aninvalid.unit >actual &&\n>  \ttest_cmp expect actual &&\n> -\tcat >expect <<-\\EOF &&\n> -\tfatal: bad numeric config value '\\''1auto'\\'' for '\\''aninvalid.unit'\\'' in file .git/config: invalid unit\n> -\tEOF\n>  \ttest_must_fail git config --int --get aninvalid.unit 2>actual &&\n> -\ttest_i18ncmp expect actual\n> +\tgrep \"^fatal: bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit$\" actual\n\nWould test_i18ngrep work?\n\n>  '\n>  \n>  test_expect_success 'invalid stdin config' '\n> -\techo \"fatal: bad config line 1 in standard input \" >expect &&\n>  \techo \"[broken\" | test_must_fail git config --list --file - >output 2>&1 &&\n> -\ttest_cmp expect output\n> +\tgrep \"^fatal: bad config line 1 in standard input $\" output\n\nThis test is very strange.  Why do we care that it starts with\n\"fatal:\" as opposed to error?  Why are we testing for an extra space at\nthe end of the line?\n\nI would expect something like\n\n\ttest_i18ngrep 'line 1 in standard input' output\n\nto be more useful for testing the useful part of the error message while\nremaining resilient against error message changes.\n\nThanks,\nJonathan\n"},{"id":"281461","messageId":"xmqq7fguie7t.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"b4df45088aa68d8410895f66a814dd6780e2e451.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-22T18:01:42Z","receivedAt":"2016-03-22T18:01:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> One of this developer's primary tools to diagnose broken regression\n> tests is to run the test script using 'sh -x t... -i -v' to find out\n> *which* call *actually* demonstrates the symptom.\n>\n> Hence it is pretty counterproductive if the test script behaves\n> differently when being run via 'sh -x', in particular when using\n> test_cmp or test_i18ncmp on redirected stderr.\n>\n> So let's use grep instead of test_cmp/test_i18ncmp to verify that stderr\n> looks as expected.\n\nIn the modern world, I would probably described the problem as\n\"tXXXX -i -v -x\", though, not \"sh -x tXXXX\", but they both exhibit\nthe same symptom.\n\nI wonder if \"tXXXX -i -v -x\" can be made not to contaminate the\nstandard error stream of the test, but that would be a larger change\nwe probably would not have time for 2.8 final anyway.\n\nWill queue.  Thanks.\n\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/t1300-repo-config.sh | 8 ++------\n>  1 file changed, 2 insertions(+), 6 deletions(-)\n>\n> diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\n> index 8867ce1..0236fe2 100755\n> --- a/t/t1300-repo-config.sh\n> +++ b/t/t1300-repo-config.sh\n> @@ -699,17 +699,13 @@ test_expect_success 'invalid unit' '\n>  \techo 1auto >expect &&\n>  \tgit config aninvalid.unit >actual &&\n>  \ttest_cmp expect actual &&\n> -\tcat >expect <<-\\EOF &&\n> -\tfatal: bad numeric config value '\\''1auto'\\'' for '\\''aninvalid.unit'\\'' in file .git/config: invalid unit\n> -\tEOF\n>  \ttest_must_fail git config --int --get aninvalid.unit 2>actual &&\n> -\ttest_i18ncmp expect actual\n> +\tgrep \"^fatal: bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit$\" actual\n>  '\n>  \n>  test_expect_success 'invalid stdin config' '\n> -\techo \"fatal: bad config line 1 in standard input \" >expect &&\n>  \techo \"[broken\" | test_must_fail git config --list --file - >output 2>&1 &&\n> -\ttest_cmp expect output\n> +\tgrep \"^fatal: bad config line 1 in standard input $\" output\n>  '\n>  \n>  cat > expect << EOF\n"},{"id":"281462","messageId":"20160322180337.GH28749@google.com","threadId":"41782","inReplyTo":"7b4eca83305ec05af6434ff80269ba563f2d581d.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2016-03-22T18:03:37Z","receivedAt":"2016-03-22T18:03:37Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n\n> These two tests wanted to write file names which are incompatible with\n> Windows' file naming rules.\n\nMakes sense.  Ideally these would use the FUNNYNAMES prereq which\nwould be factored out as a lazy prereq from t3600, t4135, and t9903.\nBut using !MINGW is simpler and works now.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n"},{"id":"281463","messageId":"xmqq37riidow.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"a43d6d1f46a90eea9083f329ad0dfb17915c38a1.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 3/4] t1300: fix the new --show-origin tests on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-22T18:13:03Z","receivedAt":"2016-03-22T18:13:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> On Windows, we have that funny situation where the test script can refer\n> to POSIX paths because it runs in a shell that uses a POSIX emulation\n> layer (\"MSYS2 runtime\"). Yet, git.exe does *not* understand POSIX paths\n> at all but only pure Windows paths.\n>\n> So let's just convert the POSIX paths to Windows paths before passing\n> them on to Git, using `pwd` (which is already modified on Windows to\n> output Windows paths).\n>\n> While fixing the new tests on Windows, we also have to exclude the tests\n> that want to write a file with a name that is illegal on Windows\n> (unfortunately, there is more than one test trying to make use of that\n> file).\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/t1300-repo-config.sh | 15 ++++++++++++---\n>  1 file changed, 12 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\n> index 0236fe2..18eb769 100755\n> --- a/t/t1300-repo-config.sh\n> +++ b/t/t1300-repo-config.sh\n> @@ -1232,6 +1232,15 @@ test_expect_success 'set up --show-origin tests' '\n>  \tEOF\n>  '\n>  \n> +if test_have_prereq MINGW\n> +then\n> +\t# convert to Windows paths\n> +\tHOME=\"$(pwd)\"\n\nWe override HOME in t/test-lib.sh; shouldn't this be done there?\n\n> +\tINCLUDE_DIR=\"$HOME/include\"\n\nI am puzzled. 'set up --show-origin tests' do say INCLUDE_DIR is\n\"$HOME/include\" already, so why is this needed?\n\n> +\texport HOME INCLUDE_DIR\n\nExisting tests use $INCLUDE_DIR (and $HOME) as shell variables just\nfine without exporting.  Why do these need to be exported only on\nMINGW?\n\n> +\tgit config -f .gitconfig include.path \"$INCLUDE_DIR/absolute.include\"\n> +fi\n\nPerhaps if you adjust HOME before 'set up --show-origin tests' test,\nmost (or all) of the above become unnecessary?\n\nThe changes below that skip tests that relies on pathnames that\ncannot be used on Windows makes sense, though.\n\n>  test_expect_success '--show-origin with --list' '\n>  \tcat >expect <<-EOF &&\n>  \t\tfile:$HOME/.gitconfig\tuser.global=true\n> @@ -1304,7 +1313,7 @@ test_expect_success 'set up custom config file' '\n>  \tEOF\n>  '\n>  \n> -test_expect_success '--show-origin escape special file name characters' '\n> +test_expect_success !MINGW '--show-origin escape special file name characters' '\n>  \tcat >expect <<-\\EOF &&\n>  \t\tfile:\"file\\\" (dq) and spaces.conf\"\tuser.custom=true\n>  \tEOF\n> @@ -1333,7 +1342,7 @@ test_expect_success '--show-origin stdin with file include' '\n>  \ttest_cmp expect output\n>  '\n>  \n> -test_expect_success '--show-origin blob' '\n> +test_expect_success !MINGW '--show-origin blob' '\n>  \tcat >expect <<-\\EOF &&\n>  \t\tblob:a9d9f9e555b5c6f07cbe09d3f06fe3df11e09c08\tuser.custom=true\n>  \tEOF\n> @@ -1342,7 +1351,7 @@ test_expect_success '--show-origin blob' '\n>  \ttest_cmp expect output\n>  '\n>  \n> -test_expect_success '--show-origin blob ref' '\n> +test_expect_success !MINGW '--show-origin blob ref' '\n>  \tcat >expect <<-\\EOF &&\n>  \t\tblob:\"master:file\\\" (dq) and spaces.conf\"\tuser.custom=true\n>  \tEOF\n"},{"id":"281465","messageId":"56F18F5E.9090301@web.de","threadId":"41782","inReplyTo":"7b4eca83305ec05af6434ff80269ba563f2d581d.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-22T18:30:54Z","receivedAt":"2016-03-22T18:30:54Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2016-03-22 18.43, Johannes Schindelin wrote:\n> These two tests wanted to write file names which are incompatible with\n> Windows' file naming rules.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIs there a chance to squeeze in a precondition for HFS under Mac OS ?\n> -test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n> +test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit' '\n+test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC\n\n>  \tLC_ALL=$a_utf8_locale &&\n>  \texport LC_ALL &&\n>  \tneq=$(printf \"\\201\\202\") &&\n> @@ -105,7 +105,7 @@ test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n>  '\n>  \n>  # See the comment on the above test for setting of LC_ALL.\n> -test_expect_success 'svn.pathnameencoding=cp932 rename on dcommit' '\n> +test_expect_success !MINGW 'svn.pathnameencoding=cp932 rename on dcommit' '\nAnd the same protection for HFS here.\n\nQuestion: Why do we need a UTF8 protection in #11, but not in #12 ?\n\n\n\nI just tested t9115 under german cygwin, passes.\n\nhttp://article.gmane.org/gmane.comp.version-control.git/288827\n"},{"id":"281480","messageId":"xmqqfuvigsl6.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"20160322175948.GG28749@google.com","subject":"Re: [PATCH 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-22T20:34:13Z","receivedAt":"2016-03-22T20:34:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Johannes Schindelin wrote:\n>\n>> --- a/t/t1300-repo-config.sh\n>> +++ b/t/t1300-repo-config.sh\n>> @@ -699,17 +699,13 @@ test_expect_success 'invalid unit' '\n>>  \techo 1auto >expect &&\n>>  \tgit config aninvalid.unit >actual &&\n>>  \ttest_cmp expect actual &&\n>> -\tcat >expect <<-\\EOF &&\n>> -\tfatal: bad numeric config value '\\''1auto'\\'' for '\\''aninvalid.unit'\\'' in file .git/config: invalid unit\n>> -\tEOF\n>>  \ttest_must_fail git config --int --get aninvalid.unit 2>actual &&\n>> -\ttest_i18ncmp expect actual\n>> +\tgrep \"^fatal: bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit$\" actual\n>\n> Would test_i18ngrep work?\n>\n>>  '\n>>  \n>>  test_expect_success 'invalid stdin config' '\n>> -\techo \"fatal: bad config line 1 in standard input \" >expect &&\n>>  \techo \"[broken\" | test_must_fail git config --list --file - >output 2>&1 &&\n>> -\ttest_cmp expect output\n>> +\tgrep \"^fatal: bad config line 1 in standard input $\" output\n>\n> This test is very strange.  Why do we care that it starts with\n> \"fatal:\" as opposed to error?  Why are we testing for an extra space at\n> the end of the line?\n>\n> I would expect something like\n>\n> \ttest_i18ngrep 'line 1 in standard input' output\n>\n> to be more useful for testing the useful part of the error message while\n> remaining resilient against error message changes.\n\nBoth sounds sensible.  Should we squash this in, then?\n\n t/t1300-repo-config.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 0236fe2..dca27a3 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -700,12 +700,12 @@ test_expect_success 'invalid unit' '\n \tgit config aninvalid.unit >actual &&\n \ttest_cmp expect actual &&\n \ttest_must_fail git config --int --get aninvalid.unit 2>actual &&\n-\tgrep \"^fatal: bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit$\" actual\n+\ttest_i18ngrep \"bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit\" actual\n '\n \n test_expect_success 'invalid stdin config' '\n \techo \"[broken\" | test_must_fail git config --list --file - >output 2>&1 &&\n-\tgrep \"^fatal: bad config line 1 in standard input $\" output\n+\ttest_i18ngrep \"bad config line 1 in standard input\" output\n '\n \n cat > expect << EOF\n"},{"id":"281482","messageId":"xmqqbn66gs4k.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"56F18F5E.9090301@web.de","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-22T20:44:11Z","receivedAt":"2016-03-22T20:44:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> On 2016-03-22 18.43, Johannes Schindelin wrote:\n>> These two tests wanted to write file names which are incompatible with\n>> Windows' file naming rules.\n>> \n>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> Is there a chance to squeeze in a precondition for HFS under Mac OS ?\n\nSo you want this squashed into it?\n\n t/t9115-git-svn-dcommit-funky-renames.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex 864395e..a87d3d3 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -93,7 +93,7 @@ test_expect_success 'git svn rebase works inside a fresh-cloned repository' '\n # > to special UNICODE characters in the range 0xf000 to 0xf0ff (the\n # > \"Private use area\") when creating or accessing files.\n prepare_a_utf8_locale\n-test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit' '\n+test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 new file on dcommit' '\n \tLC_ALL=$a_utf8_locale &&\n \texport LC_ALL &&\n \tneq=$(printf \"\\201\\202\") &&\n@@ -105,7 +105,7 @@ test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit'\n '\n \n # See the comment on the above test for setting of LC_ALL.\n-test_expect_success !MINGW 'svn.pathnameencoding=cp932 rename on dcommit' '\n+test_expect_success !MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 rename on dcommit' '\n \tLC_ALL=$a_utf8_locale &&\n \texport LC_ALL &&\n \tinf=$(printf \"\\201\\207\") &&\n"},{"id":"281508","messageId":"56F1CACA.5040709@web.de","threadId":"41782","inReplyTo":"xmqqbn66gs4k.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-22T22:44:26Z","receivedAt":"2016-03-22T22:44:26Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2016-03-22 21.44, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>> On 2016-03-22 18.43, Johannes Schindelin wrote:\n>>> These two tests wanted to write file names which are incompatible with\n>>> Windows' file naming rules.\n>>>\n>>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>\n>> Is there a chance to squeeze in a precondition for HFS under Mac OS ?\n> \n> So you want this squashed into it?\nYes, please.\n> \n>  t/t9115-git-svn-dcommit-funky-renames.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\n> index 864395e..a87d3d3 100755\n> --- a/t/t9115-git-svn-dcommit-funky-renames.sh\n> +++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n> @@ -93,7 +93,7 @@ test_expect_success 'git svn rebase works inside a fresh-cloned repository' '\n>  # > to special UNICODE characters in the range 0xf000 to 0xf0ff (the\n>  # > \"Private use area\") when creating or accessing files.\n>  prepare_a_utf8_locale\n> -test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit' '\n> +test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 new file on dcommit' '\n>  \tLC_ALL=$a_utf8_locale &&\n>  \texport LC_ALL &&\n>  \tneq=$(printf \"\\201\\202\") &&\n> @@ -105,7 +105,7 @@ test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit'\n>  '\n>  \n>  # See the comment on the above test for setting of LC_ALL.\n> -test_expect_success !MINGW 'svn.pathnameencoding=cp932 rename on dcommit' '\n> +test_expect_success !MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 rename on dcommit' '\n>  \tLC_ALL=$a_utf8_locale &&\n>  \texport LC_ALL &&\n>  \tinf=$(printf \"\\201\\207\") &&\n"},{"id":"281510","messageId":"xmqqtwjydsub.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"56F1CACA.5040709@web.de","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-22T22:57:00Z","receivedAt":"2016-03-22T22:57:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> On 2016-03-22 21.44, Junio C Hamano wrote:\n>> Torsten Bögershausen <tboegi@web.de> writes:\n>> \n>>> On 2016-03-22 18.43, Johannes Schindelin wrote:\n>>>> These two tests wanted to write file names which are incompatible with\n>>>> Windows' file naming rules.\n>>>>\n>>>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>>\n>>> Is there a chance to squeeze in a precondition for HFS under Mac OS ?\n>> \n>> So you want this squashed into it?\n> Yes, please.\n\nDscho, I queued two out of these four, with a proposed fix-up patch\nfor each of them, on 'pu'; but I won't squash them together myself\nwithout hearing from you as I do not test mingw or macosx.\n\nThanks.\n"},{"id":"281512","messageId":"20160322234524.GJ28749@google.com","threadId":"41782","inReplyTo":"xmqqfuvigsl6.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2016-03-22T23:45:24Z","receivedAt":"2016-03-22T23:45:24Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> Both sounds sensible.  Should we squash this in, then?\n>\n>  t/t1300-repo-config.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n"},{"id":"281519","messageId":"56F22F85.3010507@web.de","threadId":"41782","inReplyTo":"xmqqtwjydsub.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-23T05:54:13Z","receivedAt":"2016-03-23T05:54:13Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2016-03-22 23.57, Junio C Hamano wrote:\n> Dscho, I queued two out of these four, with a proposed fix-up patch\n> for each of them, on 'pu'; but I won't squash them together myself\n> without hearing from you as I do not test mingw or macosx.\n> \n> Thanks.\n\nthe queued t9115 passes under Mac OS X (#11 and #12 are skipped as expected)\n\n----------------\nBeside that, do we want to amend the commit message like this:\n\nAuthor: Johannes Schindelin <johannes.schindelin@gmx.de>\nDate:   Tue Mar 22 18:43:00 2016 +0100\n\n    skip some tests in t9115 due to file name issues\n\n    These two tests wanted to write file names which work under Linux or\n    CYGWIN, but are incompatible with file naming rules under mingw or HFS.\n\n    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n    Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n    Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n----------------\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/285776/focus=287717\n"},{"id":"281521","messageId":"alpine.DEB.2.20.1603230820140.4690@virtualbox","threadId":"41782","inReplyTo":"20160322234524.GJ28749@google.com","subject":"Re: [PATCH 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T07:21:29Z","receivedAt":"2016-03-23T07:21:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 22 Mar 2016, Jonathan Nieder wrote:\n\n> Junio C Hamano wrote:\n> \n> > Both sounds sensible.  Should we squash this in, then?\n> >\n> >  t/t1300-repo-config.sh | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nSure, makes sense. That late in the 2.8.0 game I tried to err on the more\nfaithful side, hence I kept testing for \"fatal:\" but if you two are fine\nwith dropping it...\n\nCiao,\nDscho\n"},{"id":"281524","messageId":"alpine.DEB.2.20.1603230821420.4690@virtualbox","threadId":"41782","inReplyTo":"xmqqbn66iedh.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T08:20:27Z","receivedAt":"2016-03-23T08:20:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 22 Mar 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > On Windows, the backslash is the native directory separator, but\n> > all supported Windows versions also accept the forward slash in\n> > most circumstances.\n> >\n> > Our tests expect forward slashes.\n> >\n> > Relative paths are generated by Git using forward slashes.\n> \n> ... and the paths tracked by Git (in the index) use slashes.\n> \n> > So let's try to be consistent and use forward slashes in the $HOME\n> > part of the paths reported by `git config --show-origin`, too.\n> \n> OK, sounds sensible.\n> \n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  compat/mingw.h | 6 ++++++\n> >  path.c         | 3 +++\n> >  2 files changed, 9 insertions(+)\n> >\n> > diff --git a/compat/mingw.h b/compat/mingw.h\n> > index 8c5bf50..c008694 100644\n> > --- a/compat/mingw.h\n> > +++ b/compat/mingw.h\n> > @@ -396,6 +396,12 @@ static inline char *mingw_find_last_dir_sep(const char *path)\n> >  \t\t\tret = (char *)path;\n> >  \treturn ret;\n> >  }\n> > +static inline void convert_slashes(char *path)\n> > +{\n> > +\tfor (; *path; path++)\n> > +\t\tif (*path == '\\\\')\n> > +\t\t\t*path = '/';\n> > +}\n> >  #define find_last_dir_sep mingw_find_last_dir_sep\n> >  int mingw_offset_1st_component(const char *path);\n> >  #define offset_1st_component mingw_offset_1st_component\n> > diff --git a/path.c b/path.c\n> > index 8b7e168..969b494 100644\n> > --- a/path.c\n> > +++ b/path.c\n> > @@ -584,6 +584,9 @@ char *expand_user_path(const char *path)\n> >  \t\t\tif (!home)\n> >  \t\t\t\tgoto return_null;\n> >  \t\t\tstrbuf_addstr(&user_path, home);\n> > +#ifdef GIT_WINDOWS_NATIVE\n> > +\t\t\tconvert_slashes(user_path.buf);\n> > +#endif\n> \n> Hmm, I wonder if we want to do this at a bit lower level,\n\nWell, I tried to be careful. There *are* circumstamces when backslashes\nare required (CreateProcess() comes to mind), so I wanted to have this\nconversion as much only in the user-visible output as possible.\n\n> e.g.\n> \n>     1. have a fallback for other platforms in git-compat-util.h\n> \n>     #ifndef get_HOME\n>     #define get_HOME() getenv(\"HOME\")\n>     #endif\n\nOnce upon a time, I had something like that (without the ugly uppercase,\nto account for the fact that Windows has no single HOME setting):\n\n\thttp://thread.gmane.org/gmane.comp.version-control.msysgit/20339\n\n>     2. have the one that does convert-slashes for mingw\n> \n>     static inline const char *mingw_getenv_HOME(void) {\n>     \t... do convert-slashes on the result of getenv(\"HOME\");\n>     }\n>     #define get_HOME() mingw_getenv_HOME()\n\nWe could do that much easier now:\n\n-- snip --\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 54c82ec..96022b7 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -2117,6 +2117,12 @@ static void setup_windows_environment()\n \t\t\t\t*tmp = '/';\n \t}\n \n+\ttmp = getenv(\"HOME\");\n+\tif (tmp)\n+\t\tfor (; *tmp; tmp++)\n+\t\t\tif (*tmp == '\\\\')\n+\t\t\t\t*tmp = '/';\n+\n \t/* simulate TERM to enable auto-color (see color.c) */\n \tif (!getenv(\"TERM\"))\n \t\tsetenv(\"TERM\", \"cygwin\", 1);\n-- snap --\n\nBut again, I am uncomfortable to do this wholesale without having the time\nto do anything quickly about unintended side effects.\n\n\n>     3. Instead of the above patch to path.c, change the line before\n>        the precontext with s/getenv(\"HOME\")/get_HOME()/\n> \n> Or even lower, inside mingw_getenv() and catch variables that deal\n> with paths (not just HOME but PATH, TMP, TMPDIR, etc.)\n\nThat outright scares me. Don't do that.\n\n:-)\n\nAgain, just to make sure my point is heard: there *are* circumstances when\nthe Win32 API expects backslashes and cannot handle forward ones. I would\nnot dare to claim to be an expert in that matter, so I would rather want\nto err on the side of converting backslashes to forward slashes *only*\nwhen really needed.\n\nCiao,\nDscho\n"},{"id":"281525","messageId":"alpine.DEB.2.20.1603230921160.4690@virtualbox","threadId":"41782","inReplyTo":"xmqq7fguie7t.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T08:22:32Z","receivedAt":"2016-03-23T08:22:32Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 22 Mar 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > One of this developer's primary tools to diagnose broken regression\n> > tests is to run the test script using 'sh -x t... -i -v' to find out\n> > *which* call *actually* demonstrates the symptom.\n> >\n> > Hence it is pretty counterproductive if the test script behaves\n> > differently when being run via 'sh -x', in particular when using\n> > test_cmp or test_i18ncmp on redirected stderr.\n> >\n> > So let's use grep instead of test_cmp/test_i18ncmp to verify that stderr\n> > looks as expected.\n> \n> In the modern world, I would probably described the problem as\n> \"tXXXX -i -v -x\", though, not \"sh -x tXXXX\", but they both exhibit\n> the same symptom.\n\nThanks for pointing me to -i -v -x. The introduction of the RHS -x somehow\nslipped by me.\n\n> I wonder if \"tXXXX -i -v -x\" can be made not to contaminate the\n> standard error stream of the test, but that would be a larger change\n> we probably would not have time for 2.8 final anyway.\n\nAgree, both on \"we want to have this\" and \"after 2.8\".\n\nCiao,\nDscho\n"},{"id":"281562","messageId":"alpine.DEB.2.20.1603230923030.4690@virtualbox","threadId":"41782","inReplyTo":"xmqq37riidow.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 3/4] t1300: fix the new --show-origin tests on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T10:42:19Z","receivedAt":"2016-03-23T10:42:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 22 Mar 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > On Windows, we have that funny situation where the test script can refer\n> > to POSIX paths because it runs in a shell that uses a POSIX emulation\n> > layer (\"MSYS2 runtime\"). Yet, git.exe does *not* understand POSIX paths\n> > at all but only pure Windows paths.\n> >\n> > So let's just convert the POSIX paths to Windows paths before passing\n> > them on to Git, using `pwd` (which is already modified on Windows to\n> > output Windows paths).\n> >\n> > While fixing the new tests on Windows, we also have to exclude the tests\n> > that want to write a file with a name that is illegal on Windows\n> > (unfortunately, there is more than one test trying to make use of that\n> > file).\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  t/t1300-repo-config.sh | 15 ++++++++++++---\n> >  1 file changed, 12 insertions(+), 3 deletions(-)\n> >\n> > diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\n> > index 0236fe2..18eb769 100755\n> > --- a/t/t1300-repo-config.sh\n> > +++ b/t/t1300-repo-config.sh\n> > @@ -1232,6 +1232,15 @@ test_expect_success 'set up --show-origin tests' '\n> >  \tEOF\n> >  '\n> >  \n> > +if test_have_prereq MINGW\n> > +then\n> > +\t# convert to Windows paths\n> > +\tHOME=\"$(pwd)\"\n> \n> We override HOME in t/test-lib.sh; shouldn't this be done there?\n\nWe override it with $PWD.\n\nRemember, on Windows we have this funny situation where the shell,\nPerl, and the Unix tools used in scripting, know about POSIX paths, but\nlittle else. Most notably git.exe does *not* understand them [*1*].\n\nThe difference between $PWD and $(pwd) is, you guessed it, POSIX path vs\nWindows path, respectively. And since *some* of our tests verify\nshell/Perl scripts' correct behavior, we *want* $HOME to be a POSIX path,\nat least some of the time.\n\n> > +\tINCLUDE_DIR=\"$HOME/include\"\n> \n> I am puzzled. 'set up --show-origin tests' do say INCLUDE_DIR is\n> \"$HOME/include\" already, so why is this needed?\n> \n> > +\texport HOME INCLUDE_DIR\n> \n> Existing tests use $INCLUDE_DIR (and $HOME) as shell variables just\n> fine without exporting.  Why do these need to be exported only on\n> MINGW?\n\nHabit. The export is actually not needed at all, you are totally correct.\n\n> > +\tgit config -f .gitconfig include.path \"$INCLUDE_DIR/absolute.include\"\n> > +fi\n> \n> Perhaps if you adjust HOME before 'set up --show-origin tests' test,\n> most (or all) of the above become unnecessary?\n\nIt did not even occur to me, thanks for that suggestion. It works\nperfectly. Will send out v2 in a moment.\n\nCiao,\nDscho\n\nFootnote [*1*]: we do have this hack, system_path(), that can turn \"POSIX\npaths\" into Windows paths. However, it actually turns paths relative to\nthe prefix (as in \"/usr/\") into Windows paths, and the prefix is\ndetermined at runtime, from the location of git.exe. When the test suite\nruns, the location of git.exe is most definitely *not* related to any\nsensible prefix, therefore we simply cannot expect git.exe to handle POSIX\npaths correctly in the test suite.\n"},{"id":"281563","messageId":"alpine.DEB.2.20.1603231148510.4690@virtualbox","threadId":"41782","inReplyTo":"56F22F85.3010507@web.de","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T10:49:49Z","receivedAt":"2016-03-23T10:49:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio & Torsten,\n\nOn Wed, 23 Mar 2016, Torsten Bögershausen wrote:\n\n> On 2016-03-22 23.57, Junio C Hamano wrote:\n> > Dscho, I queued two out of these four, with a proposed fix-up patch\n> > for each of them, on 'pu'; but I won't squash them together myself\n> > without hearing from you as I do not test mingw or macosx.\n\nThe suggested changes will be squashed into v2.\n\n> Beside that, do we want to amend the commit message like this:\n> \n> Author: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Date:   Tue Mar 22 18:43:00 2016 +0100\n> \n>     skip some tests in t9115 due to file name issues\n> \n>     These two tests wanted to write file names which work under Linux or\n>     CYGWIN, but are incompatible with file naming rules under mingw or HFS.\n> \n>     Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>     Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>     Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nThanks, I used a slightly different version, as I had crafted it before\nreading this mail already.\n\nCiao,\nDscho"},{"id":"281564","messageId":"cover.1458730457.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458668543.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 0/4] Git for Windows fixes in preparation for 2.8.0","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T10:54:53Z","receivedAt":"2016-03-23T10:54:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The t1300 and t9115 tests regressed on Windows. These patches fix that.\n\n\nJohannes Schindelin (4):\n  config --show-origin: report paths with forward slashes\n  Make t1300-repo-config resilient to being run via 'sh -x'\n  t1300: fix the new --show-origin tests on Windows\n  mingw: skip some tests in t9115 due to file name issues\n\n compat/mingw.h                           |  6 ++++++\n path.c                                   |  3 +++\n t/t1300-repo-config.sh                   | 18 +++++++++---------\n t/t9115-git-svn-dcommit-funky-renames.sh |  4 ++--\n 4 files changed, 20 insertions(+), 11 deletions(-)\n\nInterdiff vs v1:\n\n diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\n index 18eb769..a37ebb2 100755\n --- a/t/t1300-repo-config.sh\n +++ b/t/t1300-repo-config.sh\n @@ -700,12 +700,12 @@ test_expect_success 'invalid unit' '\n  \tgit config aninvalid.unit >actual &&\n  \ttest_cmp expect actual &&\n  \ttest_must_fail git config --int --get aninvalid.unit 2>actual &&\n -\tgrep \"^fatal: bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit$\" actual\n +\ttest_i18ngrep \"bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit\" actual\n  '\n  \n  test_expect_success 'invalid stdin config' '\n  \techo \"[broken\" | test_must_fail git config --list --file - >output 2>&1 &&\n -\tgrep \"^fatal: bad config line 1 in standard input $\" output\n +\ttest_i18ngrep \"bad config line 1 in standard input\" output\n  '\n  \n  cat > expect << EOF\n @@ -1205,6 +1205,9 @@ test_expect_success POSIXPERM,PERL 'preserves existing permissions' '\n  \t  \"die q(badrename) if ((stat(q(.git/config)))[2] & 07777) != 0600\"\n  '\n  \n +! test_have_prereq MINGW ||\n +HOME=\"$(pwd)\" # convert to Windows path\n +\n  test_expect_success 'set up --show-origin tests' '\n  \tINCLUDE_DIR=\"$HOME/include\" &&\n  \tmkdir -p \"$INCLUDE_DIR\" &&\n @@ -1232,14 +1235,6 @@ test_expect_success 'set up --show-origin tests' '\n  \tEOF\n  '\n  \n -if test_have_prereq MINGW\n -then\n -\t# convert to Windows paths\n -\tHOME=\"$(pwd)\"\n -\tINCLUDE_DIR=\"$HOME/include\"\n -\texport HOME INCLUDE_DIR\n -\tgit config -f .gitconfig include.path \"$INCLUDE_DIR/absolute.include\"\n -fi\n  \n  test_expect_success '--show-origin with --list' '\n  \tcat >expect <<-EOF &&\n diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\n index 864395e..a87d3d3 100755\n --- a/t/t9115-git-svn-dcommit-funky-renames.sh\n +++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n @@ -93,7 +93,7 @@ test_expect_success 'git svn rebase works inside a fresh-cloned repository' '\n  # > to special UNICODE characters in the range 0xf000 to 0xf0ff (the\n  # > \"Private use area\") when creating or accessing files.\n  prepare_a_utf8_locale\n -test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit' '\n +test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 new file on dcommit' '\n  \tLC_ALL=$a_utf8_locale &&\n  \texport LC_ALL &&\n  \tneq=$(printf \"\\201\\202\") &&\n @@ -105,7 +105,7 @@ test_expect_success UTF8,!MINGW 'svn.pathnameencoding=cp932 new file on dcommit'\n  '\n  \n  # See the comment on the above test for setting of LC_ALL.\n -test_expect_success !MINGW 'svn.pathnameencoding=cp932 rename on dcommit' '\n +test_expect_success !MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 rename on dcommit' '\n  \tLC_ALL=$a_utf8_locale &&\n  \texport LC_ALL &&\n  \tinf=$(printf \"\\201\\207\") &&\n\n-- \n2.7.4.windows.1\n"},{"id":"281566","messageId":"8beb1c208e33e1de8f272caa22fb7a0b662ca4cc.1458730457.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458730457.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T10:55:00Z","receivedAt":"2016-03-23T10:55:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Windows, the backslash is the native directory separator, but all\nsupported Windows versions also accept the forward slash in most\ncircumstances.\n\nOur tests expect forward slashes.\n\nRelative paths are generated by Git using forward slashes.\n\nSo let's try to be consistent and use forward slashes in the $HOME part\nof the paths reported by `git config --show-origin`, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/mingw.h | 6 ++++++\n path.c         | 3 +++\n 2 files changed, 9 insertions(+)\n\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex 8c5bf50..c008694 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -396,6 +396,12 @@ static inline char *mingw_find_last_dir_sep(const char *path)\n \t\t\tret = (char *)path;\n \treturn ret;\n }\n+static inline void convert_slashes(char *path)\n+{\n+\tfor (; *path; path++)\n+\t\tif (*path == '\\\\')\n+\t\t\t*path = '/';\n+}\n #define find_last_dir_sep mingw_find_last_dir_sep\n int mingw_offset_1st_component(const char *path);\n #define offset_1st_component mingw_offset_1st_component\ndiff --git a/path.c b/path.c\nindex 8b7e168..969b494 100644\n--- a/path.c\n+++ b/path.c\n@@ -584,6 +584,9 @@ char *expand_user_path(const char *path)\n \t\t\tif (!home)\n \t\t\t\tgoto return_null;\n \t\t\tstrbuf_addstr(&user_path, home);\n+#ifdef GIT_WINDOWS_NATIVE\n+\t\t\tconvert_slashes(user_path.buf);\n+#endif\n \t\t} else {\n \t\t\tstruct passwd *pw = getpw_str(username, username_len);\n \t\t\tif (!pw)\n-- \n2.7.4.windows.1\n"},{"id":"281567","messageId":"2426f15643f605cd197772323c888f1df7c0d313.1458730457.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458730457.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 2/4] Make t1300-repo-config resilient to being run via 'sh -x'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T10:55:07Z","receivedAt":"2016-03-23T10:55:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"One of this developer's primary tools to diagnose broken regression\ntests is to run the test script using 'sh -x t... -i -v' to find out\n*which* call *actually* demonstrates the symptom.\n\nHence it is pretty counterproductive if the test script behaves\ndifferently when being run via 'sh -x', in particular when using\ntest_cmp or test_i18ncmp on redirected stderr.\n\nSo let's use test_i18ngrep (as suggested by Jonathan Nieder) instead of\ntest_cmp/test_i18ncmp to verify that stderr looks as expected.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t1300-repo-config.sh | 8 ++------\n 1 file changed, 2 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 8867ce1..dca27a3 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -699,17 +699,13 @@ test_expect_success 'invalid unit' '\n \techo 1auto >expect &&\n \tgit config aninvalid.unit >actual &&\n \ttest_cmp expect actual &&\n-\tcat >expect <<-\\EOF &&\n-\tfatal: bad numeric config value '\\''1auto'\\'' for '\\''aninvalid.unit'\\'' in file .git/config: invalid unit\n-\tEOF\n \ttest_must_fail git config --int --get aninvalid.unit 2>actual &&\n-\ttest_i18ncmp expect actual\n+\ttest_i18ngrep \"bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit\" actual\n '\n \n test_expect_success 'invalid stdin config' '\n-\techo \"fatal: bad config line 1 in standard input \" >expect &&\n \techo \"[broken\" | test_must_fail git config --list --file - >output 2>&1 &&\n-\ttest_cmp expect output\n+\ttest_i18ngrep \"bad config line 1 in standard input\" output\n '\n \n cat > expect << EOF\n-- \n2.7.4.windows.1\n"},{"id":"281565","messageId":"86f6c23e500867f403c33c2716826dc0c5db0cdb.1458730457.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458730457.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 3/4] t1300: fix the new --show-origin tests on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T10:55:13Z","receivedAt":"2016-03-23T10:55:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Windows, we have that funny situation where the test script can refer\nto POSIX paths because it runs in a shell that uses a POSIX emulation\nlayer (\"MSYS2 runtime\"). Yet, git.exe does *not* understand POSIX paths\nat all but only pure Windows paths.\n\nSo let's just convert the POSIX paths to Windows paths before passing\nthem on to Git, using `pwd` (which is already modified on Windows to\noutput Windows paths).\n\nWhile fixing the new tests on Windows, we also have to exclude the tests\nthat want to write a file with a name that is illegal on Windows\n(unfortunately, there is more than one test trying to make use of that\nfile).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t1300-repo-config.sh | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex dca27a3..a37ebb2 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -1205,6 +1205,9 @@ test_expect_success POSIXPERM,PERL 'preserves existing permissions' '\n \t  \"die q(badrename) if ((stat(q(.git/config)))[2] & 07777) != 0600\"\n '\n \n+! test_have_prereq MINGW ||\n+HOME=\"$(pwd)\" # convert to Windows path\n+\n test_expect_success 'set up --show-origin tests' '\n \tINCLUDE_DIR=\"$HOME/include\" &&\n \tmkdir -p \"$INCLUDE_DIR\" &&\n@@ -1232,6 +1235,7 @@ test_expect_success 'set up --show-origin tests' '\n \tEOF\n '\n \n+\n test_expect_success '--show-origin with --list' '\n \tcat >expect <<-EOF &&\n \t\tfile:$HOME/.gitconfig\tuser.global=true\n@@ -1304,7 +1308,7 @@ test_expect_success 'set up custom config file' '\n \tEOF\n '\n \n-test_expect_success '--show-origin escape special file name characters' '\n+test_expect_success !MINGW '--show-origin escape special file name characters' '\n \tcat >expect <<-\\EOF &&\n \t\tfile:\"file\\\" (dq) and spaces.conf\"\tuser.custom=true\n \tEOF\n@@ -1333,7 +1337,7 @@ test_expect_success '--show-origin stdin with file include' '\n \ttest_cmp expect output\n '\n \n-test_expect_success '--show-origin blob' '\n+test_expect_success !MINGW '--show-origin blob' '\n \tcat >expect <<-\\EOF &&\n \t\tblob:a9d9f9e555b5c6f07cbe09d3f06fe3df11e09c08\tuser.custom=true\n \tEOF\n@@ -1342,7 +1346,7 @@ test_expect_success '--show-origin blob' '\n \ttest_cmp expect output\n '\n \n-test_expect_success '--show-origin blob ref' '\n+test_expect_success !MINGW '--show-origin blob ref' '\n \tcat >expect <<-\\EOF &&\n \t\tblob:\"master:file\\\" (dq) and spaces.conf\"\tuser.custom=true\n \tEOF\n-- \n2.7.4.windows.1\n"},{"id":"281568","messageId":"93fc4beb28097a021b2549ab2c156869c178597d.1458730457.git.johannes.schindelin@gmx.de","threadId":"41782","inReplyTo":"cover.1458730457.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-23T10:55:20Z","receivedAt":"2016-03-23T10:55:20Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"These two tests wanted to write file names which are incompatible with\nWindows' file naming rules (even if they pass using Cygwin due to\nCygwin's magic path mangling).\n\nWhile at it, skip the same tests also on MacOSX/HFS, as pointed out by\nTorsten Bögershausen.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t9115-git-svn-dcommit-funky-renames.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex 0990f8d..a87d3d3 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -93,7 +93,7 @@ test_expect_success 'git svn rebase works inside a fresh-cloned repository' '\n # > to special UNICODE characters in the range 0xf000 to 0xf0ff (the\n # > \"Private use area\") when creating or accessing files.\n prepare_a_utf8_locale\n-test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n+test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 new file on dcommit' '\n \tLC_ALL=$a_utf8_locale &&\n \texport LC_ALL &&\n \tneq=$(printf \"\\201\\202\") &&\n@@ -105,7 +105,7 @@ test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n '\n \n # See the comment on the above test for setting of LC_ALL.\n-test_expect_success 'svn.pathnameencoding=cp932 rename on dcommit' '\n+test_expect_success !MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 rename on dcommit' '\n \tLC_ALL=$a_utf8_locale &&\n \texport LC_ALL &&\n \tinf=$(printf \"\\201\\207\") &&\n-- \n2.7.4.windows.1"},{"id":"281572","messageId":"144C8B10-A98F-4888-ADB8-8C9D67BF52D9@gmail.com","threadId":"41782","inReplyTo":"86f6c23e500867f403c33c2716826dc0c5db0cdb.1458730457.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 3/4] t1300: fix the new --show-origin tests on Windows","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2016-03-23T11:08:16Z","receivedAt":"2016-03-23T11:08:16Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"\nOn 23 Mar 2016, at 11:55, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:\n\n> On Windows, we have that funny situation where the test script can refer\n> to POSIX paths because it runs in a shell that uses a POSIX emulation\n> layer (\"MSYS2 runtime\"). Yet, git.exe does *not* understand POSIX paths\n> at all but only pure Windows paths.\n> \n> So let's just convert the POSIX paths to Windows paths before passing\n> them on to Git, using `pwd` (which is already modified on Windows to\n> output Windows paths).\n> \n> While fixing the new tests on Windows, we also have to exclude the tests\n> that want to write a file with a name that is illegal on Windows\n> (unfortunately, there is more than one test trying to make use of that\n> file).\n\nThanks for these Windows fixes! After the 2.8 release I will try to post \na patch that uses a different filename where possible.\n\nCheers,\nLars\n\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n> t/t1300-repo-config.sh | 10 +++++++---\n> 1 file changed, 7 insertions(+), 3 deletions(-)\n> \n> diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\n> index dca27a3..a37ebb2 100755\n> --- a/t/t1300-repo-config.sh\n> +++ b/t/t1300-repo-config.sh\n> @@ -1205,6 +1205,9 @@ test_expect_success POSIXPERM,PERL 'preserves existing permissions' '\n> \t  \"die q(badrename) if ((stat(q(.git/config)))[2] & 07777) != 0600\"\n> '\n> \n> +! test_have_prereq MINGW ||\n> +HOME=\"$(pwd)\" # convert to Windows path\n> +\n> test_expect_success 'set up --show-origin tests' '\n> \tINCLUDE_DIR=\"$HOME/include\" &&\n> \tmkdir -p \"$INCLUDE_DIR\" &&\n> @@ -1232,6 +1235,7 @@ test_expect_success 'set up --show-origin tests' '\n> \tEOF\n> '\n> \n> +\n> test_expect_success '--show-origin with --list' '\n> \tcat >expect <<-EOF &&\n> \t\tfile:$HOME/.gitconfig\tuser.global=true\n> @@ -1304,7 +1308,7 @@ test_expect_success 'set up custom config file' '\n> \tEOF\n> '\n> \n> -test_expect_success '--show-origin escape special file name characters' '\n> +test_expect_success !MINGW '--show-origin escape special file name characters' '\n> \tcat >expect <<-\\EOF &&\n> \t\tfile:\"file\\\" (dq) and spaces.conf\"\tuser.custom=true\n> \tEOF\n> @@ -1333,7 +1337,7 @@ test_expect_success '--show-origin stdin with file include' '\n> \ttest_cmp expect output\n> '\n> \n> -test_expect_success '--show-origin blob' '\n> +test_expect_success !MINGW '--show-origin blob' '\n> \tcat >expect <<-\\EOF &&\n> \t\tblob:a9d9f9e555b5c6f07cbe09d3f06fe3df11e09c08\tuser.custom=true\n> \tEOF\n> @@ -1342,7 +1346,7 @@ test_expect_success '--show-origin blob' '\n> \ttest_cmp expect output\n> '\n> \n> -test_expect_success '--show-origin blob ref' '\n> +test_expect_success !MINGW '--show-origin blob ref' '\n> \tcat >expect <<-\\EOF &&\n> \t\tblob:\"master:file\\\" (dq) and spaces.conf\"\tuser.custom=true\n> \tEOF\n> -- \n> 2.7.4.windows.1\n> \n> \n"},{"id":"281587","messageId":"xmqq37rhdw77.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"alpine.DEB.2.20.1603231148510.4690@virtualbox","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-23T15:56:44Z","receivedAt":"2016-03-23T15:56:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Junio & Torsten,\n>\n> On Wed, 23 Mar 2016, Torsten Bögershausen wrote:\n>\n>> On 2016-03-22 23.57, Junio C Hamano wrote:\n>> > Dscho, I queued two out of these four, with a proposed fix-up patch\n>> > for each of them, on 'pu'; but I won't squash them together myself\n>> > without hearing from you as I do not test mingw or macosx.\n>\n> The suggested changes will be squashed into v2.\n>\n>> Beside that, do we want to amend the commit message like this:\n>> \n>> Author: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> Date:   Tue Mar 22 18:43:00 2016 +0100\n>> \n>>     skip some tests in t9115 due to file name issues\n>> \n>>     These two tests wanted to write file names which work under Linux or\n>>     CYGWIN, but are incompatible with file naming rules under mingw or HFS.\n>> \n>>     Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>     Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>>     Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n>>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>\n> Thanks, I used a slightly different version, as I had crafted it before\n> reading this mail already.\n\nThanks; Torsten, sorry but could you do another round of check, please?\n"},{"id":"281591","messageId":"xmqqpoulcfv3.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"alpine.DEB.2.20.1603230821420.4690@virtualbox","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-23T16:34:56Z","receivedAt":"2016-03-23T16:34:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> > diff --git a/path.c b/path.c\n>> > index 8b7e168..969b494 100644\n>> > --- a/path.c\n>> > +++ b/path.c\n>> > @@ -584,6 +584,9 @@ char *expand_user_path(const char *path)\n>> >  \t\t\tif (!home)\n>> >  \t\t\t\tgoto return_null;\n>> >  \t\t\tstrbuf_addstr(&user_path, home);\n>> > +#ifdef GIT_WINDOWS_NATIVE\n>> > +\t\t\tconvert_slashes(user_path.buf);\n>> > +#endif\n>> \n>> Hmm, I wonder if we want to do this at a bit lower level,\n>\n> Well, I tried to be careful. There *are* circumstamces when backslashes\n> are required (CreateProcess() comes to mind), so I wanted to have this\n> conversion as much only in the user-visible output as possible.\n\nI was able to guess that it would be the reason, and I was willing\nto accept this as a short-term workaround.\n\nAs you are very well aware, the usual pattern we use is to implement\na higher level function (e.g. expand_user_path() in this case) in\nterms of helpers that offer abstraction of implementation details\nthat may be platform specific (e.g. getenv() may be implemented\ndifferently on Windows).  An \"#ifdef\" in otherwise platform agnostic\ncodepath like this one is a sign that the code is not well thought\nout to find the right abstraction to use to follow that pattern.\n\nI was mostly reacting to that \"#ifdef\" and thinking aloud what the\nright abstraction is appropriate.  As a short-term workaround, the\nabove would have to do.\n\nAnd no, I do not think convert_slashes() that becomes no-op on\nnon-windows platforms is the right abstraction.\n"},{"id":"281600","messageId":"56F2E9B6.9070904@web.de","threadId":"41782","inReplyTo":"xmqq37rhdw77.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-23T19:08:38Z","receivedAt":"2016-03-23T19:08:38Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2016-03-23 16.56, Junio C Hamano wrote:\n\n>> Thanks, I used a slightly different version, as I had crafted it before\n>> reading this mail already.\n> \n> Thanks; Torsten, sorry but could you do another round of check, please?\nSure :-)\n"},{"id":"281613","messageId":"56F31C38.8010809@web.de","threadId":"41782","inReplyTo":"xmqq37rhdw77.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 4/4] mingw: skip some tests in t9115 due to file name issues","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-03-23T22:44:08Z","receivedAt":"2016-03-23T22:44:08Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"> \n> Thanks; Torsten, sorry but could you do another round of check, please?\nThanks, v2 tested OK under Mac OS and Linux\n"},{"id":"281951","messageId":"56F8E435.3020304@kdbg.org","threadId":"41782","inReplyTo":"8beb1c208e33e1de8f272caa22fb7a0b662ca4cc.1458668543.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-03-28T07:58:45Z","receivedAt":"2016-03-28T07:58:45Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 22.03.2016 um 18:42 schrieb Johannes Schindelin:\n> On Windows, the backslash is the native directory separator, but all\n> supported Windows versions also accept the forward slash in most\n> circumstances.\n> \n> Our tests expect forward slashes.\n> \n> Relative paths are generated by Git using forward slashes.\n> \n> So let's try to be consistent and use forward slashes in the $HOME part\n> of the paths reported by `git config --show-origin`, too.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>   compat/mingw.h | 6 ++++++\n>   path.c         | 3 +++\n>   2 files changed, 9 insertions(+)\n> \n> diff --git a/compat/mingw.h b/compat/mingw.h\n> index 8c5bf50..c008694 100644\n> --- a/compat/mingw.h\n> +++ b/compat/mingw.h\n> @@ -396,6 +396,12 @@ static inline char *mingw_find_last_dir_sep(const char *path)\n>   \t\t\tret = (char *)path;\n>   \treturn ret;\n>   }\n> +static inline void convert_slashes(char *path)\n> +{\n> +\tfor (; *path; path++)\n> +\t\tif (*path == '\\\\')\n> +\t\t\t*path = '/';\n> +}\n>   #define find_last_dir_sep mingw_find_last_dir_sep\n>   int mingw_offset_1st_component(const char *path);\n>   #define offset_1st_component mingw_offset_1st_component\n> diff --git a/path.c b/path.c\n> index 8b7e168..969b494 100644\n> --- a/path.c\n> +++ b/path.c\n> @@ -584,6 +584,9 @@ char *expand_user_path(const char *path)\n>   \t\t\tif (!home)\n>   \t\t\t\tgoto return_null;\n>   \t\t\tstrbuf_addstr(&user_path, home);\n> +#ifdef GIT_WINDOWS_NATIVE\n> +\t\t\tconvert_slashes(user_path.buf);\n> +#endif\n>   \t\t} else {\n>   \t\t\tstruct passwd *pw = getpw_str(username, username_len);\n>   \t\t\tif (!pw)\n> \n\nThis change is not warranted for the following reasons:\n\n- It is only there to satisfy the --show-origin tests, but not\n  for the benefit of the users.\n\n- The use of $HOME in those tests is just incidental, but not necessary.\n\n- There is no reason to change only paths depending on $HOME,\n  but no other paths imported through the environment.\n\nI see no advantage for the users of --show-origin that they now\nsee C:/foo/bar instead of C:\\foo\\bar. (For this reason, I'm not\nsuggesting to change all paths imported from the environment, just\nthe contrary, to leave them all alone).\n\nA change like this whould have been preferable:\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 6767da8..4c96044 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -1209,7 +1209,7 @@ test_expect_success POSIXPERM,PERL 'preserves existing permissions' '\n HOME=\"$(pwd)\" # convert to Windows path\n \n test_expect_success 'set up --show-origin tests' '\n-\tINCLUDE_DIR=\"$HOME/include\" &&\n+\tINCLUDE_DIR=\"$(pwd)/include\" &&\n \tmkdir -p \"$INCLUDE_DIR\" &&\n \tcat >\"$INCLUDE_DIR\"/absolute.include <<-\\EOF &&\n \t\t[user]\n@@ -1219,7 +1219,7 @@ test_expect_success 'set up --show-origin tests' '\n \t\t[user]\n \t\t\trelative = include\n \tEOF\n-\tcat >\"$HOME\"/.gitconfig <<-EOF &&\n+\tcat >\"$(pwd)\"/.gitconfig <<-EOF &&\n \t\t[user]\n \t\t\tglobal = true\n \t\t\toverride = global\n@@ -1237,9 +1237,9 @@ test_expect_success 'set up --show-origin tests' '\n \n test_expect_success '--show-origin with --list' '\n \tcat >expect <<-EOF &&\n-\t\tfile:$HOME/.gitconfig\tuser.global=true\n-\t\tfile:$HOME/.gitconfig\tuser.override=global\n-\t\tfile:$HOME/.gitconfig\tinclude.path=$INCLUDE_DIR/absolute.include\n+\t\tfile:$(pwd)/.gitconfig\tuser.global=true\n+\t\tfile:$(pwd)/.gitconfig\tuser.override=global\n+\t\tfile:$(pwd)/.gitconfig\tinclude.path=$INCLUDE_DIR/absolute.include\n \t\tfile:$INCLUDE_DIR/absolute.include\tuser.absolute=include\n \t\tfile:.git/config\tuser.local=true\n \t\tfile:.git/config\tuser.override=local\n@@ -1253,9 +1253,9 @@ test_expect_success '--show-origin with --list' '\n \n test_expect_success '--show-origin with --list --null' '\n \tcat >expect <<-EOF &&\n-\t\tfile:$HOME/.gitconfigQuser.global\n-\t\ttrueQfile:$HOME/.gitconfigQuser.override\n-\t\tglobalQfile:$HOME/.gitconfigQinclude.path\n+\t\tfile:$(pwd)/.gitconfigQuser.global\n+\t\ttrueQfile:$(pwd)/.gitconfigQuser.override\n+\t\tglobalQfile:$(pwd)/.gitconfigQinclude.path\n \t\t$INCLUDE_DIR/absolute.includeQfile:$INCLUDE_DIR/absolute.includeQuser.absolute\n \t\tincludeQfile:.git/configQuser.local\n \t\ttrueQfile:.git/configQuser.override\n@@ -1284,7 +1284,7 @@ test_expect_success '--show-origin with single file' '\n \n test_expect_success '--show-origin with --get-regexp' '\n \tcat >expect <<-EOF &&\n-\t\tfile:$HOME/.gitconfig\tuser.global true\n+\t\tfile:$(pwd)/.gitconfig\tuser.global true\n \t\tfile:.git/config\tuser.local true\n \tEOF\n \tgit config --show-origin --get-regexp \"user\\.[g|l].*\" >output &&\n\nBut it seems I'm late in the game. Can't I take a break for a week\nwithout something odd happening to the Windows port...?\n\n-- Hannes\n"},{"id":"281963","messageId":"alpine.DEB.2.20.1603281712470.4690@virtualbox","threadId":"41782","inReplyTo":"56F8E435.3020304@kdbg.org","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-28T15:14:17Z","receivedAt":"2016-03-28T15:14:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Hannes,\n\nOn Mon, 28 Mar 2016, Johannes Sixt wrote:\n\n> A change like this whould have been preferable:\n> [...]\n\nThe problem with your patch is that it does not account for backslashes in\npaths resulting in quoting. I am afraid that your patch will most likely\n*not* let the tests pass in Git for Windows SDK, while my patch does.\n\nCiao,\nDscho\n"},{"id":"282088","messageId":"56FAD506.4050701@kdbg.org","threadId":"41782","inReplyTo":"alpine.DEB.2.20.1603281712470.4690@virtualbox","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-03-29T19:18:30Z","receivedAt":"2016-03-29T19:18:30Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 28.03.2016 um 17:14 schrieb Johannes Schindelin:\n> Hi Hannes,\n> \n> On Mon, 28 Mar 2016, Johannes Sixt wrote:\n> \n>> A change like this whould have been preferable:\n>> [...]\n> \n> The problem with your patch is that it does not account for backslashes in\n> paths resulting in quoting. I am afraid that your patch will most likely\n> *not* let the tests pass in Git for Windows SDK, while my patch does.\n\nIt does pass. The reason is that pwd -W generates forward slashes.\n\nThis part of your 45bf3297 (t1300: fix the new --show-origin tests on\nWindows)\n\n@@ -1205,6 +1205,9 @@ test_expect_success POSIXPERM,PERL 'preserves existing per\n          \"die q(badrename) if ((stat(q(.git/config)))[2] & 07777) != 0600\"\n '\n \n+! test_have_prereq MINGW ||\n+HOME=\"$(pwd)\" # convert to Windows path\n+\n test_expect_success 'set up --show-origin tests' '\n        INCLUDE_DIR=\"$HOME/include\" &&\n        mkdir -p \"$INCLUDE_DIR\" &&\n\nis actually a much more concise version of my proposed patch,\nalthough the result still misuses $HOME where it does not have\nto. In fact, if I revert 5ca6b7bb (config --show-origin: report\npaths with forward slashes), the tests still pass. But since it\ndoes not make a difference save for a few microseconds more or\nless during startup, it is not worth the churn at this point.\n\n-- Hannes\n"},{"id":"282104","messageId":"xmqqwpolvyml.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"56FAD506.4050701@kdbg.org","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-29T20:05:06Z","receivedAt":"2016-03-29T20:05:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> This part of your 45bf3297 (t1300: fix the new --show-origin tests on\n> Windows)\n>\n> @@ -1205,6 +1205,9 @@ test_expect_success POSIXPERM,PERL 'preserves existing per\n>           \"die q(badrename) if ((stat(q(.git/config)))[2] & 07777) != 0600\"\n>  '\n>  \n> +! test_have_prereq MINGW ||\n> +HOME=\"$(pwd)\" # convert to Windows path\n> +\n>  test_expect_success 'set up --show-origin tests' '\n>         INCLUDE_DIR=\"$HOME/include\" &&\n>         mkdir -p \"$INCLUDE_DIR\" &&\n>\n> is actually a much more concise version of my proposed patch,\n> although the result still misuses $HOME where it does not have\n> to. In fact, if I revert 5ca6b7bb (config --show-origin: report\n> paths with forward slashes), the tests still pass. But since it\n> does not make a difference save for a few microseconds more or\n> less during startup, it is not worth the churn at this point.\n\nWell, from the point of view of codebase cleanliness, if we can do\nwithout 5ca6b7bb4, we would be much better off in the longer term,\nso I would say it would be wonderful if we can safely revert it.\n"},{"id":"282194","messageId":"56FB6989.8070906@kdbg.org","threadId":"41782","inReplyTo":"56FAD506.4050701@kdbg.org","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-03-30T05:52:09Z","receivedAt":"2016-03-30T05:52:09Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 29.03.2016 um 21:18 schrieb Johannes Sixt:\n> Am 28.03.2016 um 17:14 schrieb Johannes Schindelin:\n>> The problem with your patch is that it does not account for backslashes in\n>> paths resulting in quoting. I am afraid that your patch will most likely\n>> *not* let the tests pass in Git for Windows SDK, while my patch does.\n>\n> It does pass. The reason is that pwd -W generates forward slashes.\n\nIt just occurred to me that we might be observing a difference in \nbehavior of pwd -W between the modern MSYS2 bash and the old MSYS1 bash \nthat I am using. If that is the case the tests won't pass under MSYS2 \nwithout the change made by 5ca6b7bb (config --show-origin: report paths \nwith forward slashes).\n\n-- Hannes\n"},{"id":"282528","messageId":"570014B5.4030203@kdbg.org","threadId":"41782","inReplyTo":"56FB6989.8070906@kdbg.org","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-04-02T18:51:33Z","receivedAt":"2016-04-02T18:51:33Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 30.03.2016 um 07:52 schrieb Johannes Sixt:\n> Am 29.03.2016 um 21:18 schrieb Johannes Sixt:\n>> It does pass. The reason is that pwd -W generates forward slashes.\n>\n> It just occurred to me that we might be observing a difference in\n> behavior of pwd -W between the modern MSYS2 bash and the old MSYS1 bash\n> that I am using.\n\nNo that isn't it. Both versions produce forward slashes. Puzzled...\n\n-- Hannes\n"},{"id":"282529","messageId":"57001772.7090007@kdbg.org","threadId":"41782","inReplyTo":"xmqqwpolvyml.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-04-02T19:03:14Z","receivedAt":"2016-04-02T19:03:14Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 29.03.2016 um 22:05 schrieb Junio C Hamano:\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n>> This part of your 45bf3297 (t1300: fix the new --show-origin tests on\n>> Windows)\n>>\n>> @@ -1205,6 +1205,9 @@ test_expect_success POSIXPERM,PERL 'preserves existing per\n>>            \"die q(badrename) if ((stat(q(.git/config)))[2] & 07777) != 0600\"\n>>   '\n>>   \n>> +! test_have_prereq MINGW ||\n>> +HOME=\"$(pwd)\" # convert to Windows path\n>> +\n>>   test_expect_success 'set up --show-origin tests' '\n>>          INCLUDE_DIR=\"$HOME/include\" &&\n>>          mkdir -p \"$INCLUDE_DIR\" &&\n>>\n>> is actually a much more concise version of my proposed patch,\n>> although the result still misuses $HOME where it does not have\n>> to. In fact, if I revert 5ca6b7bb (config --show-origin: report\n>> paths with forward slashes), the tests still pass. But since it\n>> does not make a difference save for a few microseconds more or\n>> less during startup, it is not worth the churn at this point.\n> \n> Well, from the point of view of codebase cleanliness, if we can do\n> without 5ca6b7bb4, we would be much better off in the longer term,\n> so I would say it would be wonderful if we can safely revert it.\n\nAlthough I am convinced that the change is not necessary for\ncorrectness, I can buy the justification that we should produce forward\nslashes for consistency. There are a number of occasions where we\npresent paths to the user, and we do show forward-slashes in all cases\nthat I found. We should keep the commit.\n\nBut then let's do this:\n\n---- 8< ----\nSubject: [PATCH] Windows: shorten code by re-using convert_slashes()\n\nMake a few more spots more readable by using the recently introduced,\nWindows-specific helper.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n abspath.c      | 5 +----\n compat/mingw.c | 9 ++-------\n 2 files changed, 3 insertions(+), 11 deletions(-)\n\ndiff --git a/abspath.c b/abspath.c\nindex 5edb4e7..2825de8 100644\n--- a/abspath.c\n+++ b/abspath.c\n@@ -167,7 +167,6 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)\n \tstrbuf_add(&path, pfx, pfx_len);\n \tstrbuf_addstr(&path, arg);\n #else\n-\tchar *p;\n \t/* don't add prefix to absolute paths, but still replace '\\' by '/' */\n \tstrbuf_reset(&path);\n \tif (is_absolute_path(arg))\n@@ -175,9 +174,7 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)\n \telse if (pfx_len)\n \t\tstrbuf_add(&path, pfx, pfx_len);\n \tstrbuf_addstr(&path, arg);\n-\tfor (p = path.buf + pfx_len; *p; p++)\n-\t\tif (*p == '\\\\')\n-\t\t\t*p = '/';\n+\tconvert_slashes(path.buf + pfx_len);\n #endif\n \treturn path.buf;\n }\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 54c82ec..0413d5c 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -763,15 +763,12 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)\n \n char *mingw_getcwd(char *pointer, int len)\n {\n-\tint i;\n \twchar_t wpointer[MAX_PATH];\n \tif (!_wgetcwd(wpointer, ARRAY_SIZE(wpointer)))\n \t\treturn NULL;\n \tif (xwcstoutf(pointer, wpointer, len) < 0)\n \t\treturn NULL;\n-\tfor (i = 0; pointer[i]; i++)\n-\t\tif (pointer[i] == '\\\\')\n-\t\t\tpointer[i] = '/';\n+\tconvert_slashes(pointer);\n \treturn pointer;\n }\n \n@@ -2112,9 +2109,7 @@ static void setup_windows_environment()\n \t\t * executable (by not mistaking the dir separators\n \t\t * for escape characters).\n \t\t */\n-\t\tfor (; *tmp; tmp++)\n-\t\t\tif (*tmp == '\\\\')\n-\t\t\t\t*tmp = '/';\n+\t\tconvert_slashes(tmp);\n \t}\n \n \t/* simulate TERM to enable auto-color (see color.c) */\n-- \n2.7.0.118.g90056ae\n"},{"id":"282615","messageId":"xmqqd1q574p8.fsf@gitster.mtv.corp.google.com","threadId":"41782","inReplyTo":"57001772.7090007@kdbg.org","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-04T15:51:15Z","receivedAt":"2016-04-04T15:51:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Although I am convinced that the change is not necessary for\n> correctness, I can buy the justification that we should produce forward\n> slashes for consistency. There are a number of occasions where we\n> present paths to the user, and we do show forward-slashes in all cases\n> that I found. We should keep the commit.\n>\n> But then let's do this:\n\nSounds like a plan; even though I am mildly against adding more\nplatform specific #ifdef to files outside compat/, this patch does\nnot.\n\nDscho?\n\n>\n> ---- 8< ----\n> Subject: [PATCH] Windows: shorten code by re-using convert_slashes()\n>\n> Make a few more spots more readable by using the recently introduced,\n> Windows-specific helper.\n>\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  abspath.c      | 5 +----\n>  compat/mingw.c | 9 ++-------\n>  2 files changed, 3 insertions(+), 11 deletions(-)\n>\n> diff --git a/abspath.c b/abspath.c\n> index 5edb4e7..2825de8 100644\n> --- a/abspath.c\n> +++ b/abspath.c\n> @@ -167,7 +167,6 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)\n>  \tstrbuf_add(&path, pfx, pfx_len);\n>  \tstrbuf_addstr(&path, arg);\n>  #else\n> -\tchar *p;\n>  \t/* don't add prefix to absolute paths, but still replace '\\' by '/' */\n>  \tstrbuf_reset(&path);\n>  \tif (is_absolute_path(arg))\n> @@ -175,9 +174,7 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)\n>  \telse if (pfx_len)\n>  \t\tstrbuf_add(&path, pfx, pfx_len);\n>  \tstrbuf_addstr(&path, arg);\n> -\tfor (p = path.buf + pfx_len; *p; p++)\n> -\t\tif (*p == '\\\\')\n> -\t\t\t*p = '/';\n> +\tconvert_slashes(path.buf + pfx_len);\n>  #endif\n>  \treturn path.buf;\n>  }\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index 54c82ec..0413d5c 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -763,15 +763,12 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)\n>  \n>  char *mingw_getcwd(char *pointer, int len)\n>  {\n> -\tint i;\n>  \twchar_t wpointer[MAX_PATH];\n>  \tif (!_wgetcwd(wpointer, ARRAY_SIZE(wpointer)))\n>  \t\treturn NULL;\n>  \tif (xwcstoutf(pointer, wpointer, len) < 0)\n>  \t\treturn NULL;\n> -\tfor (i = 0; pointer[i]; i++)\n> -\t\tif (pointer[i] == '\\\\')\n> -\t\t\tpointer[i] = '/';\n> +\tconvert_slashes(pointer);\n>  \treturn pointer;\n>  }\n>  \n> @@ -2112,9 +2109,7 @@ static void setup_windows_environment()\n>  \t\t * executable (by not mistaking the dir separators\n>  \t\t * for escape characters).\n>  \t\t */\n> -\t\tfor (; *tmp; tmp++)\n> -\t\t\tif (*tmp == '\\\\')\n> -\t\t\t\t*tmp = '/';\n> +\t\tconvert_slashes(tmp);\n>  \t}\n>  \n>  \t/* simulate TERM to enable auto-color (see color.c) */\n"},{"id":"282648","messageId":"alpine.DEB.2.20.1604042242110.3371@virtualbox","threadId":"41782","inReplyTo":"xmqqd1q574p8.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/4] config --show-origin: report paths with forward slashes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-04-04T20:42:21Z","receivedAt":"2016-04-04T20:42:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 4 Apr 2016, Junio C Hamano wrote:\n\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n> > Although I am convinced that the change is not necessary for\n> > correctness, I can buy the justification that we should produce forward\n> > slashes for consistency. There are a number of occasions where we\n> > present paths to the user, and we do show forward-slashes in all cases\n> > that I found. We should keep the commit.\n> >\n> > But then let's do this:\n> \n> Sounds like a plan; even though I am mildly against adding more\n> platform specific #ifdef to files outside compat/, this patch does\n> not.\n> \n> Dscho?\n\nFine by me!\nDscho\n"}]}