{"action":"created","issue":{"url":"https://api.github.com/repos/divmain/GitSavvy/issues/201","labels_url":"https://api.github.com/repos/divmain/GitSavvy/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/divmain/GitSavvy/issues/201/comments","events_url":"https://api.github.com/repos/divmain/GitSavvy/issues/201/events","html_url":"https://github.com/divmain/GitSavvy/pull/201","id":87524231,"number":201,"title":"Feature: git reset, using log or reflog","user":{"login":"ddevlin","id":912471,"avatar_url":"https://avatars.githubusercontent.com/u/912471?v=3","gravatar_id":"","url":"https://api.github.com/users/ddevlin","html_url":"https://github.com/ddevlin","followers_url":"https://api.github.com/users/ddevlin/followers","following_url":"https://api.github.com/users/ddevlin/following{/other_user}","gists_url":"https://api.github.com/users/ddevlin/gists{/gist_id}","starred_url":"https://api.github.com/users/ddevlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddevlin/subscriptions","organizations_url":"https://api.github.com/users/ddevlin/orgs","repos_url":"https://api.github.com/users/ddevlin/repos","events_url":"https://api.github.com/users/ddevlin/events{/privacy}","received_events_url":"https://api.github.com/users/ddevlin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-11T22:42:38Z","updated_at":"2015-06-12T23:39:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/divmain/GitSavvy/pulls/201","html_url":"https://github.com/divmain/GitSavvy/pull/201","diff_url":"https://github.com/divmain/GitSavvy/pull/201.diff","patch_url":"https://github.com/divmain/GitSavvy/pull/201.patch"},"body":"![2015-06-11 22_40_30](https://cloud.githubusercontent.com/assets/912471/8119107/04be56fa-108b-11e5-8c05-309c66131eaa.gif)\r\n\r\nI've made a first attempt at a git reset feature (closes #200). Feedback welcomed :smile: \r\n\r\nAdds two git reset commands to the command panel:\r\n- `git: reset`: Displays the commit selector from `git: log`, selecting a commit performs a `git reset --mixed` to that commit.\r\n- `git: reset (reflog)` Displays a reference log selector, selecting a reference performs a `git reset --mixed` to the referenced commit. This allows you to reset an earlier reset or a rebase.\r\n\r\nReflog quick panel:\r\n![screen shot 2015-06-11 at 23 43 51](https://cloud.githubusercontent.com/assets/912471/8120160/03bffef8-1094-11e5-822d-3abc02f201b8.png)\r\n\r\n\r\nThe reflog option could be confusing to less advanced git users. I personally would find it useful, on occasion I've reset one or two commits too far, and it would be nice if I could quickly undo that without returning to the terminal. If it's more trouble than it's worth though, I'm happy to take it out.\r\n\r\nDoc entries are pretty rough (particularly for the `reflog` option), so welcome feedback there. Wasn't sure whether to put them in `misc.md` or elsewhere.\r\n\r\nI'm using the default git reset behaviour `--mixed` (though I've added it to command anyway just to be explicit). I didn't add an option for `--soft` or `--hard` to keep things simple, from the status view it's easy to either stage or discard the post-reset uncommited changes anyway.\r\n\r\n@divmain In `GsResetCommand` I subclassed `GsLogCommand` as the only difference between the two is the `on_hash_selection` method, but it might be better not to subclass and live with the duplication, as the subclassing is less explicit and future changes to `GsLogCommand` could potentially break `GsResetCommand`. What do you think?\r\n"},"comment":{"url":"https://api.github.com/repos/divmain/GitSavvy/issues/comments/111642266","html_url":"https://github.com/divmain/GitSavvy/pull/201#issuecomment-111642266","issue_url":"https://api.github.com/repos/divmain/GitSavvy/issues/201","id":111642266,"user":{"login":"ddevlin","id":912471,"avatar_url":"https://avatars.githubusercontent.com/u/912471?v=3","gravatar_id":"","url":"https://api.github.com/users/ddevlin","html_url":"https://github.com/ddevlin","followers_url":"https://api.github.com/users/ddevlin/followers","following_url":"https://api.github.com/users/ddevlin/following{/other_user}","gists_url":"https://api.github.com/users/ddevlin/gists{/gist_id}","starred_url":"https://api.github.com/users/ddevlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddevlin/subscriptions","organizations_url":"https://api.github.com/users/ddevlin/orgs","repos_url":"https://api.github.com/users/ddevlin/repos","events_url":"https://api.github.com/users/ddevlin/events{/privacy}","received_events_url":"https://api.github.com/users/ddevlin/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T23:39:31Z","updated_at":"2015-06-12T23:39:31Z","body":"Updated and squashed."}}