{"action":"closed","number":13209,"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13209","id":187179238,"html_url":"https://github.com/bitcoin/bitcoin/pull/13209","diff_url":"https://github.com/bitcoin/bitcoin/pull/13209.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/13209.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13209","number":13209,"state":"closed","locked":false,"title":"[WIP] Refactoring platform-specific code in util.h/util.cpp","user":{"login":"glaksmono","id":286254,"avatar_url":"https://avatars3.githubusercontent.com/u/286254?v=4","gravatar_id":"","url":"https://api.github.com/users/glaksmono","html_url":"https://github.com/glaksmono","followers_url":"https://api.github.com/users/glaksmono/followers","following_url":"https://api.github.com/users/glaksmono/following{/other_user}","gists_url":"https://api.github.com/users/glaksmono/gists{/gist_id}","starred_url":"https://api.github.com/users/glaksmono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glaksmono/subscriptions","organizations_url":"https://api.github.com/users/glaksmono/orgs","repos_url":"https://api.github.com/users/glaksmono/repos","events_url":"https://api.github.com/users/glaksmono/events{/privacy}","received_events_url":"https://api.github.com/users/glaksmono/received_events","type":"User","site_admin":false},"body":"Take all of the functions that are specific to Windows or Unix, and create a common set of methods in a new header file, all combined in the `src/util/` folder.\r\n\r\nThe goal of this PR is to break `src/util.cpp` and `src/util.h` into the following files:\r\n\r\n**For Across Platform:**\r\n* `src/util/platform_common.h`\r\n* `src/util/platform_common.cpp`\r\n\r\n**For Windows:**\r\n* `src/util/platform_windows.cpp`\r\n\r\n**For Mac & Linux:**\r\n* `src/util/platform_posix.cpp`\r\n\r\nIssue Reference: https://github.com/bitcoin/bitcoin/issues/12697\r\n\r\n## Discussion\r\n1. How should we handle \"duplicate codes\"? For example: [this](https://github.com/bitcoin/bitcoin/pull/13209/files#diff-2da22387097e9ac5c565ab65b73cf151R95) & [this](https://github.com/bitcoin/bitcoin/pull/13209/files#diff-705e6c45222827fdee5fdf9891982ba4R101)\r\n2. Certain things seems to be \"very specific to a certain posix platform\". How do we want to handle this? For example: [this](https://github.com/bitcoin/bitcoin/pull/13209/files#diff-2da22387097e9ac5c565ab65b73cf151R15) & [this](https://github.com/glaksmono/bitcoin/blob/da361f0410149d085a89a7492eaa5261c41221dd/src/util/platform_common.cpp#L890)","created_at":"2018-05-10T12:27:28Z","updated_at":"2018-05-14T11:58:52Z","closed_at":"2018-05-14T11:58:51Z","merged_at":null,"merge_commit_sha":"1c5aa5036517ed0c9969fa7e9de3a898cb117465","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":135961,"url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Refactoring","name":"Refactoring","color":"E6F6D6","default":false},{"id":241832923,"url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Utils/log/libs","name":"Utils/log/libs","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13209/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13209/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13209/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/da361f0410149d085a89a7492eaa5261c41221dd","head":{"label":"glaksmono:bitcoin-12697","ref":"bitcoin-12697","sha":"da361f0410149d085a89a7492eaa5261c41221dd","user":{"login":"glaksmono","id":286254,"avatar_url":"https://avatars3.githubusercontent.com/u/286254?v=4","gravatar_id":"","url":"https://api.github.com/users/glaksmono","html_url":"https://github.com/glaksmono","followers_url":"https://api.github.com/users/glaksmono/followers","following_url":"https://api.github.com/users/glaksmono/following{/other_user}","gists_url":"https://api.github.com/users/glaksmono/gists{/gist_id}","starred_url":"https://api.github.com/users/glaksmono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glaksmono/subscriptions","organizations_url":"https://api.github.com/users/glaksmono/orgs","repos_url":"https://api.github.com/users/glaksmono/repos","events_url":"https://api.github.com/users/glaksmono/events{/privacy}","received_events_url":"https://api.github.com/users/glaksmono/received_events","type":"User","site_admin":false},"repo":{"id":121600812,"name":"bitcoin","full_name":"glaksmono/bitcoin","owner":{"login":"glaksmono","id":286254,"avatar_url":"https://avatars3.githubusercontent.com/u/286254?v=4","gravatar_id":"","url":"https://api.github.com/users/glaksmono","html_url":"https://github.com/glaksmono","followers_url":"https://api.github.com/users/glaksmono/followers","following_url":"https://api.github.com/users/glaksmono/following{/other_user}","gists_url":"https://api.github.com/users/glaksmono/gists{/gist_id}","starred_url":"https://api.github.com/users/glaksmono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glaksmono/subscriptions","organizations_url":"https://api.github.com/users/glaksmono/orgs","repos_url":"https://api.github.com/users/glaksmono/repos","events_url":"https://api.github.com/users/glaksmono/events{/privacy}","received_events_url":"https://api.github.com/users/glaksmono/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/glaksmono/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/glaksmono/bitcoin","forks_url":"https://api.github.com/repos/glaksmono/bitcoin/forks","keys_url":"https://api.github.com/repos/glaksmono/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glaksmono/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glaksmono/bitcoin/teams","hooks_url":"https://api.github.com/repos/glaksmono/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/glaksmono/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/glaksmono/bitcoin/events","assignees_url":"https://api.github.com/repos/glaksmono/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/glaksmono/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/glaksmono/bitcoin/tags","blobs_url":"https://api.github.com/repos/glaksmono/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glaksmono/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glaksmono/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/glaksmono/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glaksmono/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/glaksmono/bitcoin/languages","stargazers_url":"https://api.github.com/repos/glaksmono/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/glaksmono/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/glaksmono/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/glaksmono/bitcoin/subscription","commits_url":"https://api.github.com/repos/glaksmono/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/glaksmono/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/glaksmono/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/glaksmono/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/glaksmono/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/glaksmono/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glaksmono/bitcoin/merges","archive_url":"https://api.github.com/repos/glaksmono/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glaksmono/bitcoin/downloads","issues_url":"https://api.github.com/repos/glaksmono/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/glaksmono/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/glaksmono/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/glaksmono/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glaksmono/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/glaksmono/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/glaksmono/bitcoin/deployments","created_at":"2018-02-15T07:10:08Z","updated_at":"2018-05-10T12:18:44Z","pushed_at":"2018-05-10T12:19:55Z","git_url":"git://github.com/glaksmono/bitcoin.git","ssh_url":"git@github.com:glaksmono/bitcoin.git","clone_url":"https://github.com/glaksmono/bitcoin.git","svn_url":"https://github.com/glaksmono/bitcoin","homepage":"https://bitcoin.org/en/download","size":104976,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"196c5a947a071f7c9c5b211f0a47787a7d540ecb","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2018-05-14T11:58:29Z","pushed_at":"2018-05-14T09:17:53Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":105362,"stargazers_count":31429,"watchers_count":31429,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":18884,"mirror_url":null,"archived":false,"open_issues_count":797,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":18884,"open_issues":797,"watchers":31429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13209"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13209"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13209"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13209/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13209/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13209/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/da361f0410149d085a89a7492eaa5261c41221dd"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"unstable","merged_by":null,"comments":4,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":450,"deletions":243,"changed_files":100}}
{"actor":{"display_login":"glaksmono"}}