diff options
author | Chris Down <chris@chrisdown.name> | 2022-05-11 20:00:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-11 21:35:11 +0200 |
commit | 0cf1defa5a6764b8a0fd956ff4d114cb014cb8a4 (patch) | |
tree | 11953eea824bd1de1eae50f0b0d5e8fc29264441 /bisect.h | |
parent | Git 2.36.1 (diff) | |
download | git-0cf1defa5a6764b8a0fd956ff4d114cb014cb8a4.tar.xz git-0cf1defa5a6764b8a0fd956ff4d114cb014cb8a4.zip |
bisect: output state before we are ready to compute bisection
Commit 73c6de06aff8 ("bisect: don't use invalid oid as rev when
starting") changes the behaviour of `git bisect` to consider invalid
oids as pathspecs again, as in the old shell implementation.
While that behaviour may be desirable, it can also cause confusion. For
example, while bisecting in a particular repo I encountered this:
$ git bisect start d93ff48803f0 v6.3
$
...which led to me sitting for a few moments, wondering why there's no
printout stating the first rev to check.
It turns out that the tag was actually "6.3", not "v6.3", and thus the
bisect was still silently started with only a bad rev, because
d93ff48803f0 was a valid oid and "v6.3" was silently considered to be a
pathspec.
While this behaviour may be desirable, it can be confusing, especially
with different repo conventions either using or not using "v" before
release names, or when a branch name or tag is simply misspelled on the
command line.
In order to avoid situations like this, make it more clear what we're
waiting for:
$ git bisect start d93ff48803f0 v6.3
status: waiting for good commit(s), bad commit known
We already have good output once the bisect process has begun in
earnest, so we don't need to do anything more there.
Signed-off-by: Chris Down <chris@chrisdown.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.h')
-rw-r--r-- | bisect.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -62,6 +62,15 @@ enum bisect_error { BISECT_INTERNAL_SUCCESS_MERGE_BASE = -11 }; +/* + * Stores how many good/bad commits we have stored for a bisect. nr_bad can + * only be 0 or 1. + */ +struct bisect_state { + unsigned int nr_good; + unsigned int nr_bad; +}; + enum bisect_error bisect_next_all(struct repository *r, const char *prefix); int estimate_bisect_steps(int all); |