bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C
authorPranit Bauva <pranit.bauva@gmail.com>
Thu, 15 Oct 2020 13:38:35 +0000 (15:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Oct 2020 19:24:20 +0000 (12:24 -0700)
commit27257bc4661ed7ffb715922693c7a2bee136824c
treeb40014df93e1e2c65f5c66c6aac9bace28c1610e
parent04774b4e7090e6b418ab053a6d4412a665cae703
bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C

Reimplement the `bisect_state()` shell functions in C and also add a
subcommand `--bisect-state` to `git-bisect--helper` to call them from
git-bisect.sh .

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

`bisect_head()` is only called from `bisect_state()`, thus it is not
required to introduce another subcommand.

Note that the `eval` in the changed line of `git-bisect.sh` cannot be
dropped: it is necessary because the `rev` and the `tail`
variables may contain multiple, quoted arguments that need to be
passed to `bisect--helper` (without the quotes, naturally).

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: Miriam Rubio <mirucam@gmail.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/bisect--helper.c
git-bisect.sh