]> khamidou — GitHub mirrors - arcanist.git/commit
Strip comments from all diffs before parsing them
authorepriestley <git@epriestley.com>
Thu, 3 Oct 2013 22:06:35 +0000 (15:06 -0700)
committerepriestley <git@epriestley.com>
Thu, 3 Oct 2013 22:06:35 +0000 (15:06 -0700)
commit587addfd9472293e60f1e7522b0b70f65703893f
treebbfe9614686583b0a7ef58d47c547092e3561707
parent0ece525d6c70a19f9c562e0f1558f0f0d41997ad
Strip comments from all diffs before parsing them

Summary:
See <https://github.com/facebook/phabricator/issues/400>. Since all of `patch`, `git apply` and `hg export` either accept or emit header comments, parse them unconditionally.

This is a tiny bit messy because we already had a less-general parser for `hg export` diffs, which have a large header section.

This is less permissive than GNU `patch`, which allows comments anywhere. We could do that, but `git apply` won't read them and they seem pretty crazy.

Test Plan: Added and ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D7207
src/parser/ArcanistDiffParser.php
src/parser/__tests__/ArcanistDiffParserTestCase.php
src/parser/__tests__/diff/comment.svndiff [new file with mode: 0644]