Commit 933e44d
committed
"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>1 parent 9dce832 commit 933e44d
2 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
2430 | 2431 | | |
2431 | 2432 | | |
2432 | 2433 | | |
2433 | | - | |
2434 | | - | |
2435 | | - | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
2436 | 2437 | | |
2437 | 2438 | | |
2438 | 2439 | | |
| |||
3877 | 3878 | | |
3878 | 3879 | | |
3879 | 3880 | | |
| 3881 | + | |
| 3882 | + | |
3880 | 3883 | | |
3881 | 3884 | | |
3882 | 3885 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | | - | |
| 708 | + | |
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| |||
0 commit comments