{"action":"created","issue":{"url":"https://api.github.com/repos/desktop/desktop/issues/4783","repository_url":"https://api.github.com/repos/desktop/desktop","labels_url":"https://api.github.com/repos/desktop/desktop/issues/4783/labels{/name}","comments_url":"https://api.github.com/repos/desktop/desktop/issues/4783/comments","events_url":"https://api.github.com/repos/desktop/desktop/issues/4783/events","html_url":"https://github.com/desktop/desktop/pull/4783","id":326274082,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNDA3MTEx","number":4783,"title":"Adds logic that determines what branch to use as the compare branch (NDDB)","user":{"login":"iAmWillShepherd","id":1715082,"node_id":"MDQ6VXNlcjE3MTUwODI=","avatar_url":"https://avatars0.githubusercontent.com/u/1715082?v=4","gravatar_id":"","url":"https://api.github.com/users/iAmWillShepherd","html_url":"https://github.com/iAmWillShepherd","followers_url":"https://api.github.com/users/iAmWillShepherd/followers","following_url":"https://api.github.com/users/iAmWillShepherd/following{/other_user}","gists_url":"https://api.github.com/users/iAmWillShepherd/gists{/gist_id}","starred_url":"https://api.github.com/users/iAmWillShepherd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iAmWillShepherd/subscriptions","organizations_url":"https://api.github.com/users/iAmWillShepherd/orgs","repos_url":"https://api.github.com/users/iAmWillShepherd/repos","events_url":"https://api.github.com/users/iAmWillShepherd/events{/privacy}","received_events_url":"https://api.github.com/users/iAmWillShepherd/received_events","type":"User","site_admin":true},"labels":[{"id":590997902,"node_id":"MDU6TGFiZWw1OTA5OTc5MDI=","url":"https://api.github.com/repos/desktop/desktop/labels/ready-for-review","name":"ready-for-review","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":{"login":"nerdneha","id":1834387,"node_id":"MDQ6VXNlcjE4MzQzODc=","avatar_url":"https://avatars0.githubusercontent.com/u/1834387?v=4","gravatar_id":"","url":"https://api.github.com/users/nerdneha","html_url":"https://github.com/nerdneha","followers_url":"https://api.github.com/users/nerdneha/followers","following_url":"https://api.github.com/users/nerdneha/following{/other_user}","gists_url":"https://api.github.com/users/nerdneha/gists{/gist_id}","starred_url":"https://api.github.com/users/nerdneha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerdneha/subscriptions","organizations_url":"https://api.github.com/users/nerdneha/orgs","repos_url":"https://api.github.com/users/nerdneha/repos","events_url":"https://api.github.com/users/nerdneha/events{/privacy}","received_events_url":"https://api.github.com/users/nerdneha/received_events","type":"User","site_admin":true},"assignees":[{"login":"nerdneha","id":1834387,"node_id":"MDQ6VXNlcjE4MzQzODc=","avatar_url":"https://avatars0.githubusercontent.com/u/1834387?v=4","gravatar_id":"","url":"https://api.github.com/users/nerdneha","html_url":"https://github.com/nerdneha","followers_url":"https://api.github.com/users/nerdneha/followers","following_url":"https://api.github.com/users/nerdneha/following{/other_user}","gists_url":"https://api.github.com/users/nerdneha/gists{/gist_id}","starred_url":"https://api.github.com/users/nerdneha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerdneha/subscriptions","organizations_url":"https://api.github.com/users/nerdneha/orgs","repos_url":"https://api.github.com/users/nerdneha/repos","events_url":"https://api.github.com/users/nerdneha/events{/privacy}","received_events_url":"https://api.github.com/users/nerdneha/received_events","type":"User","site_admin":true}],"milestone":null,"comments":2,"created_at":"2018-05-24T20:14:24Z","updated_at":"2018-06-12T17:45:36Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/desktop/desktop/pulls/4783","html_url":"https://github.com/desktop/desktop/pull/4783","diff_url":"https://github.com/desktop/desktop/pull/4783.diff","patch_url":"https://github.com/desktop/desktop/pull/4783.patch"},"body":"Fixes #4766 \r\n\r\nThis PR encapsulates the logic detailed in the issue inside of a function.\r\n> ### Criteria to determine compare branch (in priority order)\r\n> 1. If the current branch has a PR associated with it, use the target branch of the PR _(this can be a branch that exists on either`upstream` or`origin`)_\r\n> 1. If the repository is a fork, use the default branch on `upstream` _(this is usually `master`)_ \r\n> 1. If the repository is hosted on GitHub, use the  default branch on `origin` _(this is usually `master`)_\r\n> 1. Otherwise fall through to the local `master` branch (conventionally, the default branch is `master`)\r\n\r\n~Some notes up front, I'm not sure of the actual place this functions belongs, so I put it next to related functions. Since it's self contained, it shouldn't be a huge deal to move it to a better place.~\r\n\r\n- [x] Add function to encapsulate logic\r\n- [x] Add helper function that can choose the right branch on forked repositories\r\n- [x] Write some tests to exercise ☝️ \r\n- [x] Clean up"},"comment":{"url":"https://api.github.com/repos/desktop/desktop/issues/comments/396675550","html_url":"https://github.com/desktop/desktop/pull/4783#issuecomment-396675550","issue_url":"https://api.github.com/repos/desktop/desktop/issues/4783","id":396675550,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjY3NTU1MA==","user":{"login":"iAmWillShepherd","id":1715082,"node_id":"MDQ6VXNlcjE3MTUwODI=","avatar_url":"https://avatars0.githubusercontent.com/u/1715082?v=4","gravatar_id":"","url":"https://api.github.com/users/iAmWillShepherd","html_url":"https://github.com/iAmWillShepherd","followers_url":"https://api.github.com/users/iAmWillShepherd/followers","following_url":"https://api.github.com/users/iAmWillShepherd/following{/other_user}","gists_url":"https://api.github.com/users/iAmWillShepherd/gists{/gist_id}","starred_url":"https://api.github.com/users/iAmWillShepherd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iAmWillShepherd/subscriptions","organizations_url":"https://api.github.com/users/iAmWillShepherd/orgs","repos_url":"https://api.github.com/users/iAmWillShepherd/repos","events_url":"https://api.github.com/users/iAmWillShepherd/events{/privacy}","received_events_url":"https://api.github.com/users/iAmWillShepherd/received_events","type":"User","site_admin":true},"created_at":"2018-06-12T17:45:35Z","updated_at":"2018-06-12T17:45:35Z","author_association":"CONTRIBUTOR","body":"> What happens if we branch off of branchA to make branchB? Should we add this as a test case? My original assumption would be that this inferComparisonBranch would return branchA but according this code, I think it'd just return master, right? Is that intended behavior? Maybe I am misunderstanding what \"default branch\" means.\r\n\r\n@nerdneha you are right, this function would just return `master` and that is the intended behavior. If we all agree that it should return branch `A` instead, I'm happy to open another issue for that discussion, but I think what we have so far is a good starting off point."}}
{"actor":{"display_login":"iAmWillShepherd"}}