{"action":"closed","issue":{"url":"https://api.github.com/repos/gushphp/gush/issues/410","repository_url":"https://api.github.com/repos/gushphp/gush","labels_url":"https://api.github.com/repos/gushphp/gush/issues/410/labels{/name}","comments_url":"https://api.github.com/repos/gushphp/gush/issues/410/comments","events_url":"https://api.github.com/repos/gushphp/gush/issues/410/events","html_url":"https://github.com/gushphp/gush/issues/410","id":68054744,"number":410,"title":"Command to update pull-request with base `pull-request:sync-base`","user":{"login":"sstok","id":904790,"avatar_url":"https://avatars.githubusercontent.com/u/904790?v=3","gravatar_id":"","url":"https://api.github.com/users/sstok","html_url":"https://github.com/sstok","followers_url":"https://api.github.com/users/sstok/followers","following_url":"https://api.github.com/users/sstok/following{/other_user}","gists_url":"https://api.github.com/users/sstok/gists{/gist_id}","starred_url":"https://api.github.com/users/sstok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sstok/subscriptions","organizations_url":"https://api.github.com/users/sstok/orgs","repos_url":"https://api.github.com/users/sstok/repos","events_url":"https://api.github.com/users/sstok/events{/privacy}","received_events_url":"https://api.github.com/users/sstok/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gushphp/gush/labels/Feature","name":"Feature","color":"84b6eb"},{"url":"https://api.github.com/repos/gushphp/gush/labels/Nice%20to%20have","name":"Nice to have","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-04-13T09:34:18Z","updated_at":"2016-07-29T14:56:41Z","closed_at":"2016-07-29T14:56:40Z","body":"One of the most asked questions to contributers is `Could you rebase before I merge`.\r\nBut not everyone (no offense ;) ) don't always get this right as they push but without `--force` or they use the wrong base.\r\n\r\nOr what I did once, do a push with force but then realize you forgot to include the branch name (so all the branches get overwritten :clap: :neutral_face: *and that was not a fork...* )\r\n\r\nTo make this easier we can add a new command `pull-request:sync-base pull_id`, which uses the information of the pull-request for getting the right base, remote (source-org) and doing the push safely.\r\n\r\nPlus you can do a fast `pull-request:sync-base 105` and after this continue with the original branch (which is checked out afterwards).\r\n\r\n## Rebase conflict resolving\r\n\r\nWhen rebasing you have the risk of getting a conflict, instead of working around this the command will simply fail and the user needs handle the conflict using git itself.\r\n\r\n```\r\n[error] Could not complete the pull-request:sync-base command.\r\n\r\nGit rebase failed, you need to resolve these problems manually.\r\n\r\nOnce you have resolved all the rebase problems , run the pull-request:sync-base command\r\nwithout any arguments and the sync operation should continue without any errors.\r\n\r\nTo resolve these problems [nice detailed description here]\r\n\r\nTo check out the original branch and stop syncing, run \"gush pull-request:sync-base --abort\".\r\n```\r\n\r\nTo help the user, Gush will remember that the user was in a sync-base operation, so running `pull-request:sync-base` again will automatically get the correct pull-id or warn when running another command (same way git handles rebase in progress errors).\r\n\r\nAnd restore the orginal branch after the operation is fully completed or the user aborted.\r\n\r\nRebase completed, sync not completed: \r\n\r\n```\r\nYou were doing a pull-request sync-base operation, do you want to continue the original sync operation? [Yes/no]\r\n```\r\n\r\nNo means the sync operation is aborted, the pull-request branch is left unchanged (no git reset).\r\n\r\nRebase not completed:\r\n\r\n```\r\nYou were doing a pull-request sync-base operation, but git rebase is not completed yet.\r\n\r\nOnce you have resolved all the rebase errors, run the pull-request:sync-base command\r\nwithout any arguments and the sync operation should continue without any errors.\r\n\r\nTo resolve these problems [nice detailed description here]\r\n\r\nTo check out the original branch and stop syncing, run \"gush pull-request:sync-base --abort\".\r\n```\r\n\r\n## Internal notes\r\n\r\nTo make the implementation not to complicated the error message and command-name with arguments is written to `.git/.gush_operation` (as a YAML file), the Application simply checks if there is `.git/.gush_operation` file and uses that information for replacing the current command (in doRunCommand(). don't worry I have some idea's to rewrite that method ;) ).\r\n\r\nAnd a another addition is to remember the original (the stashed brach-name) in a `.git/gush_orig_branch` to make aborting a command not loose the original branch-name.\r\nJust an idea, so not fully sure on this as it only works for Gush commands."}}
{"actor":{"display_login":"sstok"}}