{"thread":{"id":"37462","subject":"[PATCH v3 2/2] MinGW: Update tests to handle a native eol of crlf","startedAt":"2014-08-30T21:39:07Z","lastAt":"2014-09-03T18:19:19Z","messageCount":5,"participants":["Torsten Bögershausen","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":2},"messages":[{"id":"248666","messageId":"5402447B.3080700@web.de","threadId":"37462","inReplyTo":null,"subject":"[PATCH v3 2/2] MinGW: Update tests to handle a native eol of crlf","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-08-30T21:39:07Z","receivedAt":"2014-08-30T21:39:07Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Integrate commit b1d07649588102 from msysgit:\n  MinGW: Update tests to handle a native eol of crlf\n\n  Some of the tests were written with the assumption that the native eol would\n  always be lf. After defining NATIVE_CRLF on MinGW, these tests began failing.\n  This change will update the tests to also handle a native eol of crlf.\n\n  Signed-off-by: Brice Lambson <bricelam@live.com>\n\nOn top of that, fix the broken && chain in t0026\n\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/t0026-eol-config.sh      |  6 +++---\n t/t6038-merge-text-auto.sh | 54 +++++++++++++++++++++++++++++-----------------\n t/test-lib.sh              |  1 +\n 3 files changed, 38 insertions(+), 23 deletions(-)\n\ndiff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh\nindex 43a580a..4806969 100755\n--- a/t/t0026-eol-config.sh\n+++ b/t/t0026-eol-config.sh\n@@ -84,9 +84,9 @@ test_expect_success NATIVE_CRLF 'eol native is crlf' '\n \n \trm -rf native_eol && mkdir native_eol &&\n \t( cd native_eol &&\n-\tprintf \"*.txt text\\n\" > .gitattributes\n-\tprintf \"one\\r\\ntwo\\r\\nthree\\r\\n\" > filedos.txt\n-\tprintf \"one\\ntwo\\nthree\\n\" > fileunix.txt\n+\tprintf \"*.txt text\\n\" > .gitattributes &&\n+\tprintf \"one\\r\\ntwo\\r\\nthree\\r\\n\" > filedos.txt &&\n+\tprintf \"one\\ntwo\\nthree\\n\" > fileunix.txt &&\n \tgit init &&\n \tgit config core.autocrlf false &&\n \tgit config core.eol native &&\ndiff --git a/t/t6038-merge-text-auto.sh b/t/t6038-merge-text-auto.sh\nindex d9c2d38..85c10b0 100755\n--- a/t/t6038-merge-text-auto.sh\n+++ b/t/t6038-merge-text-auto.sh\n@@ -72,6 +72,10 @@ test_expect_success 'Merge after setting text=auto' '\n \tsame line\n \tEOF\n \n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\tappend_cr <expected >expected.temp &&\n+\t\tmv expected.temp expected\n+\tfi &&\n \tgit config merge.renormalize true &&\n \tgit rm -fr . &&\n \trm -f .gitattributes &&\n@@ -86,6 +90,10 @@ test_expect_success 'Merge addition of text=auto' '\n \tsame line\n \tEOF\n \n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\tappend_cr <expected >expected.temp &&\n+\t\tmv expected.temp expected\n+\tfi &&\n \tgit config merge.renormalize true &&\n \tgit rm -fr . &&\n \trm -f .gitattributes &&\n@@ -95,16 +103,19 @@ test_expect_success 'Merge addition of text=auto' '\n '\n \n test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '\n-\tq_to_cr <<-\\EOF >expected &&\n-\t<<<<<<<\n-\tfirst line\n-\tsame line\n-\t=======\n-\tfirst lineQ\n-\tsame lineQ\n-\t>>>>>>>\n-\tEOF\n-\n+\techo \"<<<<<<<\" >expected &&\n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\techo first line | append_cr >>expected &&\n+\t\techo same line | append_cr >>expected &&\n+\t\techo ======= | append_cr >>expected\n+\telse\n+\t\techo first line >>expected &&\n+\t\techo same line >>expected &&\n+\t\techo ======= >>expected\n+\tfi &&\n+\techo first line | append_cr >>expected &&\n+\techo same line | append_cr >>expected &&\n+\techo \">>>>>>>\" >>expected &&\n \tgit config merge.renormalize false &&\n \trm -f .gitattributes &&\n \tgit reset --hard a &&\n@@ -114,16 +125,19 @@ test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '\n '\n \n test_expect_success 'Detect LF/CRLF conflict from addition of text=auto' '\n-\tq_to_cr <<-\\EOF >expected &&\n-\t<<<<<<<\n-\tfirst lineQ\n-\tsame lineQ\n-\t=======\n-\tfirst line\n-\tsame line\n-\t>>>>>>>\n-\tEOF\n-\n+\techo \"<<<<<<<\" >expected &&\n+\techo first line | append_cr >>expected &&\n+\techo same line | append_cr >>expected &&\n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\techo ======= | append_cr >>expected &&\n+\t\techo first line | append_cr >>expected &&\n+\t\techo same line | append_cr >>expected\n+\telse\n+\t\techo ======= >>expected &&\n+\t\techo first line >>expected &&\n+\t\techo same line >>expected\n+\tfi &&\n+\techo \">>>>>>>\" >>expected &&\n \tgit config merge.renormalize false &&\n \trm -f .gitattributes &&\n \tgit reset --hard b &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b1bc65b..aceb418 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -871,6 +871,7 @@ case $(uname -s) in\n \t# exec does not inherit the PID\n \ttest_set_prereq MINGW\n \ttest_set_prereq NOT_CYGWIN\n+\ttest_set_prereq NATIVE_CRLF\n \ttest_set_prereq SED_STRIPS_CR\n \ttest_set_prereq GREP_STRIPS_CR\n \tGIT_TEST_CMP=mingw_test_cmp\n-- \n2.1.0.rc2.210.g636bceb\n"},{"id":"248730","messageId":"xmqq1trt25zt.fsf@gitster.dls.corp.google.com","threadId":"37462","inReplyTo":"5402447B.3080700@web.de","subject":"Re: [PATCH v3 2/2] MinGW: Update tests to handle a native eol of crlf","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-02T19:10:30Z","receivedAt":"2014-09-02T19:10:30Z","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> Integrate commit b1d07649588102 from msysgit:\n>   MinGW: Update tests to handle a native eol of crlf\n>\n>   Some of the tests were written with the assumption that the native eol would\n>   always be lf. After defining NATIVE_CRLF on MinGW, these tests began failing.\n>   This change will update the tests to also handle a native eol of crlf.\n>\n>   Signed-off-by: Brice Lambson <bricelam@live.com>\n>\n> On top of that, fix the broken && chain in t0026\n>\n> Helped-by: Eric Sunshine <sunshine@sunshineco.com>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n\nShould this be marked with \"From: Brice Lambson <bricelam@live.com>\"?\n\nThanks.\n"},{"id":"248735","messageId":"54062052.3070106@web.de","threadId":"37462","inReplyTo":"xmqq1trt25zt.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v3 2/2] MinGW: Update tests to handle a native eol of crlf","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-09-02T19:53:54Z","receivedAt":"2014-09-02T19:53:54Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2014-09-02 21.10, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>> Integrate commit b1d07649588102 from msysgit:\n>>   MinGW: Update tests to handle a native eol of crlf\n>>\n>>   Some of the tests were written with the assumption that the native eol would\n>>   always be lf. After defining NATIVE_CRLF on MinGW, these tests began failing.\n>>   This change will update the tests to also handle a native eol of crlf.\n>>\n>>   Signed-off-by: Brice Lambson <bricelam@live.com>\n>>\n>> On top of that, fix the broken && chain in t0026\n>>\n>> Helped-by: Eric Sunshine <sunshine@sunshineco.com>\n>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>> ---\n> \n> Should this be marked with \"From: Brice Lambson <bricelam@live.com>\"?\n> \n> Thanks.\nYes. If possible please squeeze.\n"},{"id":"248736","messageId":"xmqqk35lzr0u.fsf@gitster.dls.corp.google.com","threadId":"37462","inReplyTo":"54062052.3070106@web.de","subject":"Re: [PATCH v3 2/2] MinGW: Update tests to handle a native eol of crlf","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-02T20:49:53Z","receivedAt":"2014-09-02T20:49:53Z","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>> Should this be marked with \"From: Brice Lambson <bricelam@live.com>\"?\n>> \n>> Thanks.\n> Yes. If possible please squeeze.\n\nOK, thanks.  Please double check the result on 'pu' in several\nhours.\n"},{"id":"248791","messageId":"54075BA7.2090101@web.de","threadId":"37462","inReplyTo":"xmqqk35lzr0u.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v3 2/2] MinGW: Update tests to handle a native eol of crlf","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-09-03T18:19:19Z","receivedAt":"2014-09-03T18:19:19Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2014-09-02 22.49, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>>> Should this be marked with \"From: Brice Lambson <bricelam@live.com>\"?\n>>>\n>>> Thanks.\n>> Yes. If possible please squeeze.\n> \n> OK, thanks.  Please double check the result on 'pu' in several\n> hours.\nExcellent\n\nt0027 and t0026 passed under Cygwin, MysGit and Mac OS.\n(after reverting \"use timer_settime() for new platforms\", but that is a different story)\n\nMany thanks for helping me out and bringing this forward.\n"}]}