Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* How to make "git bisect visualize" use gitk on Windows?
@ 2023-07-26  9:53 Louis Strous
  2023-07-26 16:59 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Louis Strous @ 2023-07-26  9:53 UTC (permalink / raw)
  To: git@vger.kernel.org

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?

Regards,
Louis Strous

IntelliMagic - Availability Intelligence
T: +31 (0)71-579 6000
www.intellimagic.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to make "git bisect visualize" use gitk on Windows?
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2023-07-26 16:59 UTC (permalink / raw)
  To: Louis Strous; +Cc: git@vger.kernel.org

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).






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-26 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).