2877: post-review no longer supports git 1.6

JCZo*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 22, 2014
What version are you running?

 RBTools 0.4.2

What's the URL of the page containing the problem?

 n/a

What steps will reproduce the problem?
1. run post-review in a git repository on a system with git 1.6
2. see stacktrace

What is the expected output? What do you see instead?

A review should be posted, but instead you see:

$ post-review -n -d
>>> RBTools 0.4.2
>>> Python 2.6.8 (unknown, May 29 2012, 22:30:44) 
[GCC 4.3.4 [gcc-4_3-branch revision 152973]]
>>> Running on Linux-2.6.32.59-0.7-default-x86_64-with-SuSE-11-x86_64
>>> Home = XXXX
>>> Current Directory = XXXX
>>> Checking the repository type. Errors shown below are mostly harmless.
DEBUG:root:Checking for a CVS repository...
DEBUG:root:Checking for a ClearCase repository...
DEBUG:root:Checking for a Git repository...
DEBUG:root:Running: git rev-parse --git-dir
DEBUG:root:Running: git config core.bare
DEBUG:root:Running: git rev-parse --show-toplevel
Traceback (most recent call last):
  File "/usr/local/bin/post-review", line 9, in <module>
    load_entry_point('RBTools==0.4.2', 'console_scripts', 'post-review')()
  File "/usr/local/lib64/python2.6/site-packages/rbtools/postreview.py", line 1221, in main
    repository_info, tool = scan_usable_client(options)
  File "/usr/local/lib64/python2.6/site-packages/rbtools/clients/__init__.py", line 157, in scan_usable_client
    repository_info = tool.get_repository_info()
  File "/usr/local/lib64/python2.6/site-packages/rbtools/clients/git.py", line 59, in get_repository_info
    os.chdir(os.path.abspath(git_top))
OSError: [Errno 2] No such file or directory: '/XXXX/--show-toplevel'

What operating system are you using? What browser?

SLES 11SP1

Please provide any additional information below.

The patch to fix submodules with git 1.7 uses:

    git rev-parse --show-toplevel

On git 1.7+ this returns the absolute path of the top level of the repo, but on git 1.6 it returns '--show-toplevel', which post-review tries to use as a directory.

The same effect should be achievable in 1.6 using:

    git_top = execute([self.git, "rev-parse", "--show-cdup"],
                       ignore_errors=True).rstrip("\n")
    git_top = os.path.abspath(git_top)

That should also work fine on 1.7, but perhaps I'm missing something else that '--show-toplevel' does, in which case maybe this could be used if git-top == '--show-toplevel'?
david
#1 david
  • +Component-RBTools
david
#2 david
git 1.6 is quite old these days. I don't think we care anymore.
  • +WontFix