git diffs fail with git version 1.5.4.3

Review Request #2157 — Created Feb. 24, 2011 and submitted

Information

RBTools

Reviewers

This is more of a bug report than a review (although proposed code fix is included)

I have an old machine Ubuntu 8.04 LTS that has an old version of git. The output for git remote appears to be different to what postreview with headrevs of RBtools (2011-02-24) expects and causes a failure:

this is the failure output:

ingres@clach04perl:/tmp/rb_hgb/rbtools$ python ./postreview.py --server=http://reviews.reviewboard.org -r2157 --diff-filename=diff.diff
Traceback (most recent call last):
  File "./postreview.py", line 3820, in <module>
    main()
  File "./postreview.py", line 3733, in main
    repository_info, tool = determine_client()
  File "./postreview.py", line 3681, in determine_client
    repository_info = tool.get_repository_info()
  File "./postreview.py", line 2692, in get_repository_info
    True)
  File "./postreview.py", line 2717, in get_origin
    origin_url = gitRemoteMatch.group(1)
AttributeError: 'NoneType' object has no attribute 'group'


See code hack/diff (this is not meant to be a real code review) and output below for one way to resolve this.

I'm not sure if the regex check is too restrictive (and should be changed, as the diffs show) or if postreview has a minimum git version that should be used (which postreview should then sanity check for).

Sample session:

ingres@clach04perl:/tmp/rb_hgb/rbtools$ git --version
git version 1.5.4.3

ingres@clach04perl:/tmp/rb_hgb/rbtools$ git diff --full-index HEAD >diff.diff

ingres@clach04perl:/tmp/rb_hgb/rbtools$ python ./postreview.py --server=http://reviews.reviewboard.org -r2157 --diff-filename=diff.diff
DEBUG "* remote origin\n  URL: git://github.com/reviewboard/rbtools.git\n  Remote branch(es) merged with 'git pull' while on branch master\n    master\n"
Review request #2157 posted.

http://reviews.reviewboard.org/r/2157/


 
david
  1. This approach seems fine. I've cleaned up the change and pushed it to rbtools master.
  2.