]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'hn/bisect-reset-when-found' into seen
authorJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:44:41 +0000 (10:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2026 17:44:41 +0000 (10:44 -0700)
The 'git bisect' command has been taught a
'--reset-when-found[=<where>]' option that tells the command to
automatically run 'git bisect reset' to jump back to the original
state or to the found culprit.

* hn/bisect-reset-when-found:
  bisect: add --reset-when-found to leave when done
  bisect: let bisect_reset() optionally check out quietly

1  2 
bisect.c
builtin/bisect.c
t/t6030-bisect-porcelain.sh

diff --cc bisect.c
Simple merge
index 30883fea9c8205ca7aa5bceed831e2bef9f44728,de13f22f8ab75831a87d4bccaea94608555d7d75..c49b1b911ed6a709c468b1139d30e0d871edbaf4
@@@ -1315,14 -1404,9 +1419,14 @@@ static int bisect_run(struct bisect_ter
  
                fflush(stdout);
                saved_stdout = dup(1);
 +              if (saved_stdout < 0) {
 +                      res = error_errno(_("could not duplicate stdout"));
 +                      close(temporary_stdout_fd);
 +                      break;
 +              }
                dup2(temporary_stdout_fd, 1);
  
-               res = bisect_state(terms, 1, &new_state);
+               res = bisect_state(terms, 1, &new_state, true);
  
                fflush(stdout);
                dup2(saved_stdout, 1);
@@@ -1397,9 -1485,7 +1505,9 @@@ static int cmd_bisect__next(int argc, c
                return error(_("'%s' requires 0 arguments"),
                             "git bisect next");
        get_terms(&terms);
-       res = bisect_next(&terms, prefix);
 +      if (!terms.term_bad || !terms.term_good)
 +              return error(_("no terms defined"));
+       res = bisect_next(&terms, prefix, false);
        free_terms(&terms);
        return res;
  }
Simple merge