]> git.ipfire.org Git - thirdparty/git.git/commit - add-patch.c
built-in add -p: show colored hunks by default
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 13 Dec 2019 08:07:50 +0000 (08:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Dec 2019 20:37:13 +0000 (12:37 -0800)
commite3bd11b4ebed7dd6fd0cccc6765be64f76cc5766
tree8dc4abbe6ef64126cfc8caefd3298349a706b35d
parent1942ee44e8b1715a2e0555a0ea432ea6ab488f4e
built-in add -p: show colored hunks by default

Just like the Perl version, we now generate two diffs if `color.diff` is
set: one with and one without color. Then we parse them in parallel and
record which hunks start at which offsets in both.

Note that this is a (slight) deviation from the way the Perl version did
it: we are no longer reading the output of `diff-files` line by line
(which is more natural for Perl than for C), but in one go, and parse
everything later, so we might just as well do it in synchrony.

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