Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/review/git-codereview: provide better error message when upstream is not set #11384

Open
josharian opened this issue Jun 24, 2015 · 0 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@josharian
Copy link
Contributor

When a branch's upstream is not set, the error message is cryptic. This just happened to me as a consequence of switching branches before mailing a CL. Here's a sample bash transcript to illustrate the issue and to provide a fix for any issue spelunkers who find this in the meantime.

$ # do work
$ git change branch1
$ # decide branch2 is a better name
$ git checkout -branch branch2
$ git branch -D branch1
$ git mail
git rev-parse --abbrev-ref branch2@{u}
fatal: ambiguous argument 'branch2@{u}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
branch2@{u}

git-codereview: exit status 128
$ # fix the problem
$ git branch --set-upstream master branch2
$ git mail
remote: Processing changes: new: 1, done    
...
@josharian josharian added this to the Unreleased milestone Jun 24, 2015
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants