built-in app -p: allow selecting a mode change as a "hunk"
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 13 Dec 2019 08:07:56 +0000 (08:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Dec 2019 20:37:14 +0000 (12:37 -0800)
commit5906d5de77628e956d708e9a1796c12bee316b59
tree6d3d06672485a688f5b4adadf7740860651608ca
parent47dc4fd5eb4ab8fbe8ea6bb10e35d398da991cea
built-in app -p: allow selecting a mode change as a "hunk"

This imitates the way the Perl version treats mode changes: it offers
the mode change up for the user to decide, as if it was a diff hunk.

In contrast to the Perl version, we make use of the fact that the mode
line is the first hunk, and explicitly strip out that line from the diff
header if that "hunk" was not selected to be applied, and skipping that
hunk while coalescing the diff. The Perl version plays some kind of diff
line lego instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c