{"action":"created","comment":{"url":"https://api.github.com/repos/magit/magit/pulls/comments/55626679","id":55626679,"diff_hunk":"@@ -86,22 +86,40 @@ With a prefix argument and if necessary, attempt a 3-way merge.\"\n       (`(,_   file) (magit-apply-diff   it args))\n       (`(,_  files) (magit-apply-diffs  it args)))))\n \n+;;; Emacs buffers normalise the various possible ways of ending lines\n+;;; to a single ?\\n. Therefore, when the magit buffer's eol style is\n+;;; CRLF, we lose information whether lines should have CRLF or LF\n+;;; endings. To recover that information, we check if the file to be\n+;;; patched has CRLF lines, in which case we insert literal CR chars\n+;;; to ensure they make their way to the patch file fed to git. The\n+;;; remainder of the patch will have LF eol style.\n+(defun magit-apply--maybe-fixup-eols (section string)\n+  (let ((file (magit-section-value (magit-section-parent section))))","path":"lisp/magit-apply.el","position":12,"original_position":12,"commit_id":"8bbf6538d9bca73a61bd2976cec65368657c4ab1","original_commit_id":"8bbf6538d9bca73a61bd2976cec65368657c4ab1","user":{"login":"npostavs","id":287742,"avatar_url":"https://avatars.githubusercontent.com/u/287742?v=3","gravatar_id":"","url":"https://api.github.com/users/npostavs","html_url":"https://github.com/npostavs","followers_url":"https://api.github.com/users/npostavs/followers","following_url":"https://api.github.com/users/npostavs/following{/other_user}","gists_url":"https://api.github.com/users/npostavs/gists{/gist_id}","starred_url":"https://api.github.com/users/npostavs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npostavs/subscriptions","organizations_url":"https://api.github.com/users/npostavs/orgs","repos_url":"https://api.github.com/users/npostavs/repos","events_url":"https://api.github.com/users/npostavs/events{/privacy}","received_events_url":"https://api.github.com/users/npostavs/received_events","type":"User","site_admin":false},"body":"I suspect this expression isn't correct (i.e. doesn't return a filename) for all section types, though I haven't got around to testing.","created_at":"2016-03-10T02:34:26Z","updated_at":"2016-03-10T02:34:26Z","html_url":"https://github.com/magit/magit/pull/2584#discussion_r55626679","pull_request_url":"https://api.github.com/repos/magit/magit/pulls/2584","_links":{"self":{"href":"https://api.github.com/repos/magit/magit/pulls/comments/55626679"},"html":{"href":"https://github.com/magit/magit/pull/2584#discussion_r55626679"},"pull_request":{"href":"https://api.github.com/repos/magit/magit/pulls/2584"}}},"pull_request":{"url":"https://api.github.com/repos/magit/magit/pulls/2584","id":62259317,"html_url":"https://github.com/magit/magit/pull/2584","diff_url":"https://github.com/magit/magit/pull/2584.diff","patch_url":"https://github.com/magit/magit/pull/2584.patch","issue_url":"https://api.github.com/repos/magit/magit/issues/2584","number":2584,"state":"open","locked":false,"title":"magit-apply: add literal CR chars if necessary","user":{"login":"luismbo","id":45759,"avatar_url":"https://avatars.githubusercontent.com/u/45759?v=3","gravatar_id":"","url":"https://api.github.com/users/luismbo","html_url":"https://github.com/luismbo","followers_url":"https://api.github.com/users/luismbo/followers","following_url":"https://api.github.com/users/luismbo/following{/other_user}","gists_url":"https://api.github.com/users/luismbo/gists{/gist_id}","starred_url":"https://api.github.com/users/luismbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luismbo/subscriptions","organizations_url":"https://api.github.com/users/luismbo/orgs","repos_url":"https://api.github.com/users/luismbo/repos","events_url":"https://api.github.com/users/luismbo/events{/privacy}","received_events_url":"https://api.github.com/users/luismbo/received_events","type":"User","site_admin":false},"body":"A tentative fix for #2401, #2403 and #2583.","created_at":"2016-03-09T16:51:51Z","updated_at":"2016-03-10T02:34:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fccad2a5ace824337ebdd97a932f3b13e8c542dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/magit/magit/pulls/2584/commits","review_comments_url":"https://api.github.com/repos/magit/magit/pulls/2584/comments","review_comment_url":"https://api.github.com/repos/magit/magit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magit/magit/issues/2584/comments","statuses_url":"https://api.github.com/repos/magit/magit/statuses/8bbf6538d9bca73a61bd2976cec65368657c4ab1","head":{"label":"luismbo:fix-2583","ref":"fix-2583","sha":"8bbf6538d9bca73a61bd2976cec65368657c4ab1","user":{"login":"luismbo","id":45759,"avatar_url":"https://avatars.githubusercontent.com/u/45759?v=3","gravatar_id":"","url":"https://api.github.com/users/luismbo","html_url":"https://github.com/luismbo","followers_url":"https://api.github.com/users/luismbo/followers","following_url":"https://api.github.com/users/luismbo/following{/other_user}","gists_url":"https://api.github.com/users/luismbo/gists{/gist_id}","starred_url":"https://api.github.com/users/luismbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luismbo/subscriptions","organizations_url":"https://api.github.com/users/luismbo/orgs","repos_url":"https://api.github.com/users/luismbo/repos","events_url":"https://api.github.com/users/luismbo/events{/privacy}","received_events_url":"https://api.github.com/users/luismbo/received_events","type":"User","site_admin":false},"repo":{"id":1762108,"name":"magit","full_name":"luismbo/magit","owner":{"login":"luismbo","id":45759,"avatar_url":"https://avatars.githubusercontent.com/u/45759?v=3","gravatar_id":"","url":"https://api.github.com/users/luismbo","html_url":"https://github.com/luismbo","followers_url":"https://api.github.com/users/luismbo/followers","following_url":"https://api.github.com/users/luismbo/following{/other_user}","gists_url":"https://api.github.com/users/luismbo/gists{/gist_id}","starred_url":"https://api.github.com/users/luismbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luismbo/subscriptions","organizations_url":"https://api.github.com/users/luismbo/orgs","repos_url":"https://api.github.com/users/luismbo/repos","events_url":"https://api.github.com/users/luismbo/events{/privacy}","received_events_url":"https://api.github.com/users/luismbo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luismbo/magit","description":"It's Magit! An Emacs mode for Git.","fork":true,"url":"https://api.github.com/repos/luismbo/magit","forks_url":"https://api.github.com/repos/luismbo/magit/forks","keys_url":"https://api.github.com/repos/luismbo/magit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luismbo/magit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luismbo/magit/teams","hooks_url":"https://api.github.com/repos/luismbo/magit/hooks","issue_events_url":"https://api.github.com/repos/luismbo/magit/issues/events{/number}","events_url":"https://api.github.com/repos/luismbo/magit/events","assignees_url":"https://api.github.com/repos/luismbo/magit/assignees{/user}","branches_url":"https://api.github.com/repos/luismbo/magit/branches{/branch}","tags_url":"https://api.github.com/repos/luismbo/magit/tags","blobs_url":"https://api.github.com/repos/luismbo/magit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luismbo/magit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luismbo/magit/git/refs{/sha}","trees_url":"https://api.github.com/repos/luismbo/magit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luismbo/magit/statuses/{sha}","languages_url":"https://api.github.com/repos/luismbo/magit/languages","stargazers_url":"https://api.github.com/repos/luismbo/magit/stargazers","contributors_url":"https://api.github.com/repos/luismbo/magit/contributors","subscribers_url":"https://api.github.com/repos/luismbo/magit/subscribers","subscription_url":"https://api.github.com/repos/luismbo/magit/subscription","commits_url":"https://api.github.com/repos/luismbo/magit/commits{/sha}","git_commits_url":"https://api.github.com/repos/luismbo/magit/git/commits{/sha}","comments_url":"https://api.github.com/repos/luismbo/magit/comments{/number}","issue_comment_url":"https://api.github.com/repos/luismbo/magit/issues/comments{/number}","contents_url":"https://api.github.com/repos/luismbo/magit/contents/{+path}","compare_url":"https://api.github.com/repos/luismbo/magit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luismbo/magit/merges","archive_url":"https://api.github.com/repos/luismbo/magit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luismbo/magit/downloads","issues_url":"https://api.github.com/repos/luismbo/magit/issues{/number}","pulls_url":"https://api.github.com/repos/luismbo/magit/pulls{/number}","milestones_url":"https://api.github.com/repos/luismbo/magit/milestones{/number}","notifications_url":"https://api.github.com/repos/luismbo/magit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luismbo/magit/labels{/name}","releases_url":"https://api.github.com/repos/luismbo/magit/releases{/id}","deployments_url":"https://api.github.com/repos/luismbo/magit/deployments","created_at":"2011-05-17T18:20:16Z","updated_at":"2013-01-02T18:48:45Z","pushed_at":"2016-03-09T18:32:58Z","git_url":"git://github.com/luismbo/magit.git","ssh_url":"git@github.com:luismbo/magit.git","clone_url":"https://github.com/luismbo/magit.git","svn_url":"https://github.com/luismbo/magit","homepage":"","size":14944,"stargazers_count":1,"watchers_count":1,"language":"Emacs Lisp","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"magit:master","ref":"master","sha":"979584b2dbd23e209baecf9de1ee23f7e78989a3","user":{"login":"magit","id":750076,"avatar_url":"https://avatars.githubusercontent.com/u/750076?v=3","gravatar_id":"","url":"https://api.github.com/users/magit","html_url":"https://github.com/magit","followers_url":"https://api.github.com/users/magit/followers","following_url":"https://api.github.com/users/magit/following{/other_user}","gists_url":"https://api.github.com/users/magit/gists{/gist_id}","starred_url":"https://api.github.com/users/magit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magit/subscriptions","organizations_url":"https://api.github.com/users/magit/orgs","repos_url":"https://api.github.com/users/magit/repos","events_url":"https://api.github.com/users/magit/events{/privacy}","received_events_url":"https://api.github.com/users/magit/received_events","type":"Organization","site_admin":false},"repo":{"id":655492,"name":"magit","full_name":"magit/magit","owner":{"login":"magit","id":750076,"avatar_url":"https://avatars.githubusercontent.com/u/750076?v=3","gravatar_id":"","url":"https://api.github.com/users/magit","html_url":"https://github.com/magit","followers_url":"https://api.github.com/users/magit/followers","following_url":"https://api.github.com/users/magit/following{/other_user}","gists_url":"https://api.github.com/users/magit/gists{/gist_id}","starred_url":"https://api.github.com/users/magit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magit/subscriptions","organizations_url":"https://api.github.com/users/magit/orgs","repos_url":"https://api.github.com/users/magit/repos","events_url":"https://api.github.com/users/magit/events{/privacy}","received_events_url":"https://api.github.com/users/magit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magit/magit","description":"It's Magit! A Git Porcelain inside Emacs.","fork":false,"url":"https://api.github.com/repos/magit/magit","forks_url":"https://api.github.com/repos/magit/magit/forks","keys_url":"https://api.github.com/repos/magit/magit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magit/magit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magit/magit/teams","hooks_url":"https://api.github.com/repos/magit/magit/hooks","issue_events_url":"https://api.github.com/repos/magit/magit/issues/events{/number}","events_url":"https://api.github.com/repos/magit/magit/events","assignees_url":"https://api.github.com/repos/magit/magit/assignees{/user}","branches_url":"https://api.github.com/repos/magit/magit/branches{/branch}","tags_url":"https://api.github.com/repos/magit/magit/tags","blobs_url":"https://api.github.com/repos/magit/magit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magit/magit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magit/magit/git/refs{/sha}","trees_url":"https://api.github.com/repos/magit/magit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magit/magit/statuses/{sha}","languages_url":"https://api.github.com/repos/magit/magit/languages","stargazers_url":"https://api.github.com/repos/magit/magit/stargazers","contributors_url":"https://api.github.com/repos/magit/magit/contributors","subscribers_url":"https://api.github.com/repos/magit/magit/subscribers","subscription_url":"https://api.github.com/repos/magit/magit/subscription","commits_url":"https://api.github.com/repos/magit/magit/commits{/sha}","git_commits_url":"https://api.github.com/repos/magit/magit/git/commits{/sha}","comments_url":"https://api.github.com/repos/magit/magit/comments{/number}","issue_comment_url":"https://api.github.com/repos/magit/magit/issues/comments{/number}","contents_url":"https://api.github.com/repos/magit/magit/contents/{+path}","compare_url":"https://api.github.com/repos/magit/magit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magit/magit/merges","archive_url":"https://api.github.com/repos/magit/magit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magit/magit/downloads","issues_url":"https://api.github.com/repos/magit/magit/issues{/number}","pulls_url":"https://api.github.com/repos/magit/magit/pulls{/number}","milestones_url":"https://api.github.com/repos/magit/magit/milestones{/number}","notifications_url":"https://api.github.com/repos/magit/magit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magit/magit/labels{/name}","releases_url":"https://api.github.com/repos/magit/magit/releases{/id}","deployments_url":"https://api.github.com/repos/magit/magit/deployments","created_at":"2010-05-07T19:07:04Z","updated_at":"2016-03-09T11:12:18Z","pushed_at":"2016-03-09T18:32:58Z","git_url":"git://github.com/magit/magit.git","ssh_url":"git@github.com:magit/magit.git","clone_url":"https://github.com/magit/magit.git","svn_url":"https://github.com/magit/magit","homepage":"http://magit.vc","size":18947,"stargazers_count":1987,"watchers_count":1987,"language":"Emacs Lisp","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":392,"mirror_url":null,"open_issues_count":9,"forks":392,"open_issues":9,"watchers":1987,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/magit/magit/pulls/2584"},"html":{"href":"https://github.com/magit/magit/pull/2584"},"issue":{"href":"https://api.github.com/repos/magit/magit/issues/2584"},"comments":{"href":"https://api.github.com/repos/magit/magit/issues/2584/comments"},"review_comments":{"href":"https://api.github.com/repos/magit/magit/pulls/2584/comments"},"review_comment":{"href":"https://api.github.com/repos/magit/magit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magit/magit/pulls/2584/commits"},"statuses":{"href":"https://api.github.com/repos/magit/magit/statuses/8bbf6538d9bca73a61bd2976cec65368657c4ab1"}}}}