]> khamidou — GitHub mirrors - arcanist.git/commit
Prevent ArcanistBundle from generating patches with overlapping hunks
authorepriestley <git@epriestley.com>
Mon, 7 Nov 2011 01:48:43 +0000 (17:48 -0800)
committerepriestley <git@epriestley.com>
Mon, 7 Nov 2011 01:52:21 +0000 (17:52 -0800)
commitcc3641e6337cfeee6b6a72cd2e9ffd627c18440e
tree60cc34e8c79b2d4ee5e06078abdaaac1e6f9a4df
parent42b69af59b75b97704ca11ce4c325be68b538262
Prevent ArcanistBundle from generating patches with overlapping hunks

Summary: We currently may generate patches which have hunks that include overlapping context. Git was okay with this until at least 1.7.3.4, but started rejecting these patches some time later.

We already attempt to detect and prevent this condition, we just don't do a very good job of it. Fix the check so that we avoid generating overlapping hunks.

Test Plan:

  - Cleanly applied troublesome patches under Git 1.7.7.2.
  - Used "arc export --git" to verify patches generate without overlapping sections.
  - Locally changed $context to 2 and 1, verified patch behavior was reasonable.

Reviewers: kdeggelman, bizrad6, jonathanhester, jungejason, nh, tuomaspelkonen, aran

CC:

Differential Revision: 1084
src/parser/bundle/ArcanistBundle.php