Ctrl-C leaves `git cl diff` on `git-cl-diff` branch |
||
Issue descriptionWhat steps will reproduce the problem? (1) Run `git cl diff` (2) Ctrl-C while looking at the diff. What is the expected result? The diffing operation is aborted and I return to my original branch. What happens instead? I'm left on the `git-cl-diff` branch. You could call Ctrl-C a user error here, but I'm used to it from certain flows. The fact that I'm dropped in another branch (which I did not even create myself) is always unexpected, and sometimes it takes me 5 minutes to realize why everything in my checkout looks broken and that I didn't actually lose any data. It would be nice if `git cl diff` had a trap that restored the original branch in case of a single Ctrl-C interrupt (or even avoided switching branches at all).
,
Oct 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/tools/depot_tools/+/a718c3ebd3caa2f336ab371fe8c0c8a7f0adfbca commit a718c3ebd3caa2f336ab371fe8c0c8a7f0adfbca Author: Aaron Gable <agable@chromium.org> Date: Wed Oct 04 00:34:52 2017 Simplify git-cl-diff for Gerrit Previously, git-cl-diff went through a dance where it would create a new branch, download the uploaded patch onto that branch, and then diff against that. This had all sorts of problems: if you aborted the command, it might leave you on that branch; if you have local changes, they might get clobbered or the command would refuse to run. Now that we're in a Gerrit-only world, and patchsets are by definition equivalent to commits, we can simply diff against whatever local commit was last uploaded or, in a pinch, fetch the uploaded commit and diff against that. Bug: 759893 Change-Id: Ia4b93dcfb9b8aba85817e62731f68d6450026e75 Reviewed-on: https://chromium-review.googlesource.com/639915 Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org> Commit-Queue: Aaron Gable <agable@chromium.org> [modify] https://crrev.com/a718c3ebd3caa2f336ab371fe8c0c8a7f0adfbca/tests/git_cl_test.py [modify] https://crrev.com/a718c3ebd3caa2f336ab371fe8c0c8a7f0adfbca/git_cl.py
,
Oct 4 2017
,
Oct 9 2017
🎉 I'm so excited for this. :-D |
||
►
Sign in to add a comment |
||
Comment 1 by aga...@chromium.org
, Aug 29 2017Owner: aga...@chromium.org
Status: Started (was: Untriaged)