{"thread":{"id":"44567","subject":"[PATCH v1 1/1] convert: git cherry-pick -Xrenormalize did not work","startedAt":"2016-11-29T16:30:46Z","lastAt":"2016-12-02T12:20:47Z","messageCount":9,"participants":["tboegi@web.de","Junio C Hamano","Torsten Bögershausen","Jacob Keller"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"306546","messageId":"20161129163023.23403-1-tboegi@web.de","threadId":"44567","inReplyTo":"6a7e155-f399-c9f8-c69e-8164e0735dfb@veekun.com","subject":"[PATCH v1 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"","fromEmail":"tboegi@web.de","sentAt":"2016-11-29T16:30:23Z","receivedAt":"2016-11-29T16:30:46Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"From: Torsten Bögershausen <tboegi@web.de>\n\nWorking with a repo that used to be all CRLF. At some point it\nwas changed to all LF, with `text=auto` in .gitattributes.\nTrying to cherry-pick a commit from before the switchover fails:\n\n$ git cherry-pick -Xrenormalize <commit>\n    fatal: CRLF would be replaced by LF in [path]\n\nWhenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\nSAFE_CRLF_RENORMALIZE must be turned into CRLF_SAFE_FALSE.\n\nReported-by: Eevee (Lexy Munroe) <eevee@veekun.com>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n\nThanks for reporting.\nHere is a less invasive patch.\nPlease let me know, if the patch is OK for you\n(email address, does it work..)\n\n convert.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/convert.c b/convert.c\nindex be91358..526ec1d 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -286,7 +286,9 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n \t\t\tchecksafe = SAFE_CRLF_FALSE;\n \t\telse if (has_cr_in_index(path))\n \t\t\tconvert_crlf_into_lf = 0;\n-\t}\n+\t} else if (checksafe == SAFE_CRLF_RENORMALIZE)\n+\t\tchecksafe = SAFE_CRLF_FALSE;\n+\n \tif (checksafe && len) {\n \t\tstruct text_stat new_stats;\n \t\tmemcpy(&new_stats, &stats, sizeof(new_stats));\n-- \n2.10.0\n\n"},{"id":"306553","messageId":"xmqq7f7mgmb9.fsf@gitster.mtv.corp.google.com","threadId":"44567","inReplyTo":"20161129163023.23403-1-tboegi@web.de","subject":"Re: [PATCH v1 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-11-29T18:42:18Z","receivedAt":"2016-11-29T18:42:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"tboegi@web.de writes:\n\n> From: Torsten Bögershausen <tboegi@web.de>\n>\n> Working with a repo that used to be all CRLF. At some point it\n> was changed to all LF, with `text=auto` in .gitattributes.\n> Trying to cherry-pick a commit from before the switchover fails:\n>\n> $ git cherry-pick -Xrenormalize <commit>\n>     fatal: CRLF would be replaced by LF in [path]\n\nOK.  That's a very clear description of the symptom that can be\nobserved from the surface.\n\n> Whenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\n> SAFE_CRLF_RENORMALIZE must be turned into CRLF_SAFE_FALSE.\n\nAside from needing s/CRLF_SAFE/SAFE_CRLF/, this however lacks\n\"Otherwise, because of X and Y, Z ends up doing W\" to explain\nthe \"must be\" part.  Care to explain it a bit more?\n\nThanks.\n\n> Reported-by: Eevee (Lexy Munroe) <eevee@veekun.com>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n>\n> Thanks for reporting.\n> Here is a less invasive patch.\n> Please let me know, if the patch is OK for you\n> (email address, does it work..)\n>\n>  convert.c | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/convert.c b/convert.c\n> index be91358..526ec1d 100644\n> --- a/convert.c\n> +++ b/convert.c\n> @@ -286,7 +286,9 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n>  \t\t\tchecksafe = SAFE_CRLF_FALSE;\n>  \t\telse if (has_cr_in_index(path))\n>  \t\t\tconvert_crlf_into_lf = 0;\n> -\t}\n> +\t} else if (checksafe == SAFE_CRLF_RENORMALIZE)\n> +\t\tchecksafe = SAFE_CRLF_FALSE;\n> +\n>  \tif (checksafe && len) {\n>  \t\tstruct text_stat new_stats;\n>  \t\tmemcpy(&new_stats, &stats, sizeof(new_stats));\n"},{"id":"306567","messageId":"20161129201600.GA14333@tb-raspi","threadId":"44567","inReplyTo":"xmqq7f7mgmb9.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v1 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-11-29T20:16:00Z","receivedAt":"2016-11-29T20:16:48Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Tue, Nov 29, 2016 at 10:42:18AM -0800, Junio C Hamano wrote:\n> tboegi@web.de writes:\n> \n> > From: Torsten Bögershausen <tboegi@web.de>\n> >\n> > Working with a repo that used to be all CRLF. At some point it\n> > was changed to all LF, with `text=auto` in .gitattributes.\n> > Trying to cherry-pick a commit from before the switchover fails:\n> >\n> > $ git cherry-pick -Xrenormalize <commit>\n> >     fatal: CRLF would be replaced by LF in [path]\n> \n> OK.  That's a very clear description of the symptom that can be\n> observed from the surface.\n> \n> > Whenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\n> > SAFE_CRLF_RENORMALIZE must be turned into CRLF_SAFE_FALSE.\n> \n> Aside from needing s/CRLF_SAFE/SAFE_CRLF/, this however lacks\n> \"Otherwise, because of X and Y, Z ends up doing W\" to explain\n> the \"must be\" part.  Care to explain it a bit more?\n\nThanks for the review - how about this:\n\n\n\n\nconvert: git cherry-pick -Xrenormalize did not work\n\nWorking with a repo that used to be all CRLF. At some point it\nwas changed to all LF, with `text=auto` in .gitattributes.\nTrying to cherry-pick a commit from before the switchover fails:\n\n$ git cherry-pick -Xrenormalize <commit>\n    fatal: CRLF would be replaced by LF in [path]\n\nCommit 65237284 \"unify the \"auto\" handling of CRLF\" introduced\na regression:\n\nWhenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\nSAFE_CRLF_RENORMALIZE was feed into check_safe_crlf().\nThis is wrong because here everything else than SAFE_CRLF_WARN is\ntreated as SAFE_CRLF_FAIL.\n\nSolution: Turn SAFE_CRLF_RENORMALIZE into SAFE_CRLF_FALSE before\ncalling check_safe_crlf().\n\nReported-by: Eevee (Lexy Munroe) <eevee@veekun.com>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n"},{"id":"306569","messageId":"xmqqzikidnhh.fsf@gitster.mtv.corp.google.com","threadId":"44567","inReplyTo":"20161129201600.GA14333@tb-raspi","subject":"Re: [PATCH v1 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-11-29T20:45:14Z","receivedAt":"2016-11-29T20:45:27Z","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> Thanks for the review - how about this:\n>\n>\n> convert: git cherry-pick -Xrenormalize did not work\n>\n> Working with a repo that used to be all CRLF. At some point it\n> was changed to all LF, with `text=auto` in .gitattributes.\n> Trying to cherry-pick a commit from before the switchover fails:\n>\n> $ git cherry-pick -Xrenormalize <commit>\n>     fatal: CRLF would be replaced by LF in [path]\n>\n> Commit 65237284 \"unify the \"auto\" handling of CRLF\" introduced\n> a regression:\n>\n> Whenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\n> SAFE_CRLF_RENORMALIZE was feed into check_safe_crlf().\n> This is wrong because here everything else than SAFE_CRLF_WARN is\n> treated as SAFE_CRLF_FAIL.\n\nWhat is still left unsaid is that we shouldn't even bother seeing if\nit is safe to do crlf conversion when renormalizing.  Perhaps that\nis too obvious to state?\n\nIn any case, when you put the rationale that way, the impression I\nget from it is that the root cause of the problem is that \"here\"\n(aka \"check_safe_crlf()\") considers anything other than CRLF_WARN as\na failure, when a newer choice other than CRLF_WARN and CRLF_FAIL\n(namely, CRLF_RENORMALIZE) exists.  Which hints me that a sensible\nchange may be to fix that function.\n\nThe patch you sent has the effect of not entering this whole block,\nnot just \"don't call check_safe_crlf() because it misbehaves\":\n\n\tif (checksafe && len) {\n\t\tstruct text_stat new_stats;\n\t\tmemcpy(&new_stats, &stats, sizeof(new_stats));\n\t\t/* simulate \"git add\" */\n\t\tif (convert_crlf_into_lf) {\n\t\t\tnew_stats.lonelf += new_stats.crlf;\n\t\t\tnew_stats.crlf = 0;\n\t\t}\n\t\t/* simulate \"git checkout\" */\n\t\tif (will_convert_lf_to_crlf(len, &new_stats, crlf_action)) {\n\t\t\tnew_stats.crlf += new_stats.lonelf;\n\t\t\tnew_stats.lonelf = 0;\n\t\t}\n\t\tcheck_safe_crlf(path, crlf_action, &stats, &new_stats, checksafe);\n\t}\n\nAnd it is a sensible thing to do, because all the computation that\nhappens in the block before check_safe_crlf() is called is done ONLY\nto prepare the parameter passed to check_safe_crlf(); if we are to\nmake the function no-op for CRLF_RENORMALIZE, preparing new_stats is\na wasted effort.\n\nHowever, futzing with the value of checksafe in the function is\nugly.  It is not even unclear if it is safe to do so without reading\nthe remainder of the function (i.e. later parts of the function may\ncare--or start caring in the future--what the caller passed in the\nvariable).  Yes, the function already modifies the variable, but\nthat can also be fixed.\n\nIn other words, I would have expected that a fix that matches your\ndescription to look more like below.  The condition for the \"if\"\nstatement may even want to become\n\n\tif ((checksafe == SAFE_CRLF_WARN ||\n\t    (checksafe == SAFE_CRLF_FAIL)) && len)\n\nto clarify it further.\n\nThanks.\n\n convert.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/convert.c b/convert.c\nindex f9f7f5e436..d72e0bf0d7 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -282,12 +282,11 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n \t\t * If the file in the index has any CR in it, do not convert.\n \t\t * This is the new safer autocrlf handling.\n \t\t */\n-\t\tif (checksafe == SAFE_CRLF_RENORMALIZE)\n-\t\t\tchecksafe = SAFE_CRLF_FALSE;\n-\t\telse if (has_cr_in_index(path))\n+\t\tif (checksafe != SAFE_CRLF_RENORMALIZE &&\n+\t\t    has_cr_in_index(path))\n \t\t\tconvert_crlf_into_lf = 0;\n \t}\n-\tif (checksafe && len) {\n+\tif (checksafe && checksafe != SAFE_CRLF_RENORMALIZE && len) {\n \t\tstruct text_stat new_stats;\n \t\tmemcpy(&new_stats, &stats, sizeof(new_stats));\n \t\t/* simulate \"git add\" */\n\n\n"},{"id":"306592","messageId":"20161130170232.19685-1-tboegi@web.de","threadId":"44567","inReplyTo":"6a7e155-f399-c9f8-c69e-8164e0735dfb@veekun.com","subject":"[PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"","fromEmail":"tboegi@web.de","sentAt":"2016-11-30T17:02:32Z","receivedAt":"2016-11-30T17:02:53Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"From: Torsten Bögershausen <tboegi@web.de>\n\nWorking with a repo that used to be all CRLF. At some point it\nwas changed to all LF, with `text=auto` in .gitattributes.\nTrying to cherry-pick a commit from before the switchover fails:\n\n$ git cherry-pick -Xrenormalize <commit>\n    fatal: CRLF would be replaced by LF in [path]\n\nCommit 65237284 \"unify the \"auto\" handling of CRLF\" introduced\na regression:\n\nWhenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\nSAFE_CRLF_RENORMALIZE was feed into check_safe_crlf().\nThis is wrong because here everything else than SAFE_CRLF_WARN is\ntreated as SAFE_CRLF_FAIL.\n\nCall check_safe_crlf() only if checksafe is SAFE_CRLF_WARN or SAFE_CRLF_FAIL.\n\nReported-by: Eevee (Lexy Munroe) <eevee@veekun.com>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n convert.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/convert.c b/convert.c\nindex be91358..f8e4dfe 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -281,13 +281,13 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n \t\t/*\n \t\t * If the file in the index has any CR in it, do not convert.\n \t\t * This is the new safer autocrlf handling.\n+\t\t   - unless we want to renormalize in a merge or cherry-pick\n \t\t */\n-\t\tif (checksafe == SAFE_CRLF_RENORMALIZE)\n-\t\t\tchecksafe = SAFE_CRLF_FALSE;\n-\t\telse if (has_cr_in_index(path))\n+\t\tif ((checksafe != SAFE_CRLF_RENORMALIZE) && has_cr_in_index(path))\n \t\t\tconvert_crlf_into_lf = 0;\n \t}\n-\tif (checksafe && len) {\n+\tif ((checksafe == SAFE_CRLF_WARN ||\n+\t    (checksafe == SAFE_CRLF_FAIL)) && len) {\n \t\tstruct text_stat new_stats;\n \t\tmemcpy(&new_stats, &stats, sizeof(new_stats));\n \t\t/* simulate \"git add\" */\n-- \n2.10.0\n\n"},{"id":"306703","messageId":"xmqq1sxrbj3a.fsf@gitster.mtv.corp.google.com","threadId":"44567","inReplyTo":"20161130170232.19685-1-tboegi@web.de","subject":"Re: [PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-01T18:27:37Z","receivedAt":"2016-12-01T18:27:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"tboegi@web.de writes:\n\n> From: Torsten Bögershausen <tboegi@web.de>\n>\n> Working with a repo that used to be all CRLF. At some point it\n> was changed to all LF, with `text=auto` in .gitattributes.\n> Trying to cherry-pick a commit from before the switchover fails:\n>\n> $ git cherry-pick -Xrenormalize <commit>\n>     fatal: CRLF would be replaced by LF in [path]\n>\n> Commit 65237284 \"unify the \"auto\" handling of CRLF\" introduced\n> a regression:\n>\n> Whenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\n> SAFE_CRLF_RENORMALIZE was feed into check_safe_crlf().\n> This is wrong because here everything else than SAFE_CRLF_WARN is\n> treated as SAFE_CRLF_FAIL.\n>\n> Call check_safe_crlf() only if checksafe is SAFE_CRLF_WARN or SAFE_CRLF_FAIL.\n>\n> Reported-by: Eevee (Lexy Munroe) <eevee@veekun.com>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n\nI think the description and the code match with each other much\nbetter and the resulting code explains what is going on more\nclearly.  Thanks---will queue.\n\n>  convert.c | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/convert.c b/convert.c\n> index be91358..f8e4dfe 100644\n> --- a/convert.c\n> +++ b/convert.c\n> @@ -281,13 +281,13 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n>  \t\t/*\n>  \t\t * If the file in the index has any CR in it, do not convert.\n>  \t\t * This is the new safer autocrlf handling.\n> +\t\t   - unless we want to renormalize in a merge or cherry-pick\n>  \t\t */\n> -\t\tif (checksafe == SAFE_CRLF_RENORMALIZE)\n> -\t\t\tchecksafe = SAFE_CRLF_FALSE;\n> -\t\telse if (has_cr_in_index(path))\n> +\t\tif ((checksafe != SAFE_CRLF_RENORMALIZE) && has_cr_in_index(path))\n>  \t\t\tconvert_crlf_into_lf = 0;\n>  \t}\n> -\tif (checksafe && len) {\n> +\tif ((checksafe == SAFE_CRLF_WARN ||\n> +\t    (checksafe == SAFE_CRLF_FAIL)) && len) {\n>  \t\tstruct text_stat new_stats;\n>  \t\tmemcpy(&new_stats, &stats, sizeof(new_stats));\n>  \t\t/* simulate \"git add\" */\n"},{"id":"306730","messageId":"CA+P7+xoJb=SukbnJVJrXR6WV9+UtGnsn776KGkrHC7X-T_wZWg@mail.gmail.com","threadId":"44567","inReplyTo":"20161130170232.19685-1-tboegi@web.de","subject":"Re: [PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-12-01T20:07:13Z","receivedAt":"2016-12-01T20:07:38Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, Nov 30, 2016 at 9:02 AM,  <tboegi@web.de> wrote:\n> From: Torsten Bögershausen <tboegi@web.de>\n> diff --git a/convert.c b/convert.c\n> index be91358..f8e4dfe 100644\n> --- a/convert.c\n> +++ b/convert.c\n> @@ -281,13 +281,13 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n>                 /*\n>                  * If the file in the index has any CR in it, do not convert.\n>                  * This is the new safer autocrlf handling.\n> +                  - unless we want to renormalize in a merge or cherry-pick\n\nStyle nit, usually this line should begin with an aligned *? I think\nit's not really that big a deal, though.\n\nThanks,\nJake\n"},{"id":"306734","messageId":"xmqqtwan8kjv.fsf@gitster.mtv.corp.google.com","threadId":"44567","inReplyTo":"CA+P7+xoJb=SukbnJVJrXR6WV9+UtGnsn776KGkrHC7X-T_wZWg@mail.gmail.com","subject":"Re: [PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-01T20:24:20Z","receivedAt":"2016-12-01T20:24:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.keller@gmail.com> writes:\n\n> On Wed, Nov 30, 2016 at 9:02 AM,  <tboegi@web.de> wrote:\n>> From: Torsten Bögershausen <tboegi@web.de>\n>> diff --git a/convert.c b/convert.c\n>> index be91358..f8e4dfe 100644\n>> --- a/convert.c\n>> +++ b/convert.c\n>> @@ -281,13 +281,13 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n>>                 /*\n>>                  * If the file in the index has any CR in it, do not convert.\n>>                  * This is the new safer autocrlf handling.\n>> +                  - unless we want to renormalize in a merge or cherry-pick\n>\n> Style nit, usually this line should begin with an aligned *? I think\n> it's not really that big a deal, though.\n\nYup, this is what I queued.\n\n-- >8 --\nFrom: Torsten Bögershausen <tboegi@web.de>\nDate: Wed, 30 Nov 2016 18:02:32 +0100\nSubject: [PATCH] convert: git cherry-pick -Xrenormalize did not work\n\nWorking with a repo that used to be all CRLF. At some point it\nwas changed to all LF, with `text=auto` in .gitattributes.\nTrying to cherry-pick a commit from before the switchover fails:\n\n    $ git cherry-pick -Xrenormalize <commit>\n    fatal: CRLF would be replaced by LF in [path]\n\nCommit 65237284 \"unify the \"auto\" handling of CRLF\" introduced\na regression:\n\nWhenever crlf_action is CRLF_TEXT_XXX and not CRLF_AUTO_XXX,\nSAFE_CRLF_RENORMALIZE was feed into check_safe_crlf().  This is\nwrong because here everything else than SAFE_CRLF_WARN is treated as\nSAFE_CRLF_FAIL.\n\nCall check_safe_crlf() only if checksafe is SAFE_CRLF_WARN or\nSAFE_CRLF_FAIL.\n\nReported-by: Eevee (Lexy Munroe) <eevee@veekun.com>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n convert.c | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)\n\ndiff --git a/convert.c b/convert.c\nindex 077f5e601e..2f90f363c6 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -274,15 +274,16 @@ static int crlf_to_git(const char *path, const char *src, size_t len,\n \t\tif (convert_is_binary(len, &stats))\n \t\t\treturn 0;\n \t\t/*\n-\t\t * If the file in the index has any CR in it, do not convert.\n-\t\t * This is the new safer autocrlf handling.\n+\t\t * If the file in the index has any CR in it, do not\n+\t\t * convert.  This is the new safer autocrlf handling,\n+\t\t * unless we want to renormalize in a merge or\n+\t\t * cherry-pick.\n \t\t */\n-\t\tif (checksafe == SAFE_CRLF_RENORMALIZE)\n-\t\t\tchecksafe = SAFE_CRLF_FALSE;\n-\t\telse if (has_cr_in_index(path))\n+\t\tif ((checksafe != SAFE_CRLF_RENORMALIZE) && has_cr_in_index(path))\n \t\t\tconvert_crlf_into_lf = 0;\n \t}\n-\tif (checksafe && len) {\n+\tif ((checksafe == SAFE_CRLF_WARN ||\n+\t    (checksafe == SAFE_CRLF_FAIL)) && len) {\n \t\tstruct text_stat new_stats;\n \t\tmemcpy(&new_stats, &stats, sizeof(new_stats));\n \t\t/* simulate \"git add\" */\n-- \n2.11.0-192-gbadfaabe38\n\n"},{"id":"306793","messageId":"11a8a411-528c-0e7d-b503-19bab6b6e7f1@web.de","threadId":"44567","inReplyTo":"xmqqtwan8kjv.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 1/1] convert: git cherry-pick -Xrenormalize did not work","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-12-02T12:20:06Z","receivedAt":"2016-12-02T12:20:47Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n> Yup, this is what I queued.\n>\nLooks good, thanks you all.\n\n"}]}