author | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Apr 2011 21:20:57 +0000 (14:20 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 29 Apr 2011 22:27:59 +0000 (15:27 -0700) | ||
commit | 933e44d3a040c41a1e45d53a416edd107cc3ae0a | |
tree | 984bda83451936aa1d75aff08ff8438e53826f2d | tree | snapshot |
parent | 9dce832354502a04e724c5776e60fc6189182307 | commit | diff |
"add -p": work-around an old laziness that does not coalesce hunks
Since 0beee4c (git-add--interactive: remove hunk coalescing, 2008-07-02),
"git add--interactive" behaves lazily and passes overlapping hunks to the
underlying "git apply" without coalescing. This was partially corrected
by 7a26e65 (its partial revert, 2009-05-16), but overlapping hunks are
still passed when the patch is edited.
Teach "git apply" the --allow-overlap option that disables a safety
feature that avoids misapplication of patches by not applying patches
to overlapping hunks, and pass this option form "add -p" codepath.
Do not even advertise the option, as this is merely a workaround, and the
correct fix is to make "add -p" correctly coalesce adjacent patch hunks.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Since 0beee4c (git-add--interactive: remove hunk coalescing, 2008-07-02),
"git add--interactive" behaves lazily and passes overlapping hunks to the
underlying "git apply" without coalescing. This was partially corrected
by 7a26e65 (its partial revert, 2009-05-16), but overlapping hunks are
still passed when the patch is edited.
Teach "git apply" the --allow-overlap option that disables a safety
feature that avoids misapplication of patches by not applying patches
to overlapping hunks, and pass this option form "add -p" codepath.
Do not even advertise the option, as this is merely a workaround, and the
correct fix is to make "add -p" correctly coalesce adjacent patch hunks.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c | diff | blob | history | |
git-add--interactive.perl | diff | blob | history |