post-review uses --no-prefix option to git which diff disagrees with git.py GitDiffParser::__parse_diff()

Review Request #740 — Created Feb. 10, 2009 and submitted — Latest diff uploaded

Information

Review Board SVN (deprecated)

Reviewers

djs
The post-review script uses the --no-prefix option to git diff.  
This option specifically omits the artificial a/ and b/ prefixes of the pathnames of the files being diffed.
git.py GitDiffParser::__parse_diff() is hard-coded to remove the first 2 chars from the path names, assuming that the a/ and b/ are present.
This disagreement results in reviewboard dropping the first two characters of the filenames produced by post-review when using git as the scm.

I chose to change post-review rather than git.py since the test in test.py::GitTests specifically test for the _presence_ of the a/ and b/ prefixes.  That makes it fairly clear that post-review is in error.
Posted a review to my own reviewboard (1.0 alpha 2) server using git as the scm and my modified post-review.  Note that the filenames in the diff now include the first two characters which had been dropped using the stock version of post-review.

Note that this patch changes the behaviour for git-svn as well as native git.  I only tested native git.
    Loading...