-
-
-
I think it's enough to just use "-t". The "-e" only optimizes the error case, and even then it's only slightly faster. For the general case it's better to just invoke git once.
-
-
I tried this out against my Linux kernel tree, and it seems to work well. The only gotcha I ran into was that on one diff I got an error from git, "error: short SHA1 10bb5a8 is ambiguous." By default, "git diff" only puts the first 7 characters of the SHA1 in the index line, which in this case turned out to be ambiguous. One would hope that "git diff" could have avoided that automatically, à la "git rev-parse --short". The workaround is to use "git diff --full-index" to generate the patch. If we ever add git support to "post-review", we should probably do this by default. By the way, for RB developers: if you want a huge stress test, try a patch of a Linux kernel release. "git diff --full-index v2.6.21..v2.6.22" is a 33MB patch, and I gave up on RB trying to load it... :/
Git SCMTool - update
Review Request #141 — Created Aug. 11, 2007 and submitted
An update to Nick Loeve's git support patch reviewed at http://reviews.review-board.org/r/80/. This patch adds support for the new DiffParser, along with some more clean up and unit test coverage. It requires a test git repository at scmtools/testdata/git_repo. A tarball of a repo that contains the correct SHA1 refs to work with the unit tests is at http://mojain.com/static/git_repo.tar.gz. Update 2007-08-13: uploaded a new diff that applies against rev 877. Update 2007-08-14: uploaded a new diff (on the third attempt) that correctly handles diffs that delete files (oops!), and implements Josh Stone's suggestion for file_exists(). Update 2007-08-16: new diff that addresses Josh's comments, including restoring a bunch of get_file tests that I lost in a bad merge.
The patch contains unit tests that exercise the git diff parser and repository client code. All scmtool tests pass.
CU