{"thread":{"id":"39190","subject":"[PATCH v2] blame: CRLF in the working tree and LF in the repo","startedAt":"2015-04-30T04:42:12Z","lastAt":"2015-04-30T08:59:25Z","messageCount":3,"participants":["Torsten Bögershausen","Johannes Schindelin"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"260257","messageId":"5541B2A4.8050108@web.de","threadId":"39190","inReplyTo":null,"subject":"[PATCH v2] blame: CRLF in the working tree and LF in the repo","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-04-30T04:42:12Z","receivedAt":"2015-04-30T04:42:12Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"A typicall setup under Windows:\ncore.eol is CRLF and a file is marked as \"text\" in .gitattributes,\nor core.autocrlf is true\n\nAfter 4d4813a5 \"git blame\" no longer works as expected,\nevery line is annotated as \"Not Committed Yet\",\neven though the working directory is clean.\n\ncommit 4d4813a5 removed the conversion in blame.c for all files,\nwith or without CRLF in the repo.\n\nHaving files with CRLF in the repo and core.autocrlf=input is a temporary\nsituation, the files should be normalized in the repo.\nBlaming them with \"Not Committed Yet\" is OK.\n\nThe solution is to revert commit 4d4813a5.\n\nReported-By: Stepan Kasal <kasal@ucw.cz>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n\nWhat happened to the test cases ?\nThey where improved, but it turned out that they failed\nfrom time to time, both Windows and Mac OS.\n\"Spicing them\" with test_tick or other things didn't help,\nif they are run in a tight loop.\nrunning with \"debug=t verbose=t ./t8003*.sh\" make the test\npass.\nMy suggestion is to revert 4d4813a5 and drop TC's for the moment.\n \n builtin/blame.c               | 1 +\n t/t8003-blame-corner-cases.sh | 9 ---------\n 2 files changed, 1 insertion(+), 9 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 06484c2..8d70623 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -2348,6 +2348,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,\n \t\tif (strbuf_read(&buf, 0, 0) < 0)\n \t\t\tdie_errno(\"failed to read from stdin\");\n \t}\n+\tconvert_to_git(path, buf.buf, buf.len, &buf, 0);\n \torigin->file.ptr = buf.buf;\n \torigin->file.size = buf.len;\n \tpretend_sha1_file(buf.buf, buf.len, OBJ_BLOB, origin->blob_sha1);\ndiff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh\nindex 32895e5..a073d36 100755\n--- a/t/t8003-blame-corner-cases.sh\n+++ b/t/t8003-blame-corner-cases.sh\n@@ -191,13 +191,4 @@ test_expect_success 'indent of line numbers, ten lines' '\n \ttest $(grep -c \"  \" actual) = 9\n '\n \n-test_expect_success 'blaming files with CRLF newlines' '\n-\tgit config core.autocrlf false &&\n-\tprintf \"testcase\\r\\n\" >crlffile &&\n-\tgit add crlffile &&\n-\tgit commit -m testcase &&\n-\tgit -c core.autocrlf=input blame crlffile >actual &&\n-\tgrep \"A U Thor\" actual\n-'\n-\n test_done\n-- \n2.2.0.rc1.790.ge19fcd2\n"},{"id":"260261","messageId":"83824ee9e8a2ea1e08b05aadbdd2d1b7@www.dscho.org","threadId":"39190","inReplyTo":"5541B2A4.8050108@web.de","subject":"Re: [PATCH v2] blame: CRLF in the working tree and LF in the repo","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-04-30T07:53:25Z","receivedAt":"2015-04-30T07:53:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Torsten,\n\nOn 2015-04-30 06:42, Torsten Bögershausen wrote:\n> A typicall setup under Windows:\n\ns/ll/l/\n\n> What happened to the test cases ?\n> They where improved, but it turned out that they failed\n> from time to time, both Windows and Mac OS.\n\nHave you had a chance to investigate the failure symptoms? This is worrisome.\n\nCiao,\nDscho\n"},{"id":"260266","messageId":"5541EEED.60004@web.de","threadId":"39190","inReplyTo":"83824ee9e8a2ea1e08b05aadbdd2d1b7@www.dscho.org","subject":"Re: [PATCH v2] blame: CRLF in the working tree and LF in the repo","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-04-30T08:59:25Z","receivedAt":"2015-04-30T08:59:25Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n\nOn 30/04/15 09:53, Johannes Schindelin wrote:\n> Hi Torsten,\n>\n> On 2015-04-30 06:42, Torsten Bögershausen wrote:\n>> A typicall setup under Windows:\n> s/ll/l/\n>\n>> What happened to the test cases ?\n>> They where improved, but it turned out that they failed\n>> from time to time, both Windows and Mac OS.\n> Have you had a chance to investigate the failure symptoms? This is worrisome.\n>\n> Ciao,\n> Dscho\nThanks for insisting  - problem found:\n< 00000000 (Not Committed Yet 2015-04-30 08:36:18 +0000 1) testcase\n---\n > 00000000 (Not Committed Yet 2015-04-30 08:36:19 +0000 1) testcase\n(And V3 will come later)\n"}]}