{"thread":{"id":"37402","subject":"[PATCH v2 1/3] Push the NATIVE_CRLF Makefile variable to C and added a test for native.","startedAt":"2014-08-22T19:18:57Z","lastAt":"2014-08-25T17:36:09Z","messageCount":4,"participants":["Torsten Bögershausen","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"248137","messageId":"53F797A1.1060804@web.de","threadId":"37402","inReplyTo":null,"subject":"[PATCH v2 1/3] Push the NATIVE_CRLF Makefile variable to C and added a test for native.","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-08-22T19:18:57Z","receivedAt":"2014-08-22T19:18:57Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is\nincorrectly set on Mingw git. However, the Makefile variable is not\npropagated to the C preprocessor and results in no change. This patch\npushes the definition to the C code and adds a test to validate that\nwhen core.eol as native is crlf, we actually normalize text files to this\nline ending convention when core.autocrlf is false.\n\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\nSigned-off-by: Stepan Kasal <kasal@ucw.cz>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n\nThis mini series mainly updates git.git with patches from msysgit:\nPatch 1 is taken \"as is\",\nPatch 2 is taken \"as is\",\nand Patch 3 is the outcome of the code-review \n\nThanks for careful reading\n\n\n Makefile              |  3 +++\n t/t0026-eol-config.sh | 18 ++++++++++++++++++\n 2 files changed, 21 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 2320de5..517036e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1479,6 +1479,9 @@ ifdef NO_REGEX\n \tCOMPAT_CFLAGS += -Icompat/regex\n \tCOMPAT_OBJS += compat/regex/regex.o\n endif\n+ifdef NATIVE_CRLF\n+\tBASIC_CFLAGS += -DNATIVE_CRLF\n+endif\n \n ifdef USE_NED_ALLOCATOR\n        COMPAT_CFLAGS += -Icompat/nedmalloc\ndiff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh\nindex 4807b0f..43a580a 100755\n--- a/t/t0026-eol-config.sh\n+++ b/t/t0026-eol-config.sh\n@@ -80,4 +80,22 @@ test_expect_success 'autocrlf=true overrides unset eol' '\n \ttest -z \"$onediff\" && test -z \"$twodiff\"\n '\n \n+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+\tgit init &&\n+\tgit config core.autocrlf false &&\n+\tgit config core.eol native &&\n+\tgit add filedos.txt fileunix.txt &&\n+\tgit commit -m \"first\" &&\n+\trm file*.txt &&\n+\tgit reset --hard HEAD &&\n+\thas_cr filedos.txt && has_cr fileunix.txt\n+\t)\n+'\n+\n test_done\n-- \n2.1.0.rc2.210.g636bceb\n"},{"id":"248167","messageId":"xmqq61hknnjo.fsf@gitster.dls.corp.google.com","threadId":"37402","inReplyTo":"53F797A1.1060804@web.de","subject":"Re: [PATCH v2 1/3] Push the NATIVE_CRLF Makefile variable to C and added a test for native.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-08-22T22:54:03Z","receivedAt":"2014-08-22T22:54:03Z","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> Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is\n> incorrectly set on Mingw git. However, the Makefile variable is not\n> propagated to the C preprocessor and results in no change. This patch\n> pushes the definition to the C code and adds a test to validate that\n> when core.eol as native is crlf, we actually normalize text files to this\n> line ending convention when core.autocrlf is false.\n>\n> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n> Signed-off-by: Stepan Kasal <kasal@ucw.cz>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n\nWho should I record as the author of this patch?\n\n>\n> This mini series mainly updates git.git with patches from msysgit:\n> Patch 1 is taken \"as is\",\n> Patch 2 is taken \"as is\",\n> and Patch 3 is the outcome of the code-review \n>\n> Thanks for careful reading\n>\n>\n>  Makefile              |  3 +++\n>  t/t0026-eol-config.sh | 18 ++++++++++++++++++\n>  2 files changed, 21 insertions(+)\n>\n> diff --git a/Makefile b/Makefile\n> index 2320de5..517036e 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1479,6 +1479,9 @@ ifdef NO_REGEX\n>  \tCOMPAT_CFLAGS += -Icompat/regex\n>  \tCOMPAT_OBJS += compat/regex/regex.o\n>  endif\n> +ifdef NATIVE_CRLF\n> +\tBASIC_CFLAGS += -DNATIVE_CRLF\n> +endif\n>  \n>  ifdef USE_NED_ALLOCATOR\n>         COMPAT_CFLAGS += -Icompat/nedmalloc\n> diff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh\n> index 4807b0f..43a580a 100755\n> --- a/t/t0026-eol-config.sh\n> +++ b/t/t0026-eol-config.sh\n> @@ -80,4 +80,22 @@ test_expect_success 'autocrlf=true overrides unset eol' '\n>  \ttest -z \"$onediff\" && test -z \"$twodiff\"\n>  '\n>  \n> +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\nI think I saw a few style fixes sent against the previous round of\npatches; have you missed them?\n\n> +\tgit init &&\n> +\tgit config core.autocrlf false &&\n> +\tgit config core.eol native &&\n> +\tgit add filedos.txt fileunix.txt &&\n> +\tgit commit -m \"first\" &&\n> +\trm file*.txt &&\n> +\tgit reset --hard HEAD &&\n> +\thas_cr filedos.txt && has_cr fileunix.txt\n> +\t)\n> +'\n> +\n>  test_done\n"},{"id":"248179","messageId":"53F83321.1060906@web.de","threadId":"37402","inReplyTo":"xmqq61hknnjo.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2 1/3] Push the NATIVE_CRLF Makefile variable to C and added a test for native.","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-08-23T06:22:25Z","receivedAt":"2014-08-23T06:22:25Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2014-08-23 00.54, Junio C Hamano wrote:\n> Torsten Bögershausen <tboegi@web.de> writes:\n> \n>> Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is\n>> incorrectly set on Mingw git. However, the Makefile variable is not\n>> propagated to the C preprocessor and results in no change. This patch\n>> pushes the definition to the C code and adds a test to validate that\n>> when core.eol as native is crlf, we actually normalize text files to this\n>> line ending convention when core.autocrlf is false.\n>>\n>> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n>> Signed-off-by: Stepan Kasal <kasal@ucw.cz>\n>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>> ---\n> \n> Who should I record as the author of this patch?\n> \n\nSorry for missing this, here is what Mingw says: \n\ncommit 0caba2cacbb9d8e6a31783b45f1a13e52dec6ce8\nAuthor: Pat Thoyts <patthoyts@users.sourceforge.net>\nDate:   Mon Nov 26 00:24:00 2012 +0000\n\n    Push the NATIVE_CRLF Makefile variable to C and added a test for native.\n    \n    Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is\n[]\n"},{"id":"248244","messageId":"xmqqr404mpyu.fsf@gitster.dls.corp.google.com","threadId":"37402","inReplyTo":"53F83321.1060906@web.de","subject":"Re: [PATCH v2 1/3] Push the NATIVE_CRLF Makefile variable to C and added a test for native.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-08-25T17:36:09Z","receivedAt":"2014-08-25T17:36:09Z","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 2014-08-23 00.54, Junio C Hamano wrote:\n>> Torsten Bögershausen <tboegi@web.de> writes:\n>> \n>>> Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is\n>>> incorrectly set on Mingw git. However, the Makefile variable is not\n>>> propagated to the C preprocessor and results in no change. This patch\n>>> pushes the definition to the C code and adds a test to validate that\n>>> when core.eol as native is crlf, we actually normalize text files to this\n>>> line ending convention when core.autocrlf is false.\n>>>\n>>> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n>>> Signed-off-by: Stepan Kasal <kasal@ucw.cz>\n>>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>>> ---\n>> \n>> Who should I record as the author of this patch?\n>> \n>\n> Sorry for missing this, here is what Mingw says: \n>\n> commit 0caba2cacbb9d8e6a31783b45f1a13e52dec6ce8\n> Author: Pat Thoyts <patthoyts@users.sourceforge.net>\n> Date:   Mon Nov 26 00:24:00 2012 +0000\n>\n>     Push the NATIVE_CRLF Makefile variable to C and added a test for native.\n>     \n>     Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is\n> []\n\nWhen forwarding somebody else's patch, please start the *body* of\nyour message with the in-body header to force the author, followed\nby a blank line and then the message, i.e.\n\n \tFrom: Pat Thoyts <patthoyts@users.sourceforge.net>\n\n\tCommit 95f31e9a correctly points out that the NATIVE_CRLF setting is\n\tincorrectly set on Mingw git. However, the Makefile variable is not...\n\t...\n\nThe request applies to other patches in the series as well.  I\nsuspect that using send-email on format-patch output may do the\nright thing automatically.\n\nThanks.\n"}]}