{"thread":{"id":"28687","subject":"[PATCH 2/7] t9001: do not fail only due to CR/LF issues","startedAt":"2011-10-15T14:05:13Z","lastAt":"2011-10-16T05:17:23Z","messageCount":9,"participants":["Pat Thoyts","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"177725","messageId":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":null,"subject":"[PATCH 0/7] Some patches from msysGit (round 2)","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:13Z","receivedAt":"2011-10-15T14:05:13Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"This collects some recent patches from the msysGit tree that clear up\ntest issues on Windows.\n\nThis second version incorporates suggestions received from round 1 to:\n  avoid duplicating code in t9901 web-browse tests\n  drop the t1402 changes in favour of another change from J6t (on pu)\n  test for the presence of 'bcomp' in bc3 mergetool\n\nJohannes Schindelin (3):\n  t1020: disable the pwd test on MinGW\n  t9001: do not fail only due to CR/LF issues\n  t9300: do not run --cat-blob-fd related tests on MinGW\n\nPat Thoyts (3):\n  t9901: fix line-ending dependency on windows\n  mergetools: use the correct tool for Beyond Compare 3 on Windows\n  mingw: ensure sockets are initialized before calling gethostname\n\nSebastian Schuberth (1):\n  git-svn: On MSYS, escape and quote SVN_SSH also if set by the user\n\n compat/mingw.c             |    7 +++++++\n compat/mingw.h             |    3 +++\n git-svn.perl               |   15 +++++++--------\n mergetools/bc3             |    7 ++++++-\n t/t1020-subdirectory.sh    |    2 +-\n t/t9001-send-email.sh      |    1 +\n t/t9300-fast-import.sh     |    8 ++++----\n t/t9901-git-web--browse.sh |   32 +++++++++++++++++---------------\n 8 files changed, 46 insertions(+), 29 deletions(-)\n\n-- \n1.7.7.1.gbba15\n"},{"id":"177729","messageId":"1318687520-19522-2-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"[PATCH 1/7] t1020: disable the pwd test on MinGW","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:14Z","receivedAt":"2011-10-15T14:05:14Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIt fails both for line ending and for DOS path reasons.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t1020-subdirectory.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh\nindex 3b1b985..e23ac0e 100755\n--- a/t/t1020-subdirectory.sh\n+++ b/t/t1020-subdirectory.sh\n@@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '\n \t)\n '\n \n-test_expect_success '!alias expansion' '\n+test_expect_success NOT_MINGW '!alias expansion' '\n \tpwd >expect &&\n \t(\n \t\tgit config alias.test !pwd &&\n-- \n1.7.7.1.gbba15\n"},{"id":"177724","messageId":"1318687520-19522-3-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"[PATCH 2/7] t9001: do not fail only due to CR/LF issues","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:15Z","receivedAt":"2011-10-15T14:05:15Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t9001-send-email.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 87b4acc..8c12c65 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -23,6 +23,7 @@ test_expect_success $PREREQ \\\n       echo do\n       echo \"  echo \\\"!\\$a!\\\"\"\n       echo \"done >commandline\\$output\"\n+      test_have_prereq MINGW && echo \"dos2unix commandline\\$output\"\n       echo \"cat > msgtxt\\$output\"\n       ) >fake.sendmail &&\n      chmod +x ./fake.sendmail &&\n-- \n1.7.7.1.gbba15\n"},{"id":"177731","messageId":"1318687520-19522-4-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"[PATCH 3/7] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:16Z","receivedAt":"2011-10-15T14:05:16Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"From: Sebastian Schuberth <sschuberth@gmail.com>\n\nWhile GIT_SSH does not require any escaping / quoting (e.g. for paths\ncontaining spaces), SVN_SSH requires it due to its use in a Perl script.\n\nPreviously, SVN_SSH has only been escaped and quoted automatically if it\nwas unset and thus derived from GIT_SSH. For user convenience, do the\nescaping and quoting also for a SVN_SSH set by the user. This way, the\nuser is able to use the same unescaped and unquoted syntax for GIT_SSH\nand SVN_SSH.\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n git-svn.perl |   15 +++++++--------\n 1 files changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a0410f0..3b33379 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -22,14 +22,13 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';\n $Git::SVN::Ra::_log_window_size = 100;\n $Git::SVN::_minimize_url = 'unset';\n \n-if (! exists $ENV{SVN_SSH}) {\n-\tif (exists $ENV{GIT_SSH}) {\n-\t\t$ENV{SVN_SSH} = $ENV{GIT_SSH};\n-\t\tif ($^O eq 'msys') {\n-\t\t\t$ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g;\n-\t\t\t$ENV{SVN_SSH} =~ s/(.*)/\"$1\"/;\n-\t\t}\n-\t}\n+if (! exists $ENV{SVN_SSH} && exists $ENV{GIT_SSH}) {\n+\t$ENV{SVN_SSH} = $ENV{GIT_SSH};\n+}\n+\n+if (exists $ENV{SVN_SSH} && $^O eq 'msys') {\n+\t$ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g;\n+\t$ENV{SVN_SSH} =~ s/(.*)/\"$1\"/;\n }\n \n $Git::SVN::Log::TZ = $ENV{TZ};\n-- \n1.7.7.1.gbba15\n"},{"id":"177727","messageId":"1318687520-19522-5-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"[PATCH 4/7] t9901: fix line-ending dependency on windows","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:17Z","receivedAt":"2011-10-15T14:05:17Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n---\n t/t9901-git-web--browse.sh |   32 +++++++++++++++++---------------\n 1 files changed, 17 insertions(+), 15 deletions(-)\n\ndiff --git a/t/t9901-git-web--browse.sh b/t/t9901-git-web--browse.sh\nindex 7906e5d..69513f1 100755\n--- a/t/t9901-git-web--browse.sh\n+++ b/t/t9901-git-web--browse.sh\n@@ -7,31 +7,35 @@ This test checks that git web--browse can handle various valid URLs.'\n \n . ./test-lib.sh\n \n+test_web_browse () {\n+\t# browser=$1 url=$2\n+\tgit web--browse --browser=\"$1\" \"$2\" >actual &&\n+\ttr -d '\\015' <actual >text &&\n+\ttest_cmp expect text\n+}\n+\n test_expect_success \\\n \t'URL with an ampersand in it' '\n \techo http://example.com/foo\\&bar >expect &&\n \tgit config browser.custom.cmd echo &&\n-\tgit web--browse --browser=custom \\\n-\t\thttp://example.com/foo\\&bar >actual &&\n-\ttest_cmp expect actual\n+\ttest_web_browse custom \\\n+\t\thttp://example.com/foo\\&bar\n '\n \n test_expect_success \\\n \t'URL with a semi-colon in it' '\n \techo http://example.com/foo\\;bar >expect &&\n \tgit config browser.custom.cmd echo &&\n-\tgit web--browse --browser=custom \\\n-\t\thttp://example.com/foo\\;bar >actual &&\n-\ttest_cmp expect actual\n+\ttest_web_browse custom \\\n+\t\thttp://example.com/foo\\;bar\n '\n \n test_expect_success \\\n \t'URL with a hash in it' '\n \techo http://example.com/foo#bar >expect &&\n \tgit config browser.custom.cmd echo &&\n-\tgit web--browse --browser=custom \\\n-\t\thttp://example.com/foo#bar >actual &&\n-\ttest_cmp expect actual\n+\ttest_web_browse custom \\\n+\t\thttp://example.com/foo#bar\n '\n \n test_expect_success \\\n@@ -43,9 +47,8 @@ test_expect_success \\\n \tEOF\n \tchmod +x \"fake browser\" &&\n \tgit config browser.w3m.path \"`pwd`/fake browser\" &&\n-\tgit web--browse --browser=w3m \\\n-\t\thttp://example.com/foo >actual &&\n-\ttest_cmp expect actual\n+\ttest_web_browse w3m \\\n+\t\thttp://example.com/foo\n '\n \n test_expect_success \\\n@@ -58,9 +61,8 @@ test_expect_success \\\n \t\t\tdone\n \t\t}\n \t\tf\" &&\n-\tgit web--browse --browser=custom \\\n-\t\thttp://example.com/foo >actual &&\n-\ttest_cmp expect actual\n+\ttest_web_browse custom \\\n+\t\thttp://example.com/foo\n '\n \n test_done\n-- \n1.7.7.1.gbba15\n"},{"id":"177726","messageId":"1318687520-19522-6-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"[PATCH 5/7] t9300: do not run --cat-blob-fd related tests on MinGW","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:18Z","receivedAt":"2011-10-15T14:05:18Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nAs diagnosed by Johannes Sixt, msys.dll does not hand through file\ndescriptors > 2 to child processes, so these test cases cannot passes when\nrun through an MSys bash.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t9300-fast-import.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex bd32b91..438aaf6 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -2237,7 +2237,7 @@ test_expect_success 'R: cat-blob-fd must be a nonnegative integer' '\n \ttest_must_fail git fast-import --cat-blob-fd=-1 </dev/null\n '\n \n-test_expect_success 'R: print old blob' '\n+test_expect_success NOT_MINGW 'R: print old blob' '\n \tblob=$(echo \"yes it can\" | git hash-object -w --stdin) &&\n \tcat >expect <<-EOF &&\n \t${blob} blob 11\n@@ -2249,7 +2249,7 @@ test_expect_success 'R: print old blob' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'R: in-stream cat-blob-fd not respected' '\n+test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '\n \techo hello >greeting &&\n \tblob=$(git hash-object -w greeting) &&\n \tcat >expect <<-EOF &&\n@@ -2270,7 +2270,7 @@ test_expect_success 'R: in-stream cat-blob-fd not respected' '\n \ttest_cmp expect actual.1\n '\n \n-test_expect_success 'R: print new blob' '\n+test_expect_success NOT_MINGW 'R: print new blob' '\n \tblob=$(echo \"yep yep yep\" | git hash-object --stdin) &&\n \tcat >expect <<-EOF &&\n \t${blob} blob 12\n@@ -2288,7 +2288,7 @@ test_expect_success 'R: print new blob' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'R: print new blob by sha1' '\n+test_expect_success NOT_MINGW 'R: print new blob by sha1' '\n \tblob=$(echo \"a new blob named by sha1\" | git hash-object --stdin) &&\n \tcat >expect <<-EOF &&\n \t${blob} blob 25\n-- \n1.7.7.1.gbba15\n"},{"id":"177728","messageId":"1318687520-19522-7-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"[PATCH 6/7] mergetools: use the correct tool for Beyond Compare 3 on Windows","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:19Z","receivedAt":"2011-10-15T14:05:19Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"On Windows the bcompare tool launches a graphical program and does\nnot wait for it to terminate. A separate 'bcomp' tool is provided which\nwill wait for the view to exit so we use this instead.\n\nReported-by: Werner BEROUX <werner@beroux.com>\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n---\n mergetools/bc3 |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/mergetools/bc3 b/mergetools/bc3\nindex 27b3dd4..b6319d2 100644\n--- a/mergetools/bc3\n+++ b/mergetools/bc3\n@@ -16,5 +16,10 @@ merge_cmd () {\n }\n \n translate_merge_tool_path() {\n-\techo bcompare\n+\tif type bcomp >/dev/null 2>/dev/null\n+\tthen\n+\t\techo bcomp\n+\telse\n+\t\techo bcompare\n+\tfi\n }\n-- \n1.7.7.1.gbba15\n"},{"id":"177730","messageId":"1318687520-19522-8-git-send-email-patthoyts@users.sourceforge.net","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"[PATCH 7/7] mingw: ensure sockets are initialized before calling gethostname","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T14:05:20Z","receivedAt":"2011-10-15T14:05:20Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"If the Windows sockets subsystem has not been initialized yet then an\nattempt to get the hostname returns an error and prints a warning to the\nconsole. This solves this issue for msysGit as seen with 'git fetch'.\n\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n---\n compat/mingw.c |    7 +++++++\n compat/mingw.h |    3 +++\n 2 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 8947418..efdc703 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1321,6 +1321,13 @@ static void ensure_socket_initialization(void)\n \tinitialized = 1;\n }\n \n+#undef gethostname\n+int mingw_gethostname(char *name, int namelen)\n+{\n+    ensure_socket_initialization();\n+    return gethostname(name, namelen);\n+}\n+\n #undef gethostbyname\n struct hostent *mingw_gethostbyname(const char *host)\n {\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex ce9dd98..fecf0d0 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -190,6 +190,9 @@ char *mingw_getcwd(char *pointer, int len);\n char *mingw_getenv(const char *name);\n #define getenv mingw_getenv\n \n+int mingw_gethostname(char *host, int namelen);\n+#define gethostname mingw_gethostname\n+\n struct hostent *mingw_gethostbyname(const char *host);\n #define gethostbyname mingw_gethostbyname\n \n-- \n1.7.7.1.gbba15\n"},{"id":"177762","messageId":"7vsjmtsefw.fsf@alter.siamese.dyndns.org","threadId":"28687","inReplyTo":"1318687520-19522-1-git-send-email-patthoyts@users.sourceforge.net","subject":"Re: [PATCH 0/7] Some patches from msysGit (round 2)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-16T05:17:23Z","receivedAt":"2011-10-16T05:17:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pat Thoyts <patthoyts@users.sourceforge.net> writes:\n\n> This collects some recent patches from the msysGit tree that clear up\n> test issues on Windows.\n>\n> This second version incorporates suggestions received from round 1 to:\n>   avoid duplicating code in t9901 web-browse tests\n>   drop the t1402 changes in favour of another change from J6t (on pu)\n>   test for the presence of 'bcomp' in bc3 mergetool\n\nThanks.\n\nWill replace the previous patches with these and advance them to 'next'\nshortly.\n"}]}