{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments/47815928","id":47815928,"diff_hunk":"@@ -27,23 +27,32 @@ namespace boost_file = boost::filesystem;\n         return true;\n     }\n \n-    string read(string const& path) {\n-        string contents;\n-        if (!read(path, contents)) {\n-            return {};\n-        }\n-        return contents;\n-    }\n+    // This function attempts to read a file at the given path in text mode and return its contents as\n+    // a string. If the file at the path is a symlink, it will be followed until a non-symlink file is\n+    // found. If anything goes wrong, a file_error will be thrown.\n+    std::string read(const boost_file::path& path) {\n+      boost_file::path p(path);\n+      while (boost_file::is_symlink(p)) {\n+        p = boost_file::read_symlink(p);\n+      }\n \n-    bool read(string const& path, string& contents) {\n-        boost::nowide::ifstream in(path.c_str(), ios::in | ios::binary);\n-        ostringstream buffer;\n-        if (!in) {\n-            return false;\n-        }\n-        buffer << in.rdbuf();\n-        contents = buffer.str();\n-        return true;\n+      boost::nowide::ifstream file(p.c_str());","path":"file_util/src/file.cc","position":29,"original_position":29,"commit_id":"956c669222d8c5ce0e7a287e69795daff70d2a53","original_commit_id":"956c669222d8c5ce0e7a287e69795daff70d2a53","user":{"login":"pcarlisle","id":1234752,"avatar_url":"https://avatars.githubusercontent.com/u/1234752?v=3","gravatar_id":"","url":"https://api.github.com/users/pcarlisle","html_url":"https://github.com/pcarlisle","followers_url":"https://api.github.com/users/pcarlisle/followers","following_url":"https://api.github.com/users/pcarlisle/following{/other_user}","gists_url":"https://api.github.com/users/pcarlisle/gists{/gist_id}","starred_url":"https://api.github.com/users/pcarlisle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcarlisle/subscriptions","organizations_url":"https://api.github.com/users/pcarlisle/orgs","repos_url":"https://api.github.com/users/pcarlisle/repos","events_url":"https://api.github.com/users/pcarlisle/events{/privacy}","received_events_url":"https://api.github.com/users/pcarlisle/received_events","type":"User","site_admin":false},"body":"prefer list initialization syntax","created_at":"2015-12-16T18:46:40Z","updated_at":"2015-12-16T18:46:40Z","html_url":"https://github.com/puppetlabs/leatherman/pull/117#discussion_r47815928","pull_request_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments/47815928"},"html":{"href":"https://github.com/puppetlabs/leatherman/pull/117#discussion_r47815928"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117","id":53875577,"html_url":"https://github.com/puppetlabs/leatherman/pull/117","diff_url":"https://github.com/puppetlabs/leatherman/pull/117.diff","patch_url":"https://github.com/puppetlabs/leatherman/pull/117.patch","issue_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/117","number":117,"state":"open","locked":false,"title":"DO NOT MERGE Change semantics of file_util::read.","user":{"login":"aperiodic","id":115510,"avatar_url":"https://avatars.githubusercontent.com/u/115510?v=3","gravatar_id":"","url":"https://api.github.com/users/aperiodic","html_url":"https://github.com/aperiodic","followers_url":"https://api.github.com/users/aperiodic/followers","following_url":"https://api.github.com/users/aperiodic/following{/other_user}","gists_url":"https://api.github.com/users/aperiodic/gists{/gist_id}","starred_url":"https://api.github.com/users/aperiodic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aperiodic/subscriptions","organizations_url":"https://api.github.com/users/aperiodic/orgs","repos_url":"https://api.github.com/users/aperiodic/repos","events_url":"https://api.github.com/users/aperiodic/events{/privacy}","received_events_url":"https://api.github.com/users/aperiodic/received_events","type":"User","site_admin":false},"body":"Change file_util::read to throw errors rather than return the empty\r\nstring when the file doesn't exist, can't be read, or an I/O error\r\noccurred while reading it.\r\n\r\n*DO NOT MERGE* I put this up so we can talk about the proposed changes, but it's not yet ready (tests don't compile).","created_at":"2015-12-16T17:55:42Z","updated_at":"2015-12-16T18:46:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ad1210d3c9f4c920b3e442c20b021ff39b4e6cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/117/comments","statuses_url":"https://api.github.com/repos/puppetlabs/leatherman/statuses/956c669222d8c5ce0e7a287e69795daff70d2a53","head":{"label":"aperiodic:file-util-changes","ref":"file-util-changes","sha":"956c669222d8c5ce0e7a287e69795daff70d2a53","user":{"login":"aperiodic","id":115510,"avatar_url":"https://avatars.githubusercontent.com/u/115510?v=3","gravatar_id":"","url":"https://api.github.com/users/aperiodic","html_url":"https://github.com/aperiodic","followers_url":"https://api.github.com/users/aperiodic/followers","following_url":"https://api.github.com/users/aperiodic/following{/other_user}","gists_url":"https://api.github.com/users/aperiodic/gists{/gist_id}","starred_url":"https://api.github.com/users/aperiodic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aperiodic/subscriptions","organizations_url":"https://api.github.com/users/aperiodic/orgs","repos_url":"https://api.github.com/users/aperiodic/repos","events_url":"https://api.github.com/users/aperiodic/events{/privacy}","received_events_url":"https://api.github.com/users/aperiodic/received_events","type":"User","site_admin":false},"repo":{"id":40998088,"name":"leatherman","full_name":"aperiodic/leatherman","owner":{"login":"aperiodic","id":115510,"avatar_url":"https://avatars.githubusercontent.com/u/115510?v=3","gravatar_id":"","url":"https://api.github.com/users/aperiodic","html_url":"https://github.com/aperiodic","followers_url":"https://api.github.com/users/aperiodic/followers","following_url":"https://api.github.com/users/aperiodic/following{/other_user}","gists_url":"https://api.github.com/users/aperiodic/gists{/gist_id}","starred_url":"https://api.github.com/users/aperiodic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aperiodic/subscriptions","organizations_url":"https://api.github.com/users/aperiodic/orgs","repos_url":"https://api.github.com/users/aperiodic/repos","events_url":"https://api.github.com/users/aperiodic/events{/privacy}","received_events_url":"https://api.github.com/users/aperiodic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aperiodic/leatherman","description":"A collection of C++ and CMake utility libraries.","fork":true,"url":"https://api.github.com/repos/aperiodic/leatherman","forks_url":"https://api.github.com/repos/aperiodic/leatherman/forks","keys_url":"https://api.github.com/repos/aperiodic/leatherman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aperiodic/leatherman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aperiodic/leatherman/teams","hooks_url":"https://api.github.com/repos/aperiodic/leatherman/hooks","issue_events_url":"https://api.github.com/repos/aperiodic/leatherman/issues/events{/number}","events_url":"https://api.github.com/repos/aperiodic/leatherman/events","assignees_url":"https://api.github.com/repos/aperiodic/leatherman/assignees{/user}","branches_url":"https://api.github.com/repos/aperiodic/leatherman/branches{/branch}","tags_url":"https://api.github.com/repos/aperiodic/leatherman/tags","blobs_url":"https://api.github.com/repos/aperiodic/leatherman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aperiodic/leatherman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aperiodic/leatherman/git/refs{/sha}","trees_url":"https://api.github.com/repos/aperiodic/leatherman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aperiodic/leatherman/statuses/{sha}","languages_url":"https://api.github.com/repos/aperiodic/leatherman/languages","stargazers_url":"https://api.github.com/repos/aperiodic/leatherman/stargazers","contributors_url":"https://api.github.com/repos/aperiodic/leatherman/contributors","subscribers_url":"https://api.github.com/repos/aperiodic/leatherman/subscribers","subscription_url":"https://api.github.com/repos/aperiodic/leatherman/subscription","commits_url":"https://api.github.com/repos/aperiodic/leatherman/commits{/sha}","git_commits_url":"https://api.github.com/repos/aperiodic/leatherman/git/commits{/sha}","comments_url":"https://api.github.com/repos/aperiodic/leatherman/comments{/number}","issue_comment_url":"https://api.github.com/repos/aperiodic/leatherman/issues/comments{/number}","contents_url":"https://api.github.com/repos/aperiodic/leatherman/contents/{+path}","compare_url":"https://api.github.com/repos/aperiodic/leatherman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aperiodic/leatherman/merges","archive_url":"https://api.github.com/repos/aperiodic/leatherman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aperiodic/leatherman/downloads","issues_url":"https://api.github.com/repos/aperiodic/leatherman/issues{/number}","pulls_url":"https://api.github.com/repos/aperiodic/leatherman/pulls{/number}","milestones_url":"https://api.github.com/repos/aperiodic/leatherman/milestones{/number}","notifications_url":"https://api.github.com/repos/aperiodic/leatherman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aperiodic/leatherman/labels{/name}","releases_url":"https://api.github.com/repos/aperiodic/leatherman/releases{/id}","created_at":"2015-08-18T21:19:39Z","updated_at":"2015-08-18T21:19:40Z","pushed_at":"2015-12-16T17:54:39Z","git_url":"git://github.com/aperiodic/leatherman.git","ssh_url":"git@github.com:aperiodic/leatherman.git","clone_url":"https://github.com/aperiodic/leatherman.git","svn_url":"https://github.com/aperiodic/leatherman","homepage":"","size":524,"stargazers_count":0,"watchers_count":0,"language":"C++","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":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"6c942b662b2798777412f7c896dc94aafcc22b33","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":31226286,"name":"leatherman","full_name":"puppetlabs/leatherman","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/leatherman","description":"A collection of C++ and CMake utility libraries.","fork":false,"url":"https://api.github.com/repos/puppetlabs/leatherman","forks_url":"https://api.github.com/repos/puppetlabs/leatherman/forks","keys_url":"https://api.github.com/repos/puppetlabs/leatherman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/leatherman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/leatherman/teams","hooks_url":"https://api.github.com/repos/puppetlabs/leatherman/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/leatherman/events","assignees_url":"https://api.github.com/repos/puppetlabs/leatherman/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/leatherman/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/leatherman/tags","blobs_url":"https://api.github.com/repos/puppetlabs/leatherman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/leatherman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/leatherman/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/leatherman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/leatherman/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/leatherman/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/leatherman/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/leatherman/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/leatherman/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/leatherman/subscription","commits_url":"https://api.github.com/repos/puppetlabs/leatherman/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/leatherman/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/leatherman/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/leatherman/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/leatherman/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/leatherman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/leatherman/merges","archive_url":"https://api.github.com/repos/puppetlabs/leatherman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/leatherman/downloads","issues_url":"https://api.github.com/repos/puppetlabs/leatherman/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/leatherman/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/leatherman/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/leatherman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/leatherman/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/leatherman/releases{/id}","created_at":"2015-02-23T19:50:46Z","updated_at":"2015-10-08T21:55:05Z","pushed_at":"2015-12-16T17:55:42Z","git_url":"git://github.com/puppetlabs/leatherman.git","ssh_url":"git@github.com:puppetlabs/leatherman.git","clone_url":"https://github.com/puppetlabs/leatherman.git","svn_url":"https://github.com/puppetlabs/leatherman","homepage":"","size":789,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":6,"forks":19,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117"},"html":{"href":"https://github.com/puppetlabs/leatherman/pull/117"},"issue":{"href":"https://api.github.com/repos/puppetlabs/leatherman/issues/117"},"comments":{"href":"https://api.github.com/repos/puppetlabs/leatherman/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/leatherman/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/leatherman/statuses/956c669222d8c5ce0e7a287e69795daff70d2a53"}}}}