{"thread":{"id":"35857","subject":"git blame: \"Not Committed Yet\" with clean WD","startedAt":"2014-02-13T09:08:55Z","lastAt":"2014-02-19T20:16:22Z","messageCount":4,"participants":["Ephrim Khong","brian m. carlson","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"234719","messageId":"52FC8BA7.30102@gmail.com","threadId":"35857","inReplyTo":null,"subject":"git blame: \"Not Committed Yet\" with clean WD","fromName":"Ephrim Khong","fromEmail":"dr.khong@gmail.com","sentAt":"2014-02-13T09:08:55Z","receivedAt":"2014-02-13T09:08:55Z","isPatch":false,"sender":{"key":"dr.khong@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2847265?v=4"},"body":"Hi,\n\nfor files that contain windows line endings in a repository with \ncore.autocrlf=input, git blame will show lines as \"Not Committed Yet\", \neven though they were not modified.\n\nExample:\n\n--\ngit init\ngit config core.autocrlf false\necho \"foo\" > a\nunix2dos a\ngit add a\ngit commit -m \"initial commit\"\ngit config core.autocrlf input\ngit status\ngit blame a\n--\n\nOutput:\n\n--\nReinitialized existing Git repository in /.../testblame2/.git/\nunix2dos: converting file a to DOS format ...\nOn branch master\nnothing to commit, working directory clean\nOn branch master\nnothing to commit, working directory clean\n00000000 (Not Committed Yet 2014-02-13 10:02:43 +0100 1) foo\n--\n\nIs there an easy way to work around this; is this desired behaviour or \nmor a bug?\n\nThanks - Eph\n"},{"id":"234786","messageId":"20140214191015.GG4582@vauxhall.crustytoothpaste.net","threadId":"35857","inReplyTo":"52FC8BA7.30102@gmail.com","subject":"Re: git blame: \"Not Committed Yet\" with clean WD","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-02-14T19:10:15Z","receivedAt":"2014-02-14T19:10:15Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Thu, Feb 13, 2014 at 10:08:55AM +0100, Ephrim Khong wrote:\n> Hi,\n> \n> for files that contain windows line endings in a repository with\n> core.autocrlf=input, git blame will show lines as \"Not Committed\n> Yet\", even though they were not modified.\n> \n> Example:\n> \n> --\n> git init\n> git config core.autocrlf false\n> echo \"foo\" > a\n> unix2dos a\n> git add a\n> git commit -m \"initial commit\"\n> git config core.autocrlf input\n> git status\n> git blame a\n> --\n> \n> Output:\n> \n> --\n> Reinitialized existing Git repository in /.../testblame2/.git/\n> unix2dos: converting file a to DOS format ...\n> On branch master\n> nothing to commit, working directory clean\n> On branch master\n> nothing to commit, working directory clean\n> 00000000 (Not Committed Yet 2014-02-13 10:02:43 +0100 1) foo\n> --\n> \n> Is there an easy way to work around this; is this desired behaviour\n> or mor a bug?\n\nI'm pretty sure this is a bug.  git blame should show the proper\ninformation in this case.\n\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"235009","messageId":"1392752735-168203-1-git-send-email-sandals@crustytoothpaste.net","threadId":"35857","inReplyTo":"20140214191015.GG4582@vauxhall.crustytoothpaste.net","subject":"[PATCH] blame: add a failing test for a CRLF issue.","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-02-18T19:45:35Z","receivedAt":"2014-02-18T19:45:35Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"If a file contains CRLF line endings in a repository with\ncore.autocrlf=input, then blame always marks the lines as \"Not Committed\nYet\", even if they are unmodified.  Add a failing test for this case, so we\nare at least aware of this issue.\n\nReported-by: Ephrim Khong <dr.khong@gmail.com>\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n\nObviously, this doesn't actually fix the issue, but at least we're aware of it\nso we don't lose track of it and can fix it.  A future patch can mark the test\npassing.\n\n t/t8003-blame-corner-cases.sh | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh\nindex e7cac1d..903f775 100755\n--- a/t/t8003-blame-corner-cases.sh\n+++ b/t/t8003-blame-corner-cases.sh\n@@ -191,4 +191,14 @@ test_expect_success 'indent of line numbers, ten lines' '\n \ttest $(grep -c \"  \" actual) = 9\n '\n \n+test_expect_failure '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 config core.autocrlf input &&\n+\tgit blame crlffile >actual &&\n+\tgrep \"A U Thor\" actual\n+'\n+\n test_done\n-- \n1.9.0.rc3.1008.gd08b47c.dirty\n"},{"id":"235065","messageId":"53051116.5010307@web.de","threadId":"35857","inReplyTo":"1392752735-168203-1-git-send-email-sandals@crustytoothpaste.net","subject":"Re: [PATCH] blame: add a failing test for a CRLF issue.","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-02-19T20:16:22Z","receivedAt":"2014-02-19T20:16:22Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 02/18/2014 08:45 PM, brian m. carlson wrote:\n> If a file contains CRLF line endings in a repository with\n> core.autocrlf=input, then blame always marks the lines as \"Not Committed\n> Yet\", even if they are unmodified.  Add a failing test for this case, so we\n> are at least aware of this issue.\n>\n> Reported-by: Ephrim Khong <dr.khong@gmail.com>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>\n> Obviously, this doesn't actually fix the issue, but at least we're aware of it\n> so we don't lose track of it and can fix it.  A future patch can mark the test\n> passing.\n>\n>   t/t8003-blame-corner-cases.sh | 10 ++++++++++\n>   1 file changed, 10 insertions(+)\n>\n> diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh\n> index e7cac1d..903f775 100755\n> --- a/t/t8003-blame-corner-cases.sh\n> +++ b/t/t8003-blame-corner-cases.sh\n> @@ -191,4 +191,14 @@ test_expect_success 'indent of line numbers, ten lines' '\n>   \ttest $(grep -c \"  \" actual) = 9\n>   '\n>\n> +test_expect_failure '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 config core.autocrlf input &&\n> +\tgit blame crlffile >actual &&\n> +\tgrep \"A U Thor\" actual\n> +'\n> +\n>   test_done\n>\n\nWe can test that git blame gives the same result with \ncore.autocrlf=input  and core.autocrlf=false, and make the test case \nlook like this:\n\ntest_expect_failure '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 blame crlffile >expected &&\n\tgit -c core.autocrlf=input blame crlffile >actual &&\n\ttest_cmp expected actual\n'\n"}]}