]> git.ipfire.org Git - thirdparty/git.git/commit - add-patch.c
add -p (built-in): imitate `xdl_format_hunk_hdr()` generating hunk headers
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 11 Nov 2020 12:28:16 +0000 (12:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Nov 2020 17:07:52 +0000 (09:07 -0800)
commitdecc9ee4eaf2c33c28e2958439d276904a2ce279
tree3a898371134bfb5cdd82e047c47cfc0815be3c9d
parentcb581b16ef947a00f8e83f17c9fbe5b5aeed1d65
add -p (built-in): imitate `xdl_format_hunk_hdr()` generating hunk headers

In libxdiff, imitating GNU diff, the hunk headers only show the line
count if it is different from 1. When splitting hunks, the Perl version
of `git add -p` already imitates this. Let's do the same in the built-in
version of said command.

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