Skip to content

Commit

Permalink
bisect: disable pager while invoking show-branch
Browse files Browse the repository at this point in the history
git-bisect uses show-branch for logging during the bisect process. If the user
sets an interactive pager for show-branch, this makes bisect hang (wait for
user input) unexpectedly - so we disable pager with -P.

It's possible that the user would set a pager for git-checkout as well, but an
interactive pager there would break many more scripts.

Signed-off-by: Oded Shimon <oded@istraresearch.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
oded-ist authored and gitster committed Jul 27, 2021
1 parent eb27b33 commit 58e3755
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bisect.c
Expand Up @@ -23,7 +23,7 @@ static struct oid_array skipped_revs;
static struct object_id *current_bad_oid;

static const char *argv_checkout[] = {"checkout", "-q", NULL, "--", NULL};
static const char *argv_show_branch[] = {"show-branch", NULL, NULL};
static const char *argv_show_branch[] = {"-P", "show-branch", NULL, NULL};

static const char *term_bad;
static const char *term_good;
Expand Down Expand Up @@ -748,7 +748,7 @@ static enum bisect_error bisect_checkout(const struct object_id *bisect_rev, int
return -abs(res);
}

argv_show_branch[1] = bisect_rev_hex;
argv_show_branch[2] = bisect_rev_hex;
res = run_command_v_opt(argv_show_branch, RUN_GIT_CMD);
/*
* Errors in `run_command()` itself, signaled by res < 0,
Expand Down

0 comments on commit 58e3755

Please sign in to comment.