bisect--helper: `get_terms` & `bisect_terms` shell function in C
authorPranit Bauva <pranit.bauva@gmail.com>
Wed, 2 Jan 2019 15:38:35 +0000 (07:38 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jan 2019 18:23:03 +0000 (10:23 -0800)
commit450ebb7359ec379a282670e85536540734c45eed
tree0f3b8ff0cde2ec364b9c73a4cc876aab051774e5
parent129a6cf344c4b352433f5a24de02a62783f6c6df
bisect--helper: `get_terms` & `bisect_terms` shell function in C

Reimplement the `get_terms` and `bisect_terms` shell function in C and
add `bisect-terms` subcommand to `git bisect--helper` to call it from
git-bisect.sh .

Using `--bisect-terms` subcommand is a temporary measure to port shell
function in C so as to use the existing test suite. As more functions
are ported, this subcommand will be retired but its implementation will
be called by some other methods.

Also use error() to report "no terms defined" and accordingly change the
test in t6030.

We need to use PARSE_OPT_KEEP_UNKNOWN here to allow for parameters that
look like options (e.g --term-good) but should not be parsed by
cmd_bisect__helper(). This change is safe because all other cmdmodes have
strict argc checks already.

Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/bisect--helper.c
git-bisect.sh
t/t6030-bisect-porcelain.sh