{"thread":{"id":"60029","subject":"How to make \"git bisect visualize\" use gitk on Windows?","startedAt":"2023-07-26T09:54:23Z","lastAt":"2023-07-26T17:00:01Z","messageCount":2,"participants":["Louis Strous","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"479895","messageId":"VI1PR10MB2462F7B52FF2E3F59AFE94A7F500A@VI1PR10MB2462.EURPRD10.PROD.OUTLOOK.COM","threadId":"60029","inReplyTo":null,"subject":"How to make \"git bisect visualize\" use gitk on Windows?","fromName":"Louis Strous","fromEmail":"louis.strous@intellimagic.com","sentAt":"2023-07-26T09:53:01Z","receivedAt":"2023-07-26T09:54:23Z","isPatch":false,"sender":{"key":"louis.strous@intellimagic.com","avatar":null},"body":"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?\n\nRegards,\nLouis Strous\n\nIntelliMagic - Availability Intelligence\nT: +31 (0)71-579 6000\nwww.intellimagic.com\n\n"},{"id":"479903","messageId":"xmqq4jlqehh4.fsf@gitster.g","threadId":"60029","inReplyTo":"VI1PR10MB2462F7B52FF2E3F59AFE94A7F500A@VI1PR10MB2462.EURPRD10.PROD.OUTLOOK.COM","subject":"Re: How to make \"git bisect visualize\" use gitk on Windows?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-07-26T16:59:51Z","receivedAt":"2023-07-26T17:00:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Louis Strous <Louis.Strous@intellimagic.com> writes:\n\n> I use git version 2.41.0.windows.3 on Microsoft Windows 11.  I\n> would like to have \"git bisect visualize\" use gitk instead of git\n> log, but cannot figure out how to do that.  The documentation at\n> https://git-scm.com/docs/git-bisect says that gitk is the default\n> but \"If the DISPLAY environment variable is not set, git log is\n> used instead\".  I haven't found a description of what I should set\n> the DISPLAY environment variable to on Windows to get gitk to be\n> used.  I've tried setting it to \"whatever\" and \":0\" but then still\n> got git log instead of gitk.  How do I arrange for \"git bisect\n> visualize\" to use gitk on Windows?\n\nThere are others who do Windows, but unfortunately I do not.  I hope\nsome of them may be able to offer more directly useful suggestions.\n\nBut I see the following is in builtin/bisect.c:bisect_visualize():\n\n\tif (!argc) {\n\t\tif ((getenv(\"DISPLAY\") || getenv(\"SESSIONNAME\") || getenv(\"MSYSTEM\") ||\n\t\t     getenv(\"SECURITYSESSIONID\")) && exists_in_PATH(\"gitk\")) {\n\t\t\tstrvec_push(&cmd.args, \"gitk\");\n\t\t} else {\n\t\t\tstrvec_push(&cmd.args, \"log\");\n\t\t\tcmd.git_cmd = 1;\n\t\t}\n\t} else {\n\t\tif (argv[0][0] == '-') {\n\t\t\tstrvec_push(&cmd.args, \"log\");\n\t\t\tcmd.git_cmd = 1;\n\t\t} else if (strcmp(argv[0], \"tig\") && !starts_with(argv[0], \"git\"))\n\t\t\tcmd.git_cmd = 1;\n\n\t\tstrvec_pushv(&cmd.args, argv);\n\t}\n\nSo presumably \"git bisect visualize\" (without any other parameter)\nwould invoke \"gitk\" as long as (1) one of these environment\nvariables are set, regardless of their values, and (2) \"gitk\" is\navailable on $PATH.  \n\nI see on a random stackoverflow page that MSYSTEM is set and\nexported on MSYS2 default shell, so presumably Git for Windows\nenvironment has it already, so whether you have DISPLAY set or\nunset, the first half of the condition should already be met.\n\nThe above code also says that \"git bisect visualize -3\" would always\ninvoke \"log\", not \"gitk\", regardless of the environment settings (I\nmention this only because from your problem description, I cannot\nread what exact command line invocation you are having trouble\nwith).\n\n\n\n\n\n"}]}