I am in the process of trying to set up gerrit with git for the first time. I am following the instructions from https://www.mediawiki.org/wiki/Gerrit/Tutorial. I have installed git, created a gerrit user account, and set up my ssh keys, and now after running sudo apt-get install git-review
I run git review -s -v
in my git directory and get the following output:
2018-06-28 08:54:15.098084 Running: git config --get gitreview.remote
2018-06-28 08:54:15.102217 result: origin
2018-06-28 08:54:15.102337 Running: git config --get gitreview.scheme
2018-06-28 08:54:15.106441 using default: None
2018-06-28 08:54:15.106556 Running: git config --get gitreview.hostname
2018-06-28 08:54:15.111010 using default: None
2018-06-28 08:54:15.111106 Running: git config --get gitreview.port
2018-06-28 08:54:15.116715 using default: None
2018-06-28 08:54:15.116873 Running: git config --get gitreview.project
2018-06-28 08:54:15.121874 using default: None
2018-06-28 08:54:15.122029 Running: git log --color=never --oneline HEAD^1..HEAD
2018-06-28 08:54:15.127908 Running: git remote
2018-06-28 08:54:15.134383 Running: git branch -a --color=never
2018-06-28 08:54:15.141301 Running: git rev-parse --show-toplevel --git-dir
2018-06-28 08:54:15.147041 Running: git config --get remote.origin.pushurl
2018-06-28 08:54:15.152315 using default: None
2018-06-28 08:54:15.152473 Running: git config --get remote.origin.url
2018-06-28 08:54:15.157253 result: file:///home/jd/gitrepos/newrepo
2018-06-28 08:54:15.157356 Running: git config --list
Found origin Push URL: file:///home/jd/gitrepos/newrepo
Fetching commit hook from: scp:///hooks/commit-msg
2018-06-28 08:54:15.163017 Running: scp :hooks/commit-msg .git/hooks/commit-msg
Problems encountered installing commit-msg hook
The following command failed with exit code 1
"scp :hooks/commit-msg .git/hooks/commit-msg"
-----------------------
cp: cannot stat ':hooks/commit-msg': No such file or directory
So I then tried manually pre installing commit-msg in hooks with the instructions from this link: https://www.mediawiki.org/wiki/Gerrit/Alternatives_to_git-review , which fixed getting this specific error. But running `git review -s -v' did not actually seem to do anything after that. Here is the output:
2018-06-28 09:07:13.356813 Running: git config --get gitreview.remote
2018-06-28 09:07:13.360779 result: origin
2018-06-28 09:07:13.360892 Running: git config --get gitreview.scheme
2018-06-28 09:07:13.364968 using default: None
2018-06-28 09:07:13.365102 Running: git config --get gitreview.hostname
2018-06-28 09:07:13.369144 using default: None
2018-06-28 09:07:13.369363 Running: git config --get gitreview.port
2018-06-28 09:07:13.375098 using default: None
2018-06-28 09:07:13.375383 Running: git config --get gitreview.project
2018-06-28 09:07:13.380644 using default: None
2018-06-28 09:07:13.380934 Running: git log --color=never --oneline HEAD^1..HEAD
2018-06-28 09:07:13.387931 Running: git remote
2018-06-28 09:07:13.396294 Running: git branch -a --color=never
2018-06-28 09:07:13.403513 Running: git rev-parse --show-toplevel --git-dir
I thought git review -s
was supposed to set up a gerrit remote, but now when I run git remote -v
all I see is:
origin file:///home/jd/gitrepos/newrepo (fetch)
origin file:///home/jd/gitrepos/newrepo (push)
and nothing for gerrit.
I'm pretty stuck here, I think it could be a problem with my .gitreview file. I've been on this for a while so I have read many assorted instructions and right now I have a manually created .gitreview file in my repository with the contents:
[gerrit]
host=gerrit.wikimedia.org
project=newrepo.git
Some more background on my setup: my repository is located in ~/gitrepos/newrepo and I am pulling from that location to ~/gitworkspace/newrepo. It is from ~/gitworkspace/newrepo where I am running all these commands to try and set up gerrit. I would eventually like to be able to push from ~/gitworkspace/newrepo , and see the review on gerrit before approving it to be able to be pushed to ~/gitrepos/newrepo.