{"action":"opened","issue":{"url":"https://api.github.com/repos/python/core-workflow/issues/102","repository_url":"https://api.github.com/repos/python/core-workflow","labels_url":"https://api.github.com/repos/python/core-workflow/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/python/core-workflow/issues/102/comments","events_url":"https://api.github.com/repos/python/core-workflow/issues/102/events","html_url":"https://github.com/python/core-workflow/issues/102","id":231909573,"number":102,"title":"git boot camp syncing with upstream instructions need to rebase the branch for proper PR review","user":{"login":"gpshead","id":68491,"avatar_url":"https://avatars1.githubusercontent.com/u/68491?v=3","gravatar_id":"","url":"https://api.github.com/users/gpshead","html_url":"https://github.com/gpshead","followers_url":"https://api.github.com/users/gpshead/followers","following_url":"https://api.github.com/users/gpshead/following{/other_user}","gists_url":"https://api.github.com/users/gpshead/gists{/gist_id}","starred_url":"https://api.github.com/users/gpshead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpshead/subscriptions","organizations_url":"https://api.github.com/users/gpshead/orgs","repos_url":"https://api.github.com/users/gpshead/repos","events_url":"https://api.github.com/users/gpshead/events{/privacy}","received_events_url":"https://api.github.com/users/gpshead/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-29T01:32:32Z","updated_at":"2017-05-29T01:32:32Z","closed_at":null,"body":"The instructions at https://cpython-devguide.readthedocs.io/gitbootcamp.html#syncing-with-upstream tell you how to pull changes into your forked repository and how to pull them into your branch that you may have made a PR out of. But it doesn't deal with rebasing your branch so that the code review on your branch does not contain extraneous changes when you have re-synced with the upstream repo.\r\n\r\nThis seems necessary in many PRs that go on for a while where you need to sync and merge across changes already made upstream (or potentially fix additional issues since introduced upstream in your PR).\r\n\r\nI successfully used these instructions to rebase my branch used in my PR to get its diffs/changes back into a sane reviewable state again after I had already followed and pushed via the existing syncing with upstream instructions in my-branch:\r\n  https://www.digitalocean.com/community/tutorials/how-to-rebase-and-update-a-pull-request\r\n\r\nLooking at my bash history, this involved:\r\n 1) `git merge-base my-branch master` to find the commit hash i wanted to rebase the branch off of.\r\n 1) `git checkout my-branch`\r\n 1) git diff master >backup.diff` as I was entering new territory for me (relatively inexperienced git user).\r\n 1) 'git rebase -i $hash_from_the_merge-branch_command_above` followed by not understanding why there were duplicate commits in my list.  i _suspect_ should've removed the later copies of those during this process; oops.\r\n 1) many iterations of `git rebase --skip` and `git reset` to skip past the duplicates that would otherwise show up as useless empty commits until the rebase was done.\r\n 1) some final `git diff` commands to confirm that it appeared to have worked.\r\n 1) `git push origin my-branch`\r\n\r\nThis should be able to be simplified. All of the rebase skipping and reset stuff was effectively manual recovery work from whatever state I had wound up in.  I _hope_ that is not normal if a rebase is done before making follow on changes after syncing with upstream. (?)\r\n\r\nThere may be other ways to do this. This is what I've happened to figure out so far."}}
{"actor":{"display_login":"gpshead"}}