[Python-Dev] git-style diffs in Rietveld

"Martin v. Löwis" martin at v.loewis.de
Sat Mar 26 20:34:27 CET 2011


I changed the patch importer in Rietveld to recognize diffs without
a base changeset, which means that --git-style diffs are supported
as long as they apply to the default branch.

The tracker will provide review for a patch, iff, for all files in
the patch:
- a line starting with "diff " is found, and
- the line ends with a valid filename (an optional b/ is stripped
  first), and
- either:
  * it applies cleanly against its base revision, or
  * the base revision does not exist, and it is a patch creating
    a new file

To determine what the base revision is (and whether the file name
is valid), it checks that
* that the patch starts with 'diff -r <12digits>', taking 12digits as
  the base; if not,
* that the patch applies against cpython's "default"

To determine that the patch applies cleanly, it doesn't do any fuzzy
matching (unlike patch(1)). i.e. the old text must match exactly,
and by line numbers.

As a consequence, the following patches cannot be reviewed in
this Rietveld installation:
- patches not starting with "diff"
- patches generated with diff(1) if the path in the patch doesn't
  match cpython
- git-style diffs where the base file has been changed after the
  diff was produced.

If you find that it doesn't work in cases not discussed above,
please report this to the meta-tracker.

Regards,
Martin


More information about the Python-Dev mailing list