{"thread":{"id":"34451","subject":"t3032 incompatible with Cygwin/Windows","startedAt":"2013-07-16T18:33:35Z","lastAt":"2013-07-21T21:04:51Z","messageCount":14,"participants":["Mark Levedahl","Jonathan Nieder","Junio C Hamano","Ramsay Jones"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"223532","messageId":"51E591FF.7030600@gmail.com","threadId":"34451","inReplyTo":null,"subject":"t3032 incompatible with Cygwin/Windows","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2013-07-16T18:33:35Z","receivedAt":"2013-07-16T18:33:35Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Subtests 6,7, and 9 of t3032 fail on Cygwin, and I presume will fail on \nmsysgit for similar reasons. Looking at test 6, the expected result is a \nline ending with \\r\\n in text.txt. This line is extracted with grep \n(grep 'justice and holiness' text.txt > actual), with unavoidable result \nthat on Cygwin the line ending is \\n. This happens because on Cygwin, \nthe text utils are compiled to open files in text mode meaning than \\n \nand \\r\\n are both recognized as EOL markers. Thus, even though text.txt \nis an exact match for what is created on Linux, the test fails because \n\\r\\n cannot be distinguished by the available tools.\n\nI'm not sure the right way forward. I did confirm that by substituting \n\"q_to_tab\" for \"q_to_cr\" in t3032, the test pass on Cygwin and on Linux. \nPerhaps t3032 should be so amended to avoid use of a non-portable line \nending construct?\n\nMark\n"},{"id":"223535","messageId":"1374000592-31845-1-git-send-email-mlevedahl@gmail.com","threadId":"34451","inReplyTo":"51E591FF.7030600@gmail.com","subject":"[PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2013-07-16T18:49:52Z","receivedAt":"2013-07-16T18:49:52Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Subtests 6, 7, and 9 rely test that merge-recursive correctly\nignores whitespace when so directed. Change the particular whitespace\nsequences to be ones that are not known line endings so the whitespace\nis not changed when being extracted by line oriented grep.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n t/t3032-merge-recursive-options.sh | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh\nindex 2b17311..52e275c 100755\n--- a/t/t3032-merge-recursive-options.sh\n+++ b/t/t3032-merge-recursive-options.sh\n@@ -92,7 +92,7 @@ test_expect_success 'setup' '\n \t\t\ts/Polemarchus interposing./Polemarchus, interposing.Q/\n \t\t\t/justice and holiness/ s/$/Q/\n \t\t\t/pay your debts/ s/$/Q/\n-\t\t\" text.txt | q_to_cr >text.txt+ &&\n+\t\t\" text.txt | q_to_tab >text.txt+ &&\n \tmv text.txt+ text.txt &&\n \tgit commit -a -m \"Clarify\" &&\n \tgit show-branch --all\n@@ -125,7 +125,7 @@ test_expect_success '-Xignore-space-change makes cherry-pick succeed' '\n '\n \n test_expect_success '--ignore-space-change: our w/s-only change wins' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tq_to_tab <<-\\EOF >expected &&\n \t    justice and holiness and is the nurse of his age and theQ\n \tEOF\n \n@@ -150,7 +150,7 @@ test_expect_success '--ignore-space-change: does not ignore new spaces' '\n \tcat <<-\\EOF >expected1 &&\n \tWell said, Cephalus, I replied; but as con cerning justice, what is\n \tEOF\n-\tq_to_cr <<-\\EOF >expected2 &&\n+\tq_to_tab <<-\\EOF >expected2 &&\n \tun intentionally; and when he departs to the world below he is not inQ\n \tEOF\n \n@@ -174,7 +174,7 @@ test_expect_success '--ignore-all-space drops their new spaces' '\n '\n \n test_expect_success '--ignore-all-space keeps our new spaces' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tq_to_tab <<-\\EOF >expected &&\n \tun intentionally; and when he departs to the world below he is not inQ\n \tEOF\n \n@@ -185,7 +185,7 @@ test_expect_success '--ignore-all-space keeps our new spaces' '\n '\n \n test_expect_success '--ignore-space-at-eol' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tq_to_tab <<-\\EOF >expected &&\n \t<<<<<<< HEAD\n \tis not in his right mind; ought I to give them back to him?  No oneQ\n \t=======\n-- \n1.8.3.2.0.13\n"},{"id":"223536","messageId":"20130716185635.GN14690@google.com","threadId":"34451","inReplyTo":"51E591FF.7030600@gmail.com","subject":"Re: t3032 incompatible with Cygwin/Windows","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-16T18:56:35Z","receivedAt":"2013-07-16T18:56:35Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Mark Levedahl wrote:\n\n> Subtests 6,7, and 9 of t3032 fail on Cygwin, and I presume will fail\n> on msysgit for similar reasons. Looking at test 6, the expected\n> result is a line ending with \\r\\n in text.txt. This line is\n> extracted with grep (grep 'justice and holiness' text.txt > actual),\n> with unavoidable result that on Cygwin the line ending is \\n.\n\nWould using perl instead of grep fix this?\n"},{"id":"223537","messageId":"20130716185933.GO14690@google.com","threadId":"34451","inReplyTo":"1374000592-31845-1-git-send-email-mlevedahl@gmail.com","subject":"Re: [PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-16T18:59:33Z","receivedAt":"2013-07-16T18:59:33Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Mark Levedahl wrote:\n\n> Subtests 6, 7, and 9 rely test that merge-recursive correctly\n> ignores whitespace when so directed. Change the particular whitespace\n> sequences to be ones that are not known line endings so the whitespace\n> is not changed when being extracted by line oriented grep.\n\nmerge-recursive needs to be able to deal with \\r at EOL, too, so if at\nall possible I would prefer to see the test fixed to pass on Cygwin\nsome other way.\n\nThanks.\n"},{"id":"223539","messageId":"51E5A287.40708@gmail.com","threadId":"34451","inReplyTo":"20130716185933.GO14690@google.com","subject":"Re: [PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2013-07-16T19:44:07Z","receivedAt":"2013-07-16T19:44:07Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"On 07/16/2013 02:59 PM, Jonathan Nieder wrote:\n> Mark Levedahl wrote:\n>\n>> Subtests 6, 7, and 9 rely test that merge-recursive correctly\n>> ignores whitespace when so directed. Change the particular whitespace\n>> sequences to be ones that are not known line endings so the whitespace\n>> is not changed when being extracted by line oriented grep.\n> merge-recursive needs to be able to deal with \\r at EOL, too, so if at\n> all possible I would prefer to see the test fixed to pass on Cygwin\n> some other way.\n>\n> Thanks.\n>\nNo line oriented tool is going to avoid this problem. I suppose someone \nwith much more perl skill I possess could write a grep replacement \nexplicitly using binary file modes to fix this. Or, the test could just \ncheck the sha1sum of text.txt against a prestored value, Or the test \ncould use \\r\\n ONLY on systems that do not use that as a line ending \nmode. Or ...\n\nMark\n"},{"id":"223544","messageId":"1374006390-1666-1-git-send-email-mlevedahl@gmail.com","threadId":"34451","inReplyTo":"20130716185933.GO14690@google.com","subject":"[PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2013-07-16T20:26:30Z","receivedAt":"2013-07-16T20:26:30Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Subtests 6, 7, and 9 rely test that merge-recursive correctly\nignores whitespace when so directed. These tests create and test for\nlines ending in \\r\\n, but as this is a valid line separator on Windows,\nconvert such lines in the output to avoid confusion by line-oriented\ngrep.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n t/t3032-merge-recursive-options.sh | 22 +++++++++++++---------\n t/test-lib-functions.sh            |  4 ++++\n 2 files changed, 17 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh\nindex 2b17311..41ba184 100755\n--- a/t/t3032-merge-recursive-options.sh\n+++ b/t/t3032-merge-recursive-options.sh\n@@ -125,13 +125,14 @@ test_expect_success '-Xignore-space-change makes cherry-pick succeed' '\n '\n \n test_expect_success '--ignore-space-change: our w/s-only change wins' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tcat <<-\\EOF >expected &&\n \t    justice and holiness and is the nurse of his age and theQ\n \tEOF\n \n \tgit read-tree --reset -u HEAD &&\n \tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n-\tgrep \"justice and holiness\" text.txt >actual &&\n+\tcr_to_q <text.txt > text.txt+ &&\n+\tgrep \"justice and holiness\" text.txt+ >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -150,14 +151,15 @@ test_expect_success '--ignore-space-change: does not ignore new spaces' '\n \tcat <<-\\EOF >expected1 &&\n \tWell said, Cephalus, I replied; but as con cerning justice, what is\n \tEOF\n-\tq_to_cr <<-\\EOF >expected2 &&\n+\tcat <<-\\EOF >expected2 &&\n \tun intentionally; and when he departs to the world below he is not inQ\n \tEOF\n \n \tgit read-tree --reset -u HEAD &&\n \tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n-\tgrep \"Well said\" text.txt >actual1 &&\n-\tgrep \"when he departs\" text.txt >actual2 &&\n+\tcr_to_q <text.txt >text.txt+\n+\tgrep \"Well said\" text.txt+ >actual1 &&\n+\tgrep \"when he departs\" text.txt+ >actual2 &&\n \ttest_cmp expected1 actual1 &&\n \ttest_cmp expected2 actual2\n '\n@@ -174,18 +176,19 @@ test_expect_success '--ignore-all-space drops their new spaces' '\n '\n \n test_expect_success '--ignore-all-space keeps our new spaces' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tcat <<-\\EOF >expected &&\n \tun intentionally; and when he departs to the world below he is not inQ\n \tEOF\n \n \tgit read-tree --reset -u HEAD &&\n \tgit merge-recursive --ignore-all-space HEAD^ -- HEAD remote &&\n-\tgrep \"when he departs\" text.txt >actual &&\n+\tcr_to_q <text.txt >text.txt+ &&\n+\tgrep \"when he departs\" text.txt+ >actual &&\n \ttest_cmp expected actual\n '\n \n test_expect_success '--ignore-space-at-eol' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tcat <<-\\EOF >expected &&\n \t<<<<<<< HEAD\n \tis not in his right mind; ought I to give them back to him?  No oneQ\n \t=======\n@@ -196,7 +199,8 @@ test_expect_success '--ignore-space-at-eol' '\n \tgit read-tree --reset -u HEAD &&\n \ttest_must_fail git merge-recursive --ignore-space-at-eol \\\n \t\t\t\t\t\t HEAD^ -- HEAD remote &&\n-\tconflict_hunks text.txt >actual &&\n+\tcr_to_q <text.txt >text.txt+ &&\n+\tconflict_hunks text.txt+ >actual &&\n \ttest_cmp expected actual\n '\n \ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex a7e9aac..aa8e38f 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -87,6 +87,10 @@ q_to_cr () {\n \ttr Q '\\015'\n }\n \n+cr_to_q () {\n+\ttr '\\015' Q\n+}\n+\n q_to_tab () {\n \ttr Q '\\011'\n }\n-- \n1.8.3.2.0.13\n"},{"id":"223542","messageId":"1374006769-1878-1-git-send-email-mlevedahl@gmail.com","threadId":"34451","inReplyTo":"20130716185933.GO14690@google.com","subject":"[PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2013-07-16T20:32:49Z","receivedAt":"2013-07-16T20:32:49Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Subtests 6, 7, and 9 rely test that merge-recursive correctly\nignores whitespace when so directed. These tests create and test for\nlines ending in \\r\\n, but as this is a valid line separator on Windows,\nconvert such lines in the output to avoid confusion by line-oriented\ngrep.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\nSorry, forgot to copy Jonathan...\n\n t/t3032-merge-recursive-options.sh | 22 +++++++++++++---------\n t/test-lib-functions.sh            |  4 ++++\n 2 files changed, 17 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh\nindex 2b17311..41ba184 100755\n--- a/t/t3032-merge-recursive-options.sh\n+++ b/t/t3032-merge-recursive-options.sh\n@@ -125,13 +125,14 @@ test_expect_success '-Xignore-space-change makes cherry-pick succeed' '\n '\n \n test_expect_success '--ignore-space-change: our w/s-only change wins' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tcat <<-\\EOF >expected &&\n \t    justice and holiness and is the nurse of his age and theQ\n \tEOF\n \n \tgit read-tree --reset -u HEAD &&\n \tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n-\tgrep \"justice and holiness\" text.txt >actual &&\n+\tcr_to_q <text.txt > text.txt+ &&\n+\tgrep \"justice and holiness\" text.txt+ >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -150,14 +151,15 @@ test_expect_success '--ignore-space-change: does not ignore new spaces' '\n \tcat <<-\\EOF >expected1 &&\n \tWell said, Cephalus, I replied; but as con cerning justice, what is\n \tEOF\n-\tq_to_cr <<-\\EOF >expected2 &&\n+\tcat <<-\\EOF >expected2 &&\n \tun intentionally; and when he departs to the world below he is not inQ\n \tEOF\n \n \tgit read-tree --reset -u HEAD &&\n \tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n-\tgrep \"Well said\" text.txt >actual1 &&\n-\tgrep \"when he departs\" text.txt >actual2 &&\n+\tcr_to_q <text.txt >text.txt+\n+\tgrep \"Well said\" text.txt+ >actual1 &&\n+\tgrep \"when he departs\" text.txt+ >actual2 &&\n \ttest_cmp expected1 actual1 &&\n \ttest_cmp expected2 actual2\n '\n@@ -174,18 +176,19 @@ test_expect_success '--ignore-all-space drops their new spaces' '\n '\n \n test_expect_success '--ignore-all-space keeps our new spaces' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tcat <<-\\EOF >expected &&\n \tun intentionally; and when he departs to the world below he is not inQ\n \tEOF\n \n \tgit read-tree --reset -u HEAD &&\n \tgit merge-recursive --ignore-all-space HEAD^ -- HEAD remote &&\n-\tgrep \"when he departs\" text.txt >actual &&\n+\tcr_to_q <text.txt >text.txt+ &&\n+\tgrep \"when he departs\" text.txt+ >actual &&\n \ttest_cmp expected actual\n '\n \n test_expect_success '--ignore-space-at-eol' '\n-\tq_to_cr <<-\\EOF >expected &&\n+\tcat <<-\\EOF >expected &&\n \t<<<<<<< HEAD\n \tis not in his right mind; ought I to give them back to him?  No oneQ\n \t=======\n@@ -196,7 +199,8 @@ test_expect_success '--ignore-space-at-eol' '\n \tgit read-tree --reset -u HEAD &&\n \ttest_must_fail git merge-recursive --ignore-space-at-eol \\\n \t\t\t\t\t\t HEAD^ -- HEAD remote &&\n-\tconflict_hunks text.txt >actual &&\n+\tcr_to_q <text.txt >text.txt+ &&\n+\tconflict_hunks text.txt+ >actual &&\n \ttest_cmp expected actual\n '\n \ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex a7e9aac..aa8e38f 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -87,6 +87,10 @@ q_to_cr () {\n \ttr Q '\\015'\n }\n \n+cr_to_q () {\n+\ttr '\\015' Q\n+}\n+\n q_to_tab () {\n \ttr Q '\\011'\n }\n-- \n1.8.3.2.0.13\n"},{"id":"223602","messageId":"7vtxjt56dc.fsf@alter.siamese.dyndns.org","threadId":"34451","inReplyTo":"1374006769-1878-1-git-send-email-mlevedahl@gmail.com","subject":"Re: [PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-17T19:33:19Z","receivedAt":"2013-07-17T19:33:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Levedahl <mlevedahl@gmail.com> writes:\n\n> Subtests 6, 7, and 9 rely test that merge-recursive correctly\n> ignores whitespace when so directed. These tests create and test for\n> lines ending in \\r\\n, but as this is a valid line separator on Windows,\n> convert such lines in the output to avoid confusion by line-oriented\n> grep.\n>\n> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>\n> ---\n> Sorry, forgot to copy Jonathan...\n\nSounds sensible.  Thanks.\n\n>\n>  t/t3032-merge-recursive-options.sh | 22 +++++++++++++---------\n>  t/test-lib-functions.sh            |  4 ++++\n>  2 files changed, 17 insertions(+), 9 deletions(-)\n>\n> diff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh\n> index 2b17311..41ba184 100755\n> --- a/t/t3032-merge-recursive-options.sh\n> +++ b/t/t3032-merge-recursive-options.sh\n> @@ -125,13 +125,14 @@ test_expect_success '-Xignore-space-change makes cherry-pick succeed' '\n>  '\n>  \n>  test_expect_success '--ignore-space-change: our w/s-only change wins' '\n> -\tq_to_cr <<-\\EOF >expected &&\n> +\tcat <<-\\EOF >expected &&\n>  \t    justice and holiness and is the nurse of his age and theQ\n>  \tEOF\n>  \n>  \tgit read-tree --reset -u HEAD &&\n>  \tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n> -\tgrep \"justice and holiness\" text.txt >actual &&\n> +\tcr_to_q <text.txt > text.txt+ &&\n> +\tgrep \"justice and holiness\" text.txt+ >actual &&\n>  \ttest_cmp expected actual\n>  '\n>  \n> @@ -150,14 +151,15 @@ test_expect_success '--ignore-space-change: does not ignore new spaces' '\n>  \tcat <<-\\EOF >expected1 &&\n>  \tWell said, Cephalus, I replied; but as con cerning justice, what is\n>  \tEOF\n> -\tq_to_cr <<-\\EOF >expected2 &&\n> +\tcat <<-\\EOF >expected2 &&\n>  \tun intentionally; and when he departs to the world below he is not inQ\n>  \tEOF\n>  \n>  \tgit read-tree --reset -u HEAD &&\n>  \tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n> -\tgrep \"Well said\" text.txt >actual1 &&\n> -\tgrep \"when he departs\" text.txt >actual2 &&\n> +\tcr_to_q <text.txt >text.txt+\n> +\tgrep \"Well said\" text.txt+ >actual1 &&\n> +\tgrep \"when he departs\" text.txt+ >actual2 &&\n>  \ttest_cmp expected1 actual1 &&\n>  \ttest_cmp expected2 actual2\n>  '\n> @@ -174,18 +176,19 @@ test_expect_success '--ignore-all-space drops their new spaces' '\n>  '\n>  \n>  test_expect_success '--ignore-all-space keeps our new spaces' '\n> -\tq_to_cr <<-\\EOF >expected &&\n> +\tcat <<-\\EOF >expected &&\n>  \tun intentionally; and when he departs to the world below he is not inQ\n>  \tEOF\n>  \n>  \tgit read-tree --reset -u HEAD &&\n>  \tgit merge-recursive --ignore-all-space HEAD^ -- HEAD remote &&\n> -\tgrep \"when he departs\" text.txt >actual &&\n> +\tcr_to_q <text.txt >text.txt+ &&\n> +\tgrep \"when he departs\" text.txt+ >actual &&\n>  \ttest_cmp expected actual\n>  '\n>  \n>  test_expect_success '--ignore-space-at-eol' '\n> -\tq_to_cr <<-\\EOF >expected &&\n> +\tcat <<-\\EOF >expected &&\n>  \t<<<<<<< HEAD\n>  \tis not in his right mind; ought I to give them back to him?  No oneQ\n>  \t=======\n> @@ -196,7 +199,8 @@ test_expect_success '--ignore-space-at-eol' '\n>  \tgit read-tree --reset -u HEAD &&\n>  \ttest_must_fail git merge-recursive --ignore-space-at-eol \\\n>  \t\t\t\t\t\t HEAD^ -- HEAD remote &&\n> -\tconflict_hunks text.txt >actual &&\n> +\tcr_to_q <text.txt >text.txt+ &&\n> +\tconflict_hunks text.txt+ >actual &&\n>  \ttest_cmp expected actual\n>  '\n>  \n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> index a7e9aac..aa8e38f 100644\n> --- a/t/test-lib-functions.sh\n> +++ b/t/test-lib-functions.sh\n> @@ -87,6 +87,10 @@ q_to_cr () {\n>  \ttr Q '\\015'\n>  }\n>  \n> +cr_to_q () {\n> +\ttr '\\015' Q\n> +}\n> +\n>  q_to_tab () {\n>  \ttr Q '\\011'\n>  }\n"},{"id":"223692","messageId":"51E83DD1.8010109@ramsay1.demon.co.uk","threadId":"34451","inReplyTo":"51E591FF.7030600@gmail.com","subject":"Re: t3032 incompatible with Cygwin/Windows","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-07-18T19:11:13Z","receivedAt":"2013-07-18T19:11:13Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Mark Levedahl wrote:\n> Subtests 6,7, and 9 of t3032 fail on Cygwin, and I presume will fail on \n> msysgit for similar reasons. Looking at test 6, the expected result is a \n> line ending with \\r\\n in text.txt. This line is extracted with grep \n> (grep 'justice and holiness' text.txt > actual), with unavoidable result \n> that on Cygwin the line ending is \\n. This happens because on Cygwin, \n> the text utils are compiled to open files in text mode meaning than \\n \n> and \\r\\n are both recognized as EOL markers. Thus, even though text.txt \n> is an exact match for what is created on Linux, the test fails because \n> \\r\\n cannot be distinguished by the available tools.\n> \n> I'm not sure the right way forward. I did confirm that by substituting \n> \"q_to_tab\" for \"q_to_cr\" in t3032, the test pass on Cygwin and on Linux. \n> Perhaps t3032 should be so amended to avoid use of a non-portable line \n> ending construct?\n\nThis passes for me, on both cygwin and MinGW.\n\nAfter adding a test_pause to test #6:\n\n$ ./t3032-merge-recursive-options.sh -v\n\n...\n\nexpecting success:\n        q_to_cr <<-\\EOF >expected &&\n            justice and holiness and is the nurse of his age and theQ\n        EOF\n\n        git read-tree --reset -u HEAD &&\n        git merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n        grep \"justice and holiness\" text.txt >actual &&\n        test_cmp expected actual &&\n        test_pause\n\nMerging HEAD with remote\nMerging:\n0ab7224 Clarify\nbe82dcf Remove cruft\nfound 1 common ancestor:\nc1e95d9 Initial revision\nAuto-merging text.txt\n$ xxd expected\n0000000: 2020 2020 6a75 7374 6963 6520 616e 6420      justice and\n0000010: 686f 6c69 6e65 7373 2061 6e64 2069 7320  holiness and is\n0000020: 7468 6520 6e75 7273 6520 6f66 2068 6973  the nurse of his\n0000030: 2061 6765 2061 6e64 2074 6865 0d0a        age and the..\n$ xxd actual\n0000000: 2020 2020 6a75 7374 6963 6520 616e 6420      justice and\n0000010: 686f 6c69 6e65 7373 2061 6e64 2069 7320  holiness and is\n0000020: 7468 6520 6e75 7273 6520 6f66 2068 6973  the nurse of his\n0000030: 2061 6765 2061 6e64 2074 6865 0d0a        age and the..\n$ grep \"justice and holiness\" text.txt | xxd\n0000000: 2020 2020 6a75 7374 6963 6520 616e 6420      justice and\n0000010: 686f 6c69 6e65 7373 2061 6e64 2069 7320  holiness and is\n0000020: 7468 6520 6e75 7273 6520 6f66 2068 6973  the nurse of his\n0000030: 2061 6765 2061 6e64 2074 6865 0d0a        age and the..\n$ exit\n\n...\n\n# passed all 11 test(s)\n1..11\n$ \n\nATB,\nRamsay Jones\n"},{"id":"223691","messageId":"51E83FA7.5080706@ramsay1.demon.co.uk","threadId":"34451","inReplyTo":"20130716185933.GO14690@google.com","subject":"Re: [PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-07-18T19:19:03Z","receivedAt":"2013-07-18T19:19:03Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Jonathan Nieder wrote:\n> Mark Levedahl wrote:\n> \n>> Subtests 6, 7, and 9 rely test that merge-recursive correctly\n>> ignores whitespace when so directed. Change the particular whitespace\n>> sequences to be ones that are not known line endings so the whitespace\n>> is not changed when being extracted by line oriented grep.\n> \n> merge-recursive needs to be able to deal with \\r at EOL, too, so if at\n> all possible I would prefer to see the test fixed to pass on Cygwin\n> some other way.\n\nMaybe use -U/--binary option to grep? Indeed, if you look at the top of\nthat test file, you will see:\n\n    test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b\n    test_have_prereq MINGW && export GREP_OPTIONS=-U\n\nwhich may explain why it works for me on MinGW, but not why it works on\ncygwin 1.5.\n\nATB,\nRamsay Jones\n"},{"id":"223710","messageId":"1374183897-11408-1-git-send-email-mlevedahl@gmail.com","threadId":"34451","inReplyTo":"7vtxjt56dc.fsf@alter.siamese.dyndns.org","subject":"[PATCH] test-lib.sh - define and use GREP_STRIPS_CR","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2013-07-18T21:44:57Z","receivedAt":"2013-07-18T21:44:57Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Define a common macro for grep needing -U to allow tests to not need\nto inquire of specific platforms needing this option. Change\nt3032 and t5560 to use this rather than testing explicitly for mingw.\nThis fixes these two tests on Cygwin.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\nThis replaces my earlier patch against t3032 (8896b287 on pu)\n\n t/t3032-merge-recursive-options.sh | 2 +-\n t/t5560-http-backend-noserver.sh   | 2 +-\n t/test-lib.sh                      | 2 ++\n 3 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh\nindex 2b17311..5fd7bbb 100755\n--- a/t/t3032-merge-recursive-options.sh\n+++ b/t/t3032-merge-recursive-options.sh\n@@ -14,7 +14,7 @@ test_description='merge-recursive options\n . ./test-lib.sh\n \n test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b\n-test_have_prereq MINGW && export GREP_OPTIONS=-U\n+test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U\n \n test_expect_success 'setup' '\n \tconflict_hunks () {\ndiff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh\nindex ef98d95..9be9ae3 100755\n--- a/t/t5560-http-backend-noserver.sh\n+++ b/t/t5560-http-backend-noserver.sh\n@@ -5,7 +5,7 @@ test_description='test git-http-backend-noserver'\n \n HTTPD_DOCUMENT_ROOT_PATH=\"$TRASH_DIRECTORY\"\n \n-test_have_prereq MINGW && export GREP_OPTIONS=-U\n+test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U\n \n run_backend() {\n \techo \"$2\" |\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 2d63307..1abea40 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -824,6 +824,7 @@ case $(uname -s) in\n \ttest_set_prereq MINGW\n \ttest_set_prereq NOT_CYGWIN\n \ttest_set_prereq SED_STRIPS_CR\n+\ttest_set_prereq GREP_STRIPS_CR\n \t;;\n *CYGWIN*)\n \ttest_set_prereq POSIXPERM\n@@ -831,6 +832,7 @@ case $(uname -s) in\n \ttest_set_prereq NOT_MINGW\n \ttest_set_prereq CYGWIN\n \ttest_set_prereq SED_STRIPS_CR\n+\ttest_set_prereq GREP_STRIPS_CR\n \t;;\n *)\n \ttest_set_prereq POSIXPERM\n-- \n1.8.3.2.0.13\n"},{"id":"223709","messageId":"51E8625E.6020808@gmail.com","threadId":"34451","inReplyTo":"51E83FA7.5080706@ramsay1.demon.co.uk","subject":"Re: [PATCH] t3032 - make compatible with systems using \\r\\n as a line ending","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2013-07-18T21:47:10Z","receivedAt":"2013-07-18T21:47:10Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"On 07/18/2013 03:19 PM, Ramsay Jones wrote:\n> Jonathan Nieder wrote:\n>> Mark Levedahl wrote:\n>>\n>>> Subtests 6, 7, and 9 rely test that merge-recursive correctly\n>>> ignores whitespace when so directed. Change the particular whitespace\n>>> sequences to be ones that are not known line endings so the whitespace\n>>> is not changed when being extracted by line oriented grep.\n>> merge-recursive needs to be able to deal with \\r at EOL, too, so if at\n>> all possible I would prefer to see the test fixed to pass on Cygwin\n>> some other way.\n> Maybe use -U/--binary option to grep? Indeed, if you look at the top of\n> that test file, you will see:\n>\n>      test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b\n>      test_have_prereq MINGW && export GREP_OPTIONS=-U\n>\n> which may explain why it works for me on MinGW, but not why it works on\n> cygwin 1.5.\n>\n> ATB,\n> Ramsay Jones\n>\n>\n>\n>\n>\nThanks, hadn't noticed that, it leads to a much better patch.\n\nMark\n"},{"id":"223859","messageId":"51EAE7F6.3080509@ramsay1.demon.co.uk","threadId":"34451","inReplyTo":"1374183897-11408-1-git-send-email-mlevedahl@gmail.com","subject":"Re: [PATCH] test-lib.sh - define and use GREP_STRIPS_CR","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-07-20T19:41:42Z","receivedAt":"2013-07-20T19:41:42Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Mark Levedahl wrote:\n> Define a common macro for grep needing -U to allow tests to not need\n> to inquire of specific platforms needing this option. Change\n> t3032 and t5560 to use this rather than testing explicitly for mingw.\n> This fixes these two tests on Cygwin.\n> \n> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>\n> ---\n> This replaces my earlier patch against t3032 (8896b287 on pu)\n\nYep, this looks good and (as expected) it works on cygwin 1.5 too. :-D\n\nThanks.\n\nATB,\nRamsay Jones\n"},{"id":"223890","messageId":"7vip03sjyk.fsf@alter.siamese.dyndns.org","threadId":"34451","inReplyTo":"51EAE7F6.3080509@ramsay1.demon.co.uk","subject":"Re: [PATCH] test-lib.sh - define and use GREP_STRIPS_CR","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-21T21:04:51Z","receivedAt":"2013-07-21T21:04:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Mark Levedahl wrote:\n>> Define a common macro for grep needing -U to allow tests to not need\n>> to inquire of specific platforms needing this option. Change\n>> t3032 and t5560 to use this rather than testing explicitly for mingw.\n>> This fixes these two tests on Cygwin.\n>> \n>> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>\n>> ---\n>> This replaces my earlier patch against t3032 (8896b287 on pu)\n>\n> Yep, this looks good and (as expected) it works on cygwin 1.5 too. :-D\n>\n> Thanks.\n\nAfter this patch lands 'master', we may want to add a note to these\nSED/GREP workarounds for CRLF platforms that we assume the platform\nuse GNU sed/grep.\n\nIncidentally, don't we also need \"unset SED_OPTIONS\" in\nt/test-lib.sh net to where we unset GREP_OPTIONS?\n"}]}