git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Oded S via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
	Christian Couder <christian.couder@gmail.com>,
	Oded S <oded@istraresearch.com>
Subject: Re: [PATCH v2] bisect: disable pager while invoking show-branch
Date: Tue, 27 Jul 2021 11:29:05 -0700	[thread overview]
Message-ID: <xmqq5ywvehla.fsf@gitster.g> (raw)
In-Reply-To: <pull.1003.v2.git.1627373560881.gitgitgadget@gmail.com> (Oded S. via GitGitGadget's message of "Tue, 27 Jul 2021 08:12:40 +0000")

"Oded S via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Oded Shimon <oded@istraresearch.com>
>
> 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>
> ---

Nicely described.  Now we can discuss if the thought process behind
this change makes sense or not with such a clear description.

I do not know if "unexpectedly" is truly unexpected for those who
configure show-branch to page, though.  After all they wanted their
pager to kick in.

In any case, such users are probably better off configuring their
pager not to prompt and wait when the output is less than pageful
(e.g. "less" has "--quit-if-one-screen" option and 'F' in $LESS
environemnt variable triggers this behaviour).

The patch looks good to me.

Thanks.



> diff --git a/bisect.c b/bisect.c
> index af2863d044b..c02bcc3359f 100644
> --- a/bisect.c
> +++ b/bisect.c
> @@ -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;
> @@ -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,
>
> base-commit: eb27b338a3e71c7c4079fbac8aeae3f8fbb5c687

      reply	other threads:[~2021-07-27 18:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 15:00 [PATCH] Fix git-bisect when show-branch is configured to run with pager Oded S via GitGitGadget
2021-07-26 18:13 ` Christian Couder
2021-07-26 18:39 ` Junio C Hamano
2021-07-27 18:22   ` Junio C Hamano
2021-07-28  6:37     ` Christian Couder
2021-07-28 16:41       ` Junio C Hamano
2021-07-28 17:07         ` Re* " Junio C Hamano
2021-07-29  2:34           ` Christian Couder
2021-07-27  8:12 ` [PATCH v2] bisect: disable pager while invoking show-branch Oded S via GitGitGadget
2021-07-27 18:29   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq5ywvehla.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=oded@istraresearch.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).