4

Today I started to contribute for the Wikimedia Gerrit community with Git and GitHub Desktop on my Windows 10 (PC).


First I installed the git-review package with Pip:

$ pip install git-review

After I loged in, I cloning and creating a new branch with Git:

$ ssh suriyaa@gerrit.wikimedia.org -p 29418

$ git clone ssh://suriyaa@gerrit.wikimedia.org:29418/operations/mediawiki-config
$ git pull origin master
$ git checkout -b suriyaakudocommits origin/master
$ git branch
$ git branch suriyaakudocommits --track origin/master
$ git checkout suriyaakudocommits

I editing a file and add it with git add:

$ git diff
$ git status
$ git add 404.html
$ git status
$ git diff --cached
$ git commit
$ git pull --rebase origin master

I used git review -R to commit my changes from my branch "suriyaakudocommits" to Wikimedia Gerrit (branch: "master") and I got this (error) output:

C:\Users\Suriyaa\Documents\GitHub\mediawiki-config [suriyaakudocommits]> git review -R
Using global/system git-review config files (C:\Users\Suriyaa/.config/git-review\git-review.conf) is deprecated
Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\git-review.exe\__main__.py", line 9, in <module>
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 1522, in main
    _main()
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 1393, in _main
    config = Config(os.path.join(top_dir, ".gitreview"))
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 285, in __init__
    self.config.update(load_config_file(filename))
  File "C:\Python34\lib\site-packages\git_review\cmd.py", line 671, in load_config_file
    configParser.read(config_file)
  File "C:\Python34\lib\configparser.py", line 672, in read
    self._read(fp, filename)
  File "C:\Python34\lib\configparser.py", line 1058, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'C:\\Users\\Suriyaa/.config/git-review\\git-review.conf', line: 1
'[gerrit]\n'

What's wrong? I hope someone can help me.

I use Python 3.4 (32 bit)!

I followed the MediaWiki tutorial for Gerrit.


The code of C:\\Users\\Suriyaa/.config/git-review\\git-review.conf file:

[gerrit]
defaultremote = origin
Suriyaa
  • 2,222
  • 2
  • 25
  • 44

1 Answers1

3

The MediaWiki tutorial you mentioned now says that the git-review.conf file is deprecated. Instead, you should use:

$ git config --global gitreview.remote origin

I also had to remove the .conf file to get rid of the warning.

philip becker
  • 303
  • 2
  • 6