{"thread":{"id":"39104","subject":"[PATCH v2 2/2] t0027: Support NATIVE_CRLF","startedAt":"2015-04-17T15:44:05Z","lastAt":"2015-04-18T14:54:03Z","messageCount":7,"participants":["Torsten Bögershausen","Johannes Schindelin","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"259570","messageId":"55312A45.8060008@web.de","threadId":"39104","inReplyTo":null,"subject":"[PATCH v2 2/2] t0027: Support NATIVE_CRLF","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-04-17T15:44:05Z","receivedAt":"2015-04-17T15:44:05Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Without this patch, t0027 expects the native end-of-lines to be a single\nline feed character. On Windows, however, we set it to a carriage return\ncharacter followed by a line feed character. Thus, we have to modify\nt0027 to expect different warnings depending on the end-of-line markers.\n\nAdjust the check of the warnings and use these macros:\n  WILC:  Warn if LF becomes CRLF\n  WICL:  Warn if CRLF becomes LF\n  WAMIX: Mixed line endings: either CRLF->LF or LF->CRLF\n\nImprove the information given by check_warning():\nUse test_cmp to show which warning is missing (or should'n t be there)\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/t0027-auto-crlf.sh | 30 ++++++++++++++++++++----------\n 1 file changed, 20 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh\nindex 5858397..8975b97 100755\n--- a/t/t0027-auto-crlf.sh\n+++ b/t/t0027-auto-crlf.sh\n@@ -57,15 +57,13 @@ create_gitattributes () {\n \n check_warning () {\n \tcase \"$1\" in\n-\tLF_CRLF) grep \"LF will be replaced by CRLF\" $2;;\n-\tCRLF_LF) grep \"CRLF will be replaced by LF\" $2;;\n-\t'')\n-\t\t>expect\n-\t\tgrep \"will be replaced by\" $2 >actual\n-\t\ttest_cmp expect actual\n-\t\t;;\n-\t*) false ;;\n+\tLF_CRLF) echo \"warning: LF will be replaced by CRLF\" >\"$2\".expect ;;\n+\tCRLF_LF) echo \"warning: CRLF will be replaced by LF\" >\"$2\".expect ;;\n+\t'')\t                                                 >\"$2\".expect ;;\n+\t*) echo >&2 \"Illegal 1\": \"$1\" ; return false ;;\n \tesac\n+\tgrep \"will be replaced by\" \"$2\" | sed -e \"s/\\(.*\\) in [^ ]*$/\\1/\" >\"$2\".actual\n+\ttest_cmp \"$2\".expect \"$2\".actual\n }\n \n commit_check_warn () {\n@@ -169,6 +167,18 @@ test_expect_success 'setup master' '\n warn_LF_CRLF=\"LF will be replaced by CRLF\"\n warn_CRLF_LF=\"CRLF will be replaced by LF\"\n \n+#WILC means \"Warn if (this OS) converts LF into CRLF\"\n+if test_have_prereq NATIVE_CRLF\n+then\n+WILC=LF_CRLF\n+WICL=\n+WAMIX=LF_CRLF\n+else\n+WILC=\n+WICL=CRLF_LF\n+WAMIX=CRLF_LF\n+fi\n+\n test_expect_success 'commit files empty attr' '\n \tcommit_check_warn false \"\"     \"\"        \"\"        \"\"        \"\"        \"\" &&\n \tcommit_check_warn true  \"\"     \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n@@ -176,13 +186,13 @@ test_expect_success 'commit files empty attr' '\n '\n \n test_expect_success 'commit files attr=auto' '\n-\tcommit_check_warn false \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\" &&\n+\tcommit_check_warn false \"auto\" \"$WILC\"  \"$WICL\"    \"$WAMIX\"  \"\"        \"\" &&\n \tcommit_check_warn true  \"auto\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"\"        \"\" &&\n \tcommit_check_warn input \"auto\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"\"\n '\n \n test_expect_success 'commit files attr=text' '\n-\tcommit_check_warn false \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\" &&\n+\tcommit_check_warn false \"text\" \"$WILC\"  \"$WICL\"    \"$WAMIX\"  \"$WILC\"  \"$WICL\" &&\n \tcommit_check_warn true  \"text\" \"LF_CRLF\" \"\"        \"LF_CRLF\" \"LF_CRLF\" \"\"        &&\n \tcommit_check_warn input \"text\" \"\"        \"CRLF_LF\" \"CRLF_LF\" \"\"        \"CRLF_LF\"\n '\n-- \n2.2.0.rc1.790.ge19fcd2\n"},{"id":"259573","messageId":"55313C3C.1090504@web.de","threadId":"39104","inReplyTo":"55312A45.8060008@web.de","subject":"Re: [PATCH v2 2/2] t0027: Support NATIVE_CRLF","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-04-17T17:00:44Z","receivedAt":"2015-04-17T17:00:44Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2015-04-17 17.44, Torsten Bögershausen wrote:\n> Without this patch, t0027 expects the native end-of-lines to be a single\n> line feed character. On Windows, however, we set it to a carriage return\n> character followed by a line feed character. Thus, we have to modify\n> t0027 to expect different warnings depending on the end-of-line markers.\n>\n> Adjust the check of the warnings and use these macros:\n>   WILC:  Warn if LF becomes CRLF\n>   WICL:  Warn if CRLF becomes LF\n>   WAMIX: Mixed line endings: either CRLF->LF or LF->CRLF\n>\n> Improve the information given by check_warning():\n> Use test_cmp to show which warning is missing (or should'n t be there)\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\nOriginally I wanted to have Dscho as \"Author\", is that OK with you ?\n(But the \"From:\" line didn't made it through my email program)\n \n"},{"id":"259589","messageId":"6e6620d53e9378d3c539c3d1f9cdac0d@www.dscho.org","threadId":"39104","inReplyTo":"55313C3C.1090504@web.de","subject":"Re: [PATCH v2 2/2] t0027: Support NATIVE_CRLF","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-04-17T19:37:47Z","receivedAt":"2015-04-17T19:37:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Torsten,\n\nOn 2015-04-17 19:00, Torsten Bögershausen wrote:\n> On 2015-04-17 17.44, Torsten Bögershausen wrote:\n>> Without this patch, t0027 expects the native end-of-lines to be a single\n>> line feed character. On Windows, however, we set it to a carriage return\n>> character followed by a line feed character. Thus, we have to modify\n>> t0027 to expect different warnings depending on the end-of-line markers.\n>>\n>> Adjust the check of the warnings and use these macros:\n>>   WILC:  Warn if LF becomes CRLF\n>>   WICL:  Warn if CRLF becomes LF\n>>   WAMIX: Mixed line endings: either CRLF->LF or LF->CRLF\n>>\n>> Improve the information given by check_warning():\n>> Use test_cmp to show which warning is missing (or should'n t be there)\n>>\n>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> Originally I wanted to have Dscho as \"Author\", is that OK with you ?\n> (But the \"From:\" line didn't made it through my email program)\n\nNo worries.\nDscho\n"},{"id":"259590","messageId":"1db9b0b7322c3b8b8e7a76b29b020ad8@www.dscho.org","threadId":"39104","inReplyTo":"55312A45.8060008@web.de","subject":"Re: [PATCH v2 2/2] t0027: Support NATIVE_CRLF","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-04-17T19:55:24Z","receivedAt":"2015-04-17T19:55:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Torsten,\n\nOn 2015-04-17 17:44, Torsten Bögershausen wrote:\n> Without this patch, t0027 expects the native end-of-lines to be a single\n> line feed character. On Windows, however, we set it to a carriage return\n> character followed by a line feed character. Thus, we have to modify\n> t0027 to expect different warnings depending on the end-of-line markers.\n> \n> Adjust the check of the warnings and use these macros:\n>   WILC:  Warn if LF becomes CRLF\n>   WICL:  Warn if CRLF becomes LF\n>   WAMIX: Mixed line endings: either CRLF->LF or LF->CRLF\n> \n> Improve the information given by check_warning():\n> Use test_cmp to show which warning is missing (or should'n t be there)\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n\nThank you so much!\nDscho\n"},{"id":"259595","messageId":"CAPig+cS6XELr0zEa_SiCM25rQENerEtBS9xVeLi4sc61nAa6Mg@mail.gmail.com","threadId":"39104","inReplyTo":"55312A45.8060008@web.de","subject":"Re: [PATCH v2 2/2] t0027: Support NATIVE_CRLF","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-04-17T20:44:09Z","receivedAt":"2015-04-17T20:44:09Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Apr 17, 2015 at 11:44 AM, Torsten Bögershausen <tboegi@web.de> wrote:\n> Without this patch, t0027 expects the native end-of-lines to be a single\n> line feed character. On Windows, however, we set it to a carriage return\n> character followed by a line feed character. Thus, we have to modify\n> t0027 to expect different warnings depending on the end-of-line markers.\n>\n> Adjust the check of the warnings and use these macros:\n>   WILC:  Warn if LF becomes CRLF\n>   WICL:  Warn if CRLF becomes LF\n>   WAMIX: Mixed line endings: either CRLF->LF or LF->CRLF\n>\n> Improve the information given by check_warning():\n> Use test_cmp to show which warning is missing (or should'n t be there)\n\ns/should'n t/shouldn't/\n\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n"},{"id":"259598","messageId":"xmqq8udqpius.fsf@gitster.dls.corp.google.com","threadId":"39104","inReplyTo":"1db9b0b7322c3b8b8e7a76b29b020ad8@www.dscho.org","subject":"Re: [PATCH v2 2/2] t0027: Support NATIVE_CRLF","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-17T21:04:11Z","receivedAt":"2015-04-17T21:04:11Z","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 Torsten,\n>\n> On 2015-04-17 17:44, Torsten Bögershausen wrote:\n>> Without this patch, t0027 expects the native end-of-lines to be a single\n>> line feed character. On Windows, however, we set it to a carriage return\n>> character followed by a line feed character. Thus, we have to modify\n>> t0027 to expect different warnings depending on the end-of-line markers.\n>> \n>> Adjust the check of the warnings and use these macros:\n>>   WILC:  Warn if LF becomes CRLF\n>>   WICL:  Warn if CRLF becomes LF\n>>   WAMIX: Mixed line endings: either CRLF->LF or LF->CRLF\n>> \n>> Improve the information given by check_warning():\n>> Use test_cmp to show which warning is missing (or should'n t be there)\n>> \n>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>\n> Thank you so much!\n> Dscho\n\nThanks, is that \"Acked-by: Dscho\" for both patches?\n"},{"id":"259628","messageId":"7216168da473ed5cda5b16bca236a3ec@www.dscho.org","threadId":"39104","inReplyTo":"xmqq8udqpius.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2 2/2] t0027: Support NATIVE_CRLF","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-04-18T14:54:03Z","receivedAt":"2015-04-18T14:54:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn 2015-04-17 23:04, Junio C Hamano wrote:\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n>> On 2015-04-17 17:44, Torsten Bögershausen wrote:\n>>> Without this patch, t0027 expects the native end-of-lines to be a single\n>>> line feed character. On Windows, however, we set it to a carriage return\n>>> character followed by a line feed character. Thus, we have to modify\n>>> t0027 to expect different warnings depending on the end-of-line markers.\n>>>\n>>> Adjust the check of the warnings and use these macros:\n>>>   WILC:  Warn if LF becomes CRLF\n>>>   WICL:  Warn if CRLF becomes LF\n>>>   WAMIX: Mixed line endings: either CRLF->LF or LF->CRLF\n>>>\n>>> Improve the information given by check_warning():\n>>> Use test_cmp to show which warning is missing (or should'n t be there)\n>>>\n>>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>>\n>> Thank you so much!\n>> Dscho\n> \n> Thanks, is that \"Acked-by: Dscho\" for both patches?\n\nOops, yes:\n\nAcked-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSorry!\nDscho\n"}]}