"Could not connect to gerrit." on first startup / Use existing remotes to determine gerrit location
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git-review |
New
|
Undecided
|
Unassigned |
Bug Description
When starting git-review for a first time after cloning the repository:
```
Script started on Tue Jan 8 14:36:34 2013
$ git clone ssh://saperski@revi
$ openstack.
Cloning into gr...
remote: Counting objects: 684, done
remote: Finding sources: 100% (684/684)
remote: Total 684 (delta 310), reused 571 (delta 310)
Receiving objects: 100% (684/684), 452.76 KiB, done.
Resolving deltas: 100% (310/310), done.
$ cd gr
$ git remote -v
origin ssh://<email address hidden>
origin ssh://<email address hidden>
$ git-review -s
Could not connect to gerrit.
Enter your gerrit username:
Trying again with ssh://@
<traceback object at 0x86e7a0>
We don't know where your gerrit is. Please manually create
a remote named "gerrit" and try again.
Traceback (most recent call last):
File "/usr/home/
(...)
```
This is because git-review overly relies on .gitreview file to determine
how to access gerrit. In particular, .gitreview does not contain username
and the user needs to provide it, even it has a successful SSH clone.
I would propose to reverse the logic:
1) check the existing remotes first
2) try to deduce repository parameters
3) ask for username if (2) succeds
4) fall back to .gitreview
Ideally, if we could determine the desired remote branch, .gitreview file would
be not needed at all.
I will be working on this if there is a rough consensus on this way to proceed.
were you able to find solution ? I am running into similar issue not sure if it is the same though. I just followed the instructions here : http:// docs.openstack. org/training- guides/ content/ developer- getting- started- lab.html
and now I am getting similar error as you mentioned when I try
"git review -s" command. it says:
Could not connect to gerrit.
Enter your gerrit username:
when I enter my launchpad userid or email address that is used to login it gives error: Frameworks/ Python. framework/ Versions/ 2.7/bin/ git-review" , line 11, in <module> exit(main( )) Frameworks/ Python. framework/ Versions/ 2.7/lib/ python2. 7/site- packages/ git_review/ cmd.py" , line 1173, in main 'hostname' ], config['port'], config['project']) Frameworks/ Python. framework/ Versions/ 2.7/lib/ python2. 7/site- packages/ git_review/ cmd.py" , line 593, in check_remote remote( scheme, hostname, port, project, remote) Frameworks/ Python. framework/ Versions/ 2.7/lib/ python2. 7/site- packages/ git_review/ cmd.py" , line 333, in add_remote @review. openstack. org:29418/ openstack/ openstack- manuals. git M-V03C: opensta
We don't know where your gerrit is. Please manually create a remote
named "gerrit" and try again.
Traceback (most recent call last):
File "/Library/
sys.
File "/Library/
config[
File "/Library/
add_
File "/Library/
raise Exception("Could not connect to gerrit at %s" % remote_url)
Exception: Could not connect to gerrit at ssh://<email address hidden>
MUJAIN-