{"action":"created","issue":{"url":"https://api.github.com/repos/git-for-windows/git/issues/105","labels_url":"https://api.github.com/repos/git-for-windows/git/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/git-for-windows/git/issues/105/comments","events_url":"https://api.github.com/repos/git-for-windows/git/issues/105/events","html_url":"https://github.com/git-for-windows/git/issues/105","id":70383025,"number":105,"title":"\"git blame filename.c\" does not work","user":{"login":"kasal","id":1481596,"avatar_url":"https://avatars.githubusercontent.com/u/1481596?v=3","gravatar_id":"","url":"https://api.github.com/users/kasal","html_url":"https://github.com/kasal","followers_url":"https://api.github.com/users/kasal/followers","following_url":"https://api.github.com/users/kasal/following{/other_user}","gists_url":"https://api.github.com/users/kasal/gists{/gist_id}","starred_url":"https://api.github.com/users/kasal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasal/subscriptions","organizations_url":"https://api.github.com/users/kasal/orgs","repos_url":"https://api.github.com/users/kasal/repos","events_url":"https://api.github.com/users/kasal/events{/privacy}","received_events_url":"https://api.github.com/users/kasal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-23T11:17:14Z","updated_at":"2015-04-24T09:19:24Z","closed_at":null,"body":"After upgrade from 1.9.5-preview-20150319 to 2.3.5.windows.8, \"git blame filename.c\" no longer works.\r\nEvery line is annotated as \"Not Committed Yet\", even though the working directory is clean.\r\n\r\n\"git blame HEAD -- filename.c\" provides the correct output.\r\n\r\nThe obvious guess is that the CR chars have not been stripped, so all checksums are wrong.\r\n\r\nMy setup looks like this:\r\ngit config core.autocrlf = False\r\nfile .gitattributes contains\r\n.c     text"},"comment":{"url":"https://api.github.com/repos/git-for-windows/git/issues/comments/95866267","html_url":"https://github.com/git-for-windows/git/issues/105#issuecomment-95866267","issue_url":"https://api.github.com/repos/git-for-windows/git/issues/105","id":95866267,"user":{"login":"kasal","id":1481596,"avatar_url":"https://avatars.githubusercontent.com/u/1481596?v=3","gravatar_id":"","url":"https://api.github.com/users/kasal","html_url":"https://github.com/kasal","followers_url":"https://api.github.com/users/kasal/followers","following_url":"https://api.github.com/users/kasal/following{/other_user}","gists_url":"https://api.github.com/users/kasal/gists{/gist_id}","starred_url":"https://api.github.com/users/kasal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasal/subscriptions","organizations_url":"https://api.github.com/users/kasal/orgs","repos_url":"https://api.github.com/users/kasal/repos","events_url":"https://api.github.com/users/kasal/events{/privacy}","received_events_url":"https://api.github.com/users/kasal/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T09:19:24Z","updated_at":"2015-04-24T09:19:24Z","body":"Hi tboegi and dscho,\r\nthe file has CRLF in the working tree and LF in the repo.\r\nYes, I can reproduce with my 2.3.5.windows.8 install: attached below please find test cases in a form suitable for addition to git's test suite.\r\n\r\ndscho wrote:\r\n> Hmm. Purportedly git@4d4813a52f3722854a54bab046f4abfec13ef6ae fixed this, though...\r\n\r\nClose.  Actually, the bug was _introduced_ by this commit and shall be fixed by reverting it.\r\nThank you for pointing to the right spot.\r\n\r\nCommit git@4d4813a52f3722854a54bab046f4abfec13ef6ae deals with a case when the repo contains files with CRLF. This setup is invalid.  (It can work in certain cases, but keeping all files set as binary is the very minimum.)\r\n\r\nAfter changing core.autocrlf, one has to normalize the line endings in the repo, see e.g. [this description](https://help.github.com/articles/dealing-with-line-endings/#refreshing-a-repository-after-changing-line-endings).\r\n\r\nThe commit should be reverted, including the incorrect test case; another test cases shall be added instead.\r\n\r\nI would be very glad if any of you could volunteer to submit this upstream.\r\n\r\n```sh\r\ntest_expect_success 'blaming files with CRLF newlines' '\r\n\tgit config core.autocrlf true &&\r\n\tprintf \"testcase\\r\\n\" >crlffile &&\r\n\tgit add crlffile &&\r\n\tgit commit -m testcase &&\r\n\tgit blame crlffile >actual &&\r\n\tgrep \"A U Thor\" actual\r\n'\r\ntest_expect_success 'blaming files with CRLF newlines' '\r\n\tgit config core.autocrlf false &&\r\n\tprintf \".gitattributes text\\r\\n\" >.gitattributes &&\r\n\tgit add .gitattributes &&\r\n\tgit commit -m testcase &&\r\n\tgit blame .gitattributes >actual &&\r\n\tgrep \"A U Thor\" actual\r\n'\r\n```"}}