git diffs fail with git version

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




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 ./ --server= -r2157 --diff-filename=diff.diff
Traceback (most recent call last):
  File "./", line 3820, in <module>
  File "./", line 3733, in main
    repository_info, tool = determine_client()
  File "./", line 3681, in determine_client
    repository_info = tool.get_repository_info()
  File "./", line 2692, in get_repository_info
  File "./", line 2717, in get_origin
    origin_url =
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

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

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

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