{"action":"created","comment":{"url":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments/88037536","pull_request_review_id":8623215,"id":88037536,"diff_hunk":"@@ -454,3 +455,33 @@ export async function getFileSizeOnDisk(loc: string): Promise<number> {\n export function normalizeOS(body: string): string {\n   return body.replace(/\\r\\n/g, '\\n');\n }\n+\n+const cr = new Buffer('\\r', 'utf8')[0];\n+const lf = new Buffer('\\n', 'utf8')[0];\n+\n+async function getEolFromFile(path: string) : Promise<string | void>  {","path":"src/util/fs.js","position":22,"original_position":22,"commit_id":"777a159864349a8743dbc5466bc9b73b9ac05ffb","original_commit_id":"777a159864349a8743dbc5466bc9b73b9ac05ffb","user":{"login":"bestander","id":2121048,"avatar_url":"https://avatars.githubusercontent.com/u/2121048?v=3","gravatar_id":"","url":"https://api.github.com/users/bestander","html_url":"https://github.com/bestander","followers_url":"https://api.github.com/users/bestander/followers","following_url":"https://api.github.com/users/bestander/following{/other_user}","gists_url":"https://api.github.com/users/bestander/gists{/gist_id}","starred_url":"https://api.github.com/users/bestander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bestander/subscriptions","organizations_url":"https://api.github.com/users/bestander/orgs","repos_url":"https://api.github.com/users/bestander/repos","events_url":"https://api.github.com/users/bestander/events{/privacy}","received_events_url":"https://api.github.com/users/bestander/received_events","type":"User","site_admin":false},"body":"The unfortunate bit is that it adds a read file to every write file operation.\r\nThat could unexpectedly slow down quite a few things.\r\nAny ideas how to apply this only to yarn.lock/package.json writing?","created_at":"2016-11-15T15:19:20Z","updated_at":"2016-11-15T15:19:20Z","html_url":"https://github.com/yarnpkg/yarn/pull/1405#discussion_r88037536","pull_request_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405","_links":{"self":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments/88037536"},"html":{"href":"https://github.com/yarnpkg/yarn/pull/1405#discussion_r88037536"},"pull_request":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405"}}},"pull_request":{"url":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405","id":90645368,"html_url":"https://github.com/yarnpkg/yarn/pull/1405","diff_url":"https://github.com/yarnpkg/yarn/pull/1405.diff","patch_url":"https://github.com/yarnpkg/yarn/pull/1405.patch","issue_url":"https://api.github.com/repos/yarnpkg/yarn/issues/1405","number":1405,"state":"open","locked":false,"title":"Infer EOLs from existing file or use OS EOL","user":{"login":"iredchuk","id":2714614,"avatar_url":"https://avatars.githubusercontent.com/u/2714614?v=3","gravatar_id":"","url":"https://api.github.com/users/iredchuk","html_url":"https://github.com/iredchuk","followers_url":"https://api.github.com/users/iredchuk/followers","following_url":"https://api.github.com/users/iredchuk/following{/other_user}","gists_url":"https://api.github.com/users/iredchuk/gists{/gist_id}","starred_url":"https://api.github.com/users/iredchuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iredchuk/subscriptions","organizations_url":"https://api.github.com/users/iredchuk/orgs","repos_url":"https://api.github.com/users/iredchuk/repos","events_url":"https://api.github.com/users/iredchuk/events{/privacy}","received_events_url":"https://api.github.com/users/iredchuk/received_events","type":"User","site_admin":false},"body":"<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->\n\n**Summary**\n\nYarn uses UNIX line endings on all systems when writing lock file. We want to solve this problem as described in  #1061: infer line endings from the existing file, and if it does not exist, use the system default.\n\n**Test plan**\n\n<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->\n\nOn a UNIX system, in an empty directory:\n$ yarn add <some_package>\n$ cat -e yarn.lock\nYou should only see LF line endings.\n$ unix2dos yarn.lock\n$ yarn add <some_other_package>\n$ cat -e yarn.lock\nYou should only see CRLF line endings.\n\nOn a Windows system, in an empty directory:\n$ yarn add <some_package>\n$ cat.exe -e yarn.lock\nYou should only see CRLF line endings.\n$ dos2unix.exe yarn.lock\n$ yarn add <some_other_package>\n$ cat -e yarn.lock\nYou should only see LF line endings.\n","created_at":"2016-10-24T16:17:18Z","updated_at":"2016-11-15T15:23:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9910a77573228215c1ee43a7765aad1ba6c141f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405/commits","review_comments_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405/comments","review_comment_url":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/issues/1405/comments","statuses_url":"https://api.github.com/repos/yarnpkg/yarn/statuses/777a159864349a8743dbc5466bc9b73b9ac05ffb","head":{"label":"CHECK24:preserve-line-endings-when-file-exists","ref":"preserve-line-endings-when-file-exists","sha":"777a159864349a8743dbc5466bc9b73b9ac05ffb","user":{"login":"CHECK24","id":5879923,"avatar_url":"https://avatars.githubusercontent.com/u/5879923?v=3","gravatar_id":"","url":"https://api.github.com/users/CHECK24","html_url":"https://github.com/CHECK24","followers_url":"https://api.github.com/users/CHECK24/followers","following_url":"https://api.github.com/users/CHECK24/following{/other_user}","gists_url":"https://api.github.com/users/CHECK24/gists{/gist_id}","starred_url":"https://api.github.com/users/CHECK24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CHECK24/subscriptions","organizations_url":"https://api.github.com/users/CHECK24/orgs","repos_url":"https://api.github.com/users/CHECK24/repos","events_url":"https://api.github.com/users/CHECK24/events{/privacy}","received_events_url":"https://api.github.com/users/CHECK24/received_events","type":"Organization","site_admin":false},"repo":{"id":71793004,"name":"yarn","full_name":"CHECK24/yarn","owner":{"login":"CHECK24","id":5879923,"avatar_url":"https://avatars.githubusercontent.com/u/5879923?v=3","gravatar_id":"","url":"https://api.github.com/users/CHECK24","html_url":"https://github.com/CHECK24","followers_url":"https://api.github.com/users/CHECK24/followers","following_url":"https://api.github.com/users/CHECK24/following{/other_user}","gists_url":"https://api.github.com/users/CHECK24/gists{/gist_id}","starred_url":"https://api.github.com/users/CHECK24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CHECK24/subscriptions","organizations_url":"https://api.github.com/users/CHECK24/orgs","repos_url":"https://api.github.com/users/CHECK24/repos","events_url":"https://api.github.com/users/CHECK24/events{/privacy}","received_events_url":"https://api.github.com/users/CHECK24/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CHECK24/yarn","description":"📦🐈 Fast, reliable, and secure dependency management.","fork":true,"url":"https://api.github.com/repos/CHECK24/yarn","forks_url":"https://api.github.com/repos/CHECK24/yarn/forks","keys_url":"https://api.github.com/repos/CHECK24/yarn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CHECK24/yarn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CHECK24/yarn/teams","hooks_url":"https://api.github.com/repos/CHECK24/yarn/hooks","issue_events_url":"https://api.github.com/repos/CHECK24/yarn/issues/events{/number}","events_url":"https://api.github.com/repos/CHECK24/yarn/events","assignees_url":"https://api.github.com/repos/CHECK24/yarn/assignees{/user}","branches_url":"https://api.github.com/repos/CHECK24/yarn/branches{/branch}","tags_url":"https://api.github.com/repos/CHECK24/yarn/tags","blobs_url":"https://api.github.com/repos/CHECK24/yarn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CHECK24/yarn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CHECK24/yarn/git/refs{/sha}","trees_url":"https://api.github.com/repos/CHECK24/yarn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CHECK24/yarn/statuses/{sha}","languages_url":"https://api.github.com/repos/CHECK24/yarn/languages","stargazers_url":"https://api.github.com/repos/CHECK24/yarn/stargazers","contributors_url":"https://api.github.com/repos/CHECK24/yarn/contributors","subscribers_url":"https://api.github.com/repos/CHECK24/yarn/subscribers","subscription_url":"https://api.github.com/repos/CHECK24/yarn/subscription","commits_url":"https://api.github.com/repos/CHECK24/yarn/commits{/sha}","git_commits_url":"https://api.github.com/repos/CHECK24/yarn/git/commits{/sha}","comments_url":"https://api.github.com/repos/CHECK24/yarn/comments{/number}","issue_comment_url":"https://api.github.com/repos/CHECK24/yarn/issues/comments{/number}","contents_url":"https://api.github.com/repos/CHECK24/yarn/contents/{+path}","compare_url":"https://api.github.com/repos/CHECK24/yarn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CHECK24/yarn/merges","archive_url":"https://api.github.com/repos/CHECK24/yarn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CHECK24/yarn/downloads","issues_url":"https://api.github.com/repos/CHECK24/yarn/issues{/number}","pulls_url":"https://api.github.com/repos/CHECK24/yarn/pulls{/number}","milestones_url":"https://api.github.com/repos/CHECK24/yarn/milestones{/number}","notifications_url":"https://api.github.com/repos/CHECK24/yarn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CHECK24/yarn/labels{/name}","releases_url":"https://api.github.com/repos/CHECK24/yarn/releases{/id}","deployments_url":"https://api.github.com/repos/CHECK24/yarn/deployments","created_at":"2016-10-24T13:41:07Z","updated_at":"2016-10-24T13:41:19Z","pushed_at":"2016-11-15T00:29:22Z","git_url":"git://github.com/CHECK24/yarn.git","ssh_url":"git@github.com:CHECK24/yarn.git","clone_url":"https://github.com/CHECK24/yarn.git","svn_url":"https://github.com/CHECK24/yarn","homepage":"https://yarnpkg.com","size":41745,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yarnpkg:master","ref":"master","sha":"8ead0c7fe8cdd478493aab66b0c1ff4180ac924a","user":{"login":"yarnpkg","id":22247014,"avatar_url":"https://avatars.githubusercontent.com/u/22247014?v=3","gravatar_id":"","url":"https://api.github.com/users/yarnpkg","html_url":"https://github.com/yarnpkg","followers_url":"https://api.github.com/users/yarnpkg/followers","following_url":"https://api.github.com/users/yarnpkg/following{/other_user}","gists_url":"https://api.github.com/users/yarnpkg/gists{/gist_id}","starred_url":"https://api.github.com/users/yarnpkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarnpkg/subscriptions","organizations_url":"https://api.github.com/users/yarnpkg/orgs","repos_url":"https://api.github.com/users/yarnpkg/repos","events_url":"https://api.github.com/users/yarnpkg/events{/privacy}","received_events_url":"https://api.github.com/users/yarnpkg/received_events","type":"Organization","site_admin":false},"repo":{"id":49970642,"name":"yarn","full_name":"yarnpkg/yarn","owner":{"login":"yarnpkg","id":22247014,"avatar_url":"https://avatars.githubusercontent.com/u/22247014?v=3","gravatar_id":"","url":"https://api.github.com/users/yarnpkg","html_url":"https://github.com/yarnpkg","followers_url":"https://api.github.com/users/yarnpkg/followers","following_url":"https://api.github.com/users/yarnpkg/following{/other_user}","gists_url":"https://api.github.com/users/yarnpkg/gists{/gist_id}","starred_url":"https://api.github.com/users/yarnpkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarnpkg/subscriptions","organizations_url":"https://api.github.com/users/yarnpkg/orgs","repos_url":"https://api.github.com/users/yarnpkg/repos","events_url":"https://api.github.com/users/yarnpkg/events{/privacy}","received_events_url":"https://api.github.com/users/yarnpkg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarnpkg/yarn","description":"📦🐈 Fast, reliable, and secure dependency management.","fork":false,"url":"https://api.github.com/repos/yarnpkg/yarn","forks_url":"https://api.github.com/repos/yarnpkg/yarn/forks","keys_url":"https://api.github.com/repos/yarnpkg/yarn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarnpkg/yarn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarnpkg/yarn/teams","hooks_url":"https://api.github.com/repos/yarnpkg/yarn/hooks","issue_events_url":"https://api.github.com/repos/yarnpkg/yarn/issues/events{/number}","events_url":"https://api.github.com/repos/yarnpkg/yarn/events","assignees_url":"https://api.github.com/repos/yarnpkg/yarn/assignees{/user}","branches_url":"https://api.github.com/repos/yarnpkg/yarn/branches{/branch}","tags_url":"https://api.github.com/repos/yarnpkg/yarn/tags","blobs_url":"https://api.github.com/repos/yarnpkg/yarn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarnpkg/yarn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarnpkg/yarn/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarnpkg/yarn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarnpkg/yarn/statuses/{sha}","languages_url":"https://api.github.com/repos/yarnpkg/yarn/languages","stargazers_url":"https://api.github.com/repos/yarnpkg/yarn/stargazers","contributors_url":"https://api.github.com/repos/yarnpkg/yarn/contributors","subscribers_url":"https://api.github.com/repos/yarnpkg/yarn/subscribers","subscription_url":"https://api.github.com/repos/yarnpkg/yarn/subscription","commits_url":"https://api.github.com/repos/yarnpkg/yarn/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarnpkg/yarn/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarnpkg/yarn/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarnpkg/yarn/contents/{+path}","compare_url":"https://api.github.com/repos/yarnpkg/yarn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarnpkg/yarn/merges","archive_url":"https://api.github.com/repos/yarnpkg/yarn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarnpkg/yarn/downloads","issues_url":"https://api.github.com/repos/yarnpkg/yarn/issues{/number}","pulls_url":"https://api.github.com/repos/yarnpkg/yarn/pulls{/number}","milestones_url":"https://api.github.com/repos/yarnpkg/yarn/milestones{/number}","notifications_url":"https://api.github.com/repos/yarnpkg/yarn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarnpkg/yarn/labels{/name}","releases_url":"https://api.github.com/repos/yarnpkg/yarn/releases{/id}","deployments_url":"https://api.github.com/repos/yarnpkg/yarn/deployments","created_at":"2016-01-19T17:39:16Z","updated_at":"2016-11-15T15:21:02Z","pushed_at":"2016-11-15T14:59:46Z","git_url":"git://github.com/yarnpkg/yarn.git","ssh_url":"git@github.com:yarnpkg/yarn.git","clone_url":"https://github.com/yarnpkg/yarn.git","svn_url":"https://github.com/yarnpkg/yarn","homepage":"https://yarnpkg.com","size":52350,"stargazers_count":19124,"watchers_count":19124,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":640,"mirror_url":null,"open_issues_count":409,"forks":640,"open_issues":409,"watchers":19124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405"},"html":{"href":"https://github.com/yarnpkg/yarn/pull/1405"},"issue":{"href":"https://api.github.com/repos/yarnpkg/yarn/issues/1405"},"comments":{"href":"https://api.github.com/repos/yarnpkg/yarn/issues/1405/comments"},"review_comments":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405/comments"},"review_comment":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yarnpkg/yarn/pulls/1405/commits"},"statuses":{"href":"https://api.github.com/repos/yarnpkg/yarn/statuses/777a159864349a8743dbc5466bc9b73b9ac05ffb"}}}}
{"actor":{"display_login":"bestander"}}