New issue
Advanced search Search tips

Issue 759893 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Ctrl-C leaves `git cl diff` on `git-cl-diff` branch

Project Member Reported by lgar...@chromium.org, Aug 29 2017

Issue description

What 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).
 

Comment 1 by aga...@chromium.org, Aug 29 2017

Labels: Milestone-Afterglow Proj-Gerrit-Migration
Owner: aga...@chromium.org
Status: Started (was: Untriaged)
This change can't land until after Rietveld is 100% read-only, but this is what I mean when I say that getting rid of Rietveld support lets us simplify things massively: https://chromium-review.googlesource.com/639915
Project Member

Comment 2 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
🎉

I'm so excited for this. :-D

Sign in to add a comment