From: Junio C Hamano <gitster@pobox.com>
To: Louis Strous <Louis.Strous@intellimagic.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: How to make "git bisect visualize" use gitk on Windows?
Date: Wed, 26 Jul 2023 09:59:51 -0700 [thread overview]
Message-ID: <xmqq4jlqehh4.fsf@gitster.g> (raw)
In-Reply-To: <VI1PR10MB2462F7B52FF2E3F59AFE94A7F500A@VI1PR10MB2462.EURPRD10.PROD.OUTLOOK.COM> (Louis Strous's message of "Wed, 26 Jul 2023 09:53:01 +0000")
Louis Strous <Louis.Strous@intellimagic.com> writes:
> I use git version 2.41.0.windows.3 on Microsoft Windows 11. I
> would like to have "git bisect visualize" use gitk instead of git
> log, but cannot figure out how to do that. The documentation at
> https://git-scm.com/docs/git-bisect says that gitk is the default
> but "If the DISPLAY environment variable is not set, git log is
> used instead". I haven't found a description of what I should set
> the DISPLAY environment variable to on Windows to get gitk to be
> used. I've tried setting it to "whatever" and ":0" but then still
> got git log instead of gitk. How do I arrange for "git bisect
> visualize" to use gitk on Windows?
There are others who do Windows, but unfortunately I do not. I hope
some of them may be able to offer more directly useful suggestions.
But I see the following is in builtin/bisect.c:bisect_visualize():
if (!argc) {
if ((getenv("DISPLAY") || getenv("SESSIONNAME") || getenv("MSYSTEM") ||
getenv("SECURITYSESSIONID")) && exists_in_PATH("gitk")) {
strvec_push(&cmd.args, "gitk");
} else {
strvec_push(&cmd.args, "log");
cmd.git_cmd = 1;
}
} else {
if (argv[0][0] == '-') {
strvec_push(&cmd.args, "log");
cmd.git_cmd = 1;
} else if (strcmp(argv[0], "tig") && !starts_with(argv[0], "git"))
cmd.git_cmd = 1;
strvec_pushv(&cmd.args, argv);
}
So presumably "git bisect visualize" (without any other parameter)
would invoke "gitk" as long as (1) one of these environment
variables are set, regardless of their values, and (2) "gitk" is
available on $PATH.
I see on a random stackoverflow page that MSYSTEM is set and
exported on MSYS2 default shell, so presumably Git for Windows
environment has it already, so whether you have DISPLAY set or
unset, the first half of the condition should already be met.
The above code also says that "git bisect visualize -3" would always
invoke "log", not "gitk", regardless of the environment settings (I
mention this only because from your problem description, I cannot
read what exact command line invocation you are having trouble
with).
prev parent reply other threads:[~2023-07-26 17:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 9:53 How to make "git bisect visualize" use gitk on Windows? Louis Strous
2023-07-26 16:59 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4jlqehh4.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Louis.Strous@intellimagic.com \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).