Description of problem: 0) (Forget to checkout a branch for your change. So you're still working on master.) 1) git commit file.c 2) git review -f << gets a Python backtrace: Switched to branch 'master' Traceback (most recent call last): File "/usr/bin/git-review", line 10, in <module> sys.exit(main()) File "/usr/lib/python2.7/site-packages/git_review/cmd.py", line 1249, in main finish_branch(branch) File "/usr/lib/python2.7/site-packages/git_review/cmd.py", line 1027, in finish_branch "git", "branch", "-D", local_branch) File "/usr/lib/python2.7/site-packages/git_review/cmd.py", line 152, in run_command_exc raise klazz(rc, output, argv, env) git_review.cmd.DeleteBranchFailed: Failed to delete branch The following command failed with exit code 1 "git branch -D master" ----------------------- error: Cannot delete the branch 'master' which you are currently on. ----------------------- Version-Release number of selected component: git-review-1.24-3.fc21 Additional info: reporter: libreport-2.3.0 cmdline: /usr/bin/python /usr/bin/git-review -f executable: /usr/bin/git-review kernel: 3.17.8-300.fc21.x86_64 runlevel: N 5 type: Python uid: 500 Truncated backtrace: cmd.py:152:run_command_exc:DeleteBranchFailed: Failed to delete branch The following command failed with exit code 1 "git branch -D master" ----------------------- error: Cannot delete the branch 'master' which you are currently on. ----------------------- Traceback (most recent call last): File "/usr/bin/git-review", line 10, in <module> sys.exit(main()) File "/usr/lib/python2.7/site-packages/git_review/cmd.py", line 1249, in main finish_branch(branch) File "/usr/lib/python2.7/site-packages/git_review/cmd.py", line 1027, in finish_branch "git", "branch", "-D", local_branch) File "/usr/lib/python2.7/site-packages/git_review/cmd.py", line 152, in run_command_exc raise klazz(rc, output, argv, env) DeleteBranchFailed: Failed to delete branch The following command failed with exit code 1 "git branch -D master" ----------------------- error: Cannot delete the branch 'master' which you are currently on. ----------------------- Local variables in innermost frame: output: u"error: Cannot delete the branch 'master' which you are currently on." klazz: <class 'git_review.cmd.DeleteBranchFailed'> argv: ('git', 'branch', '-D', u'master') env: {} rc: 1
Created attachment 987900 [details] File: backtrace
Created attachment 987901 [details] File: environ
Jeff, what's the desired behavior in such case?
(In reply to Pete Zaitcev from comment #3) > Jeff, what's the desired behavior in such case? Well, I guess an error without the backtrace (and without triggering abortd or whatever it's called)?
Understood, thanks
Created attachment 988612 [details] Possible fix
Jeff, please test this on your case: http://people.redhat.com/zaitcev/tmp/git-review-1.24-3.1.fc21.noarch.rpm When it blows up, please capture and paste the whole output, in case.
Works like a charm, thanks! ~~~ remote: Resolving deltas: 100% (3/3) remote: Processing changes: new: 1, refs: 1, done remote: remote: New Changes: remote: https://code.wireshark.org/review/6977 remote: To ssh://code.wireshark.org:29418/wireshark * [new branch] HEAD -> refs/publish/master Switched to branch 'master' Failed to delete branch The following command failed with exit code 1 "git branch -D master" ----------------------- error: Cannot delete the branch 'master' which you are currently on. ----------------------- ~~~
Of course this does leave you in the position where things have diverged: ~~~ On branch master Your branch and 'origin/master' have diverged, and have 1 and 1 different commit each, respectively. (use "git pull" to merge the remote branch into yours) All conflicts fixed but you are still merging. (use "git commit" to conclude merge) ~~~ (So it's necessary to "get reset HEAD^") I wonder if git-review could/should warn you that you're on master before proceeding? Hmm, well, no, I guess that's too late; really git-commit should probably the one to warn you--or maybe even prevent you--from shooting yourself in the foot. Meh, whatever, most of my git experiences so far have been in finding new and exciting ways to shoot yourself in the foot; this one's not that bad in the end!
Hey, I thought I selected "I am providing the requested information" before... One more try since it doesn't appear to have cleared.
git-review-1.24-4.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/git-review-1.24-4.fc21
Package git-review-1.24-4.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing git-review-1.24-4.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-1794/git-review-1.24-4.fc21 then log in and leave karma (feedback).
Since Jeff confirmed the test build in comment #9, I'm pushing to stable. Hopefuly there's no typo :-)
git-review-1.24-4.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.