Currently approx_halfway() is shortcircuited when bisection debugging is turned on. Allow possibility of printing all debug messages while keeping approx_halfway() working by setting DEBUG_BISECT to 1. Disable approx_halfway() only when BISECT_DEBUG is larger than 1. Also add a debug message to approx_halfway() to dump info about commit it is selecting. Signed-off-by: Jan Kara <jack@xxxxxxx> --- bisect.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bisect.c b/bisect.c index 4d2ba5dbd77e..60e8c32056ac 100644 --- a/bisect.c +++ b/bisect.c @@ -207,7 +207,7 @@ static inline int approx_halfway(struct commit_list *p, int nr) */ if (p->item->object.flags & TREESAME) return 0; - if (DEBUG_BISECT) + if (DEBUG_BISECT > 1) return 0; if (!result_confidence) { @@ -230,8 +230,11 @@ static inline int approx_halfway(struct commit_list *p, int nr) diff = frac_to_fp(1, 16); } if (weight(p) > (FP_HALF - diff) * scale && - weight(p) < (FP_HALF + diff) * scale) + weight(p) < (FP_HALF + diff) * scale) { + debug_bisect("found approx half: %lf diff %lf\n", + fp_to_double(weight(p)), fp_to_double(diff)); return 1; + } return 0; } -- 2.26.2