]> git.ipfire.org Git - thirdparty/git.git/commit - add-patch.c
built-in add -p: implement the '/' ("search regex") command
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 13 Dec 2019 08:08:03 +0000 (08:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Dec 2019 20:37:14 +0000 (12:37 -0800)
commitd6cf873340703098f2d7f54be457e4db1b32cf7b
tree98b9b8e925113bd30fd7074b0833a91a8f5edb0d
parent9254bdfb4f971be4be5364341a0387e8a1f3734a
built-in add -p: implement the '/' ("search regex") command

This patch implements the hunk searching feature in the C version of
`git add -p`.

A test is added to verify that this behavior matches the one of the Perl
version of `git add -p`.

Note that this involves a change of behavior: the Perl version uses (of
course) the Perl flavor of regular expressions, while this patch uses
the regcomp()/regexec(), i.e. POSIX extended regular expressions. In
practice, this behavior change is unlikely to matter.

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