git-review problems

1,463 views
Skip to first unread message

jo...@norricorp.f9.co.uk

unread,
Jan 20, 2015, 7:36:37 AM1/20/15
to repo-d...@googlegroups.com
Hi,
I have installed git-review under python 2.7.9 on windows 7. I have set up a git-review.conf in my home directory under .config\git-review.
The docs page says to create .gitreview in the repository's .git but not what should go in and sort of suggests that it will be created somehow automatically.

Equally when I run git review -s then no output, no errors. It is supposed to update remotes with a gerrit entry but still just origin. It is also supposed to connect to the gerrit server to check it can. I use https to connect but nothing  seems to have happened.
Finally if I run a git-review -d <change number> then I get

C:\GitWork\helloTest>git-review -d 8
C:\Python27\lib\site-packages\requests\packages\urllib3\connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html  InsecureRequestWarning)
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code    exec code in run_globals
  File "C:\Python27\Scripts\git-review.exe\__main__.py", line 9, in <module>
  File "C:\Python27\lib\site-packages\git_review\cmd.py", line 1180, in main local_branch = fetch_review(options.changeidentifier, branch, emote)
  File "C:\Python27\lib\site-packages\git_review\cmd.py", line 889, in fetch_review  raise ReviewInformationNotFound(review)
git_review.cmd.ReviewInformationNotFound: Could not fetch review information for change 8

Looking at the doc page above, this seems to be aimed at writing the python code.

So very lost - does anyone have any ideas?

Regards,
John

Khai Do

unread,
Jan 20, 2015, 2:13:33 PM1/20/15
to repo-d...@googlegroups.com
I've never used on windows but git-review definitely works on linux.  Have tried on linux?

The  '.gitreview' file should go into the root of your checkout.  This is what is in mine:

  [gerrit]
  port=29418
  project=openstack-infra/zuul.git


jo...@norricorp.f9.co.uk

unread,
Jan 21, 2015, 4:12:17 AM1/21/15
to repo-d...@googlegroups.com

Hi Khai,
I have not tried this on Linux and we are a windows development team so it really does have to work on windows, which I am sure it does.
How was your .gitreview file created? Did you manually create it? Or it was it auto created?
I would like to get git review working as it certainly makes gerrit easier to use.
Regards,
John

Darragh Bailey

unread,
Jan 21, 2015, 5:53:53 AM1/21/15
to jo...@norricorp.f9.co.uk, repo-d...@googlegroups.com
Hi John,


I had a Windows image handy and did a quick install of the relevant parts to test and can confirm that it works as expected for me although the colour support is broken. Windows can display colours but the code is outputting the linux shell codes always instead of switching.

Installed Python & Git from installation packages.
Had to export some proxy settings ("set http_proxy=..." and "set https_proxy=...")
pip install virtualenv
virtualenv pythonenv
.\pythonenv\bin\activate.bat
pip install git-review

git clone https://review.openstack.org/stackforge/git-upstream.git
cd git-upstream
git review -l
(output of reviews outstanding with ascii colour escape sequences)

git review -d 148778
(one of the prior reviews listed from prior command - downloaded and checked out)

However, when it tried 'git review -d 8' I also got the same error as you did.

Perhaps '8' does not exist and the error is valid.

Suggest starting with 'git review -l' since it is querying gerrit to see what reviews are valid for the current project, that will ensure you will get a number that actually exists.


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Darragh Bailey
"Nothing is foolproof to a sufficiently talented fool"

jo...@norricorp.f9.co.uk

unread,
Jan 21, 2015, 7:35:33 AM1/21/15
to repo-d...@googlegroups.com, jo...@norricorp.f9.co.uk

Hi Darren,
thanks for this.
Change 8 does exist  in my gerrit instance.
I tried git review -l and got the same error as above. Which I think makes sense as I have set up gerrit to use https rather than ssh. Does git review work with https?
Regards,
John

Khai Do

unread,
Jan 21, 2015, 1:18:54 PM1/21/15
to repo-d...@googlegroups.com, jo...@norricorp.f9.co.uk
Yes it does.  I use it to work with upstream Gerrit repos.   Here are the remotes for that:

gerrit    https://$US...@gerrit-review.googlesource.com/gerrit (fetch)
gerrit    https://$US...@gerrit-review.googlesource.com/gerrit (push)
origin    https://gerrit.googlesource.com/gerrit (fetch)
origin    https://gerrit.googlesource.com/gerrit (push)

jo...@norricorp.f9.co.uk

unread,
Jan 21, 2015, 5:07:17 PM1/21/15
to repo-d...@googlegroups.com, jo...@norricorp.f9.co.uk
Hi Khai,
I think the problem for me is that .gitreview has not been created but from the docs, it suggests that it is just created so does not go into details about the contents. That is not happening for me.
John

Zaro

unread,
Jan 21, 2015, 5:13:08 PM1/21/15
to jo...@norricorp.f9.co.uk, repo-d...@googlegroups.com
The .gitreview is something that needs to be created manually.  The  'git review -s' command just reads that file to automatically add the 'gerrit' remote for you.  You actually don't even need a .gitreview file, you can just create the remote manually with the 'git remote add' command.

jo...@norricorp.f9.co.uk

unread,
Jan 21, 2015, 5:22:00 PM1/21/15
to repo-d...@googlegroups.com, jo...@norricorp.f9.co.uk

So just an empty .gitreview file, run git review -s then add and commit to git and push to the repository?


jo...@norricorp.f9.co.uk

unread,
Jan 24, 2015, 4:07:15 AM1/24/15
to repo-d...@googlegroups.com, jo...@norricorp.f9.co.uk
So I added an empty .gitreview file at the .git level (not under .git) and still getting same results.
It does looks as though git review is not working in my setup (wrong version of python, unrecognised certificate, something) but the good news is that gerrit does not reply on it.
Many thanks for all of the replies.
Regards,
John 
 
Reply all
Reply to author
Forward
0 new messages