{"action":"created","issue":{"url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/233","labels_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/233/comments","events_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/233/events","html_url":"https://github.com/airblade/vim-gitgutter/pull/233","id":59592613,"number":233,"title":"Use a temporary file for buffer for realtime diffs","user":{"login":"elyscape","id":792695,"avatar_url":"https://avatars.githubusercontent.com/u/792695?v=3","gravatar_id":"","url":"https://api.github.com/users/elyscape","html_url":"https://github.com/elyscape","followers_url":"https://api.github.com/users/elyscape/followers","following_url":"https://api.github.com/users/elyscape/following{/other_user}","gists_url":"https://api.github.com/users/elyscape/gists{/gist_id}","starred_url":"https://api.github.com/users/elyscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyscape/subscriptions","organizations_url":"https://api.github.com/users/elyscape/orgs","repos_url":"https://api.github.com/users/elyscape/repos","events_url":"https://api.github.com/users/elyscape/events{/privacy}","received_events_url":"https://api.github.com/users/elyscape/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-03T04:08:02Z","updated_at":"2015-03-03T13:44:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/233","html_url":"https://github.com/airblade/vim-gitgutter/pull/233","diff_url":"https://github.com/airblade/vim-gitgutter/pull/233.diff","patch_url":"https://github.com/airblade/vim-gitgutter/pull/233.patch"},"body":"`git diff` doesn't perform EOL conversion on stdin, causing it to mistakenly flag every line as having changed when the working tree uses a different EOL than the blobs. Writing the buffer to a temporary file and diffing against that avoids this issue.  This PR also deletes the temporary blob file created for realtime diffs.\r\n\r\nFixes #232."},"comment":{"url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/comments/76946964","html_url":"https://github.com/airblade/vim-gitgutter/pull/233#issuecomment-76946964","issue_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/233","id":76946964,"user":{"login":"airblade","id":7265,"avatar_url":"https://avatars.githubusercontent.com/u/7265?v=3","gravatar_id":"","url":"https://api.github.com/users/airblade","html_url":"https://github.com/airblade","followers_url":"https://api.github.com/users/airblade/followers","following_url":"https://api.github.com/users/airblade/following{/other_user}","gists_url":"https://api.github.com/users/airblade/gists{/gist_id}","starred_url":"https://api.github.com/users/airblade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airblade/subscriptions","organizations_url":"https://api.github.com/users/airblade/orgs","repos_url":"https://api.github.com/users/airblade/repos","events_url":"https://api.github.com/users/airblade/events{/privacy}","received_events_url":"https://api.github.com/users/airblade/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T13:44:02Z","updated_at":"2015-03-03T13:44:02Z","body":"I tried this on lattesir/WindowsViaCPP which is linked from the [GitHub help on line endings](https://help.github.com/articles/dealing-with-line-endings/) as an example of a repo which enforces CRLF line endings.  It didn't work: the realtime diff flagged every line as changed.\r\n\r\nWhen I execute `git show :Clean.bat > foo` manually, I can see that `Clean.bat` has CRLF but `foo` has LF.  Therefore diffing the buffer-in-a-temp-file, which has CRLF endings, against `foo` with its LF endings makes it look like every line has changed."}}