{"thread":{"id":"16069","subject":"git bisect view's use of DISPLAY environment variable in Cygwin","startedAt":"2008-10-28T16:28:24Z","lastAt":"2008-10-29T13:31:05Z","messageCount":8,"participants":["Hannu Koivisto","Christian Couder","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"94120","messageId":"83wsfs1y6v.fsf@kalahari.s2.org","threadId":"16069","inReplyTo":null,"subject":"git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Hannu Koivisto","fromEmail":"azure@iki.fi","sentAt":"2008-10-28T16:28:24Z","receivedAt":"2008-10-28T16:28:24Z","isPatch":false,"sender":{"key":"azure@iki.fi","avatar":null},"body":"Greetings,\n\ngit bisect view uses gitk if DISPLAY environment variable is set\nand git log otherwise.  Since gitk doesn't require X server in\nCygwin, that seems like a bit questionable condition in that\nenvironment.\n\nI'd prefer it to use gitk unless an option given.  I think an\noption would be preferable (to DISPLAY= git bisect view) in Unix as\nwell if you have DISPLAY set but you want it to use git log.\n\n-- \nHannu\n"},{"id":"94121","messageId":"c07716ae0810281015s47741fdqec4c3bed3313bb6a@mail.gmail.com","threadId":"16069","inReplyTo":"83wsfs1y6v.fsf@kalahari.s2.org","subject":"Re: git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2008-10-28T17:15:42Z","receivedAt":"2008-10-28T17:15:42Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Tue, Oct 28, 2008 at 5:28 PM, Hannu Koivisto <azure@iki.fi> wrote:\n> Greetings,\n>\n> git bisect view uses gitk if DISPLAY environment variable is set\n> and git log otherwise.  Since gitk doesn't require X server in\n> Cygwin, that seems like a bit questionable condition in that\n> environment.\n\nDo you know any environment variable that we could use to detect we\ncan use gitk in Cygwin?\nIn this case a patch seems trivial.\n\n> I'd prefer it to use gitk unless an option given.  I think an\n> option would be preferable (to DISPLAY= git bisect view) in Unix as\n> well if you have DISPLAY set but you want it to use git log.\n\nYou can use \"git bisect view log\" to use \"git log\" even if DISPLAY is set.\n\nRegards,\nChristian.\n"},{"id":"94126","messageId":"83skqg1uc9.fsf@kalahari.s2.org","threadId":"16069","inReplyTo":"c07716ae0810281015s47741fdqec4c3bed3313bb6a@mail.gmail.com","subject":"Re: git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Hannu Koivisto","fromEmail":"azure@iki.fi","sentAt":"2008-10-28T17:51:34Z","receivedAt":"2008-10-28T17:51:34Z","isPatch":false,"sender":{"key":"azure@iki.fi","avatar":null},"body":"\"Christian Couder\" <christian.couder@gmail.com> writes:\n\n> Hi,\n>\n> On Tue, Oct 28, 2008 at 5:28 PM, Hannu Koivisto <azure@iki.fi> wrote:\n>> Greetings,\n>>\n>> git bisect view uses gitk if DISPLAY environment variable is set\n>> and git log otherwise.  Since gitk doesn't require X server in\n>> Cygwin, that seems like a bit questionable condition in that\n>> environment.\n>\n> Do you know any environment variable that we could use to detect we\n> can use gitk in Cygwin?\n\nI looked around and I believe there is no such variable.  I suppose\nthe only case where you cannot use gitk is when the user is logged\non using ssh, telnet, psexec or similar (well, unless you use some\nnon-standard Tcl/Tk build which is configured to use X instead of\nWindows graphics).  Then again, I don't think typical Windows\nprograms do any checks for such situations.\n\nSo, easy fix: always use gitk unless log is specified.  Harder fix:\nfigure out a way to test if the login session is such that\ngraphical applications can be run.\n\n> You can use \"git bisect view log\" to use \"git log\" even if DISPLAY is set.\n\nI'd rather not use undocumented functionality ;)\n\n-- \nHannu\n"},{"id":"94138","messageId":"c07716ae0810281213k432d82d8i468f54ae03146b88@mail.gmail.com","threadId":"16069","inReplyTo":"83skqg1uc9.fsf@kalahari.s2.org","subject":"Re: git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2008-10-28T19:13:48Z","receivedAt":"2008-10-28T19:13:48Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote:\n> \"Christian Couder\" <christian.couder@gmail.com> writes:\n>\n>> Hi,\n>>\n>> On Tue, Oct 28, 2008 at 5:28 PM, Hannu Koivisto <azure@iki.fi> wrote:\n>>> Greetings,\n>>>\n>>> git bisect view uses gitk if DISPLAY environment variable is set\n>>> and git log otherwise.  Since gitk doesn't require X server in\n>>> Cygwin, that seems like a bit questionable condition in that\n>>> environment.\n>>\n>> Do you know any environment variable that we could use to detect we\n>> can use gitk in Cygwin?\n>\n> I looked around and I believe there is no such variable.  I suppose\n> the only case where you cannot use gitk is when the user is logged\n> on using ssh, telnet, psexec or similar (well, unless you use some\n> non-standard Tcl/Tk build which is configured to use X instead of\n> Windows graphics).  Then again, I don't think typical Windows\n> programs do any checks for such situations.\n\nWe need at least a way to detect we are under Cygwin, because we won't\nchange the current behavior for all platforms.\nIs checking for the CYGWIN environment variable enough?\n\n> So, easy fix: always use gitk unless log is specified.  Harder fix:\n> figure out a way to test if the login session is such that\n> graphical applications can be run.\n>\n>> You can use \"git bisect view log\" to use \"git log\" even if DISPLAY is set.\n>\n> I'd rather not use undocumented functionality ;)\n\nIn this case you can use any \"git log\" option after \"git bisect view\"\n(for example: git bisect view -p).\n\nRegards,\nChristian.\n"},{"id":"94144","messageId":"83iqrccpmk.fsf@kalahari.s2.org","threadId":"16069","inReplyTo":"c07716ae0810281213k432d82d8i468f54ae03146b88@mail.gmail.com","subject":"Re: git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Hannu Koivisto","fromEmail":"azure@iki.fi","sentAt":"2008-10-28T22:37:55Z","receivedAt":"2008-10-28T22:37:55Z","isPatch":false,"sender":{"key":"azure@iki.fi","avatar":null},"body":"\"Christian Couder\" <christian.couder@gmail.com> writes:\n\n> On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote:\n>> \"Christian Couder\" <christian.couder@gmail.com> writes:\n\n> We need at least a way to detect we are under Cygwin, because we won't\n> change the current behavior for all platforms.\n> Is checking for the CYGWIN environment variable enough?\n\nNo, because it may not be set.  I would probably do it at compile\ntime using __CYGWIN__ definition.  I don't know what's the status\nof merging MSysGit with \"official\" git but I suppose that when that\nhappens, __MING32__ and/or _WIN32 or something would need to be\nconsidered as well.\n\n>>> You can use \"git bisect view log\" to use \"git log\" even if DISPLAY is set.\n>>\n>> I'd rather not use undocumented functionality ;)\n>\n> In this case you can use any \"git log\" option after \"git bisect view\"\n> (for example: git bisect view -p).\n\nI was implying that \"log\" after \"git bisect view\" is not documented\nby git-bisect(1).  \"log\" is not a \"git log\" option.\n\n-- \nHannu\n"},{"id":"94146","messageId":"83ej20cndw.fsf@kalahari.s2.org","threadId":"16069","inReplyTo":"83iqrccpmk.fsf@kalahari.s2.org","subject":"Re: git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Hannu Koivisto","fromEmail":"azure@iki.fi","sentAt":"2008-10-28T23:26:19Z","receivedAt":"2008-10-28T23:26:19Z","isPatch":false,"sender":{"key":"azure@iki.fi","avatar":null},"body":"Hannu Koivisto <azure@iki.fi> writes:\n\n> \"Christian Couder\" <christian.couder@gmail.com> writes:\n>\n>> On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote:\n>>> \"Christian Couder\" <christian.couder@gmail.com> writes:\n>\n>> We need at least a way to detect we are under Cygwin, because we won't\n>> change the current behavior for all platforms.\n>> Is checking for the CYGWIN environment variable enough?\n>\n> No, because it may not be set.  I would probably do it at compile\n> time using __CYGWIN__ definition.  I don't know what's the status\n\nArgh, I didn't realize git-bisect is a shell script.  For detecting\nCygwin in shell scripts I have tested if `uname` matches CYGWIN*.\nFor detecting Windows I have tested if PROCESSOR_ARCHITECTURE is\nset.  There may well be better ways.\n\n-- \nHannu\n"},{"id":"94153","messageId":"alpine.DEB.1.00.0810290144450.22125@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"16069","inReplyTo":"83ej20cndw.fsf@kalahari.s2.org","subject":"Re: git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-10-29T00:46:16Z","receivedAt":"2008-10-29T00:46:16Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 29 Oct 2008, Hannu Koivisto wrote:\n\n> Hannu Koivisto <azure@iki.fi> writes:\n> \n> > \"Christian Couder\" <christian.couder@gmail.com> writes:\n> >\n> >> On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote:\n> >>> \"Christian Couder\" <christian.couder@gmail.com> writes:\n> >\n> >> We need at least a way to detect we are under Cygwin, because we \n> >> won't change the current behavior for all platforms. Is checking for \n> >> the CYGWIN environment variable enough?\n> >\n> > No, because it may not be set.  I would probably do it at compile time \n> > using __CYGWIN__ definition.  I don't know what's the status\n> \n> Argh, I didn't realize git-bisect is a shell script.  For detecting \n> Cygwin in shell scripts I have tested if `uname` matches CYGWIN*. For \n> detecting Windows I have tested if PROCESSOR_ARCHITECTURE is set.  \n> There may well be better ways.\n\nI submitted a patch a while ago, saying\n\n\tbisect view: call gitk if Cygwin's SESSIONNAME variable is set\n\nSee \nhttp://repo.or.cz/w/git/dscho.git?a=commitdiff;h=a2637a3a003646c69ab5a6b85f0ee1bfac15e0b0\n\nCiao,\nDscho\n"},{"id":"94180","messageId":"83abcncyue.fsf@kalahari.s2.org","threadId":"16069","inReplyTo":"alpine.DEB.1.00.0810290144450.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: git bisect view's use of DISPLAY environment variable in Cygwin","fromName":"Hannu Koivisto","fromEmail":"azure@iki.fi","sentAt":"2008-10-29T13:31:05Z","receivedAt":"2008-10-29T13:31:05Z","isPatch":false,"sender":{"key":"azure@iki.fi","avatar":null},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I submitted a patch a while ago, saying\n>\n> \tbisect view: call gitk if Cygwin's SESSIONNAME variable is set\n>\n> See \n> http://repo.or.cz/w/git/dscho.git?a=commitdiff;h=a2637a3a003646c69ab5a6b85f0ee1bfac15e0b0\n\nUnfortunately this approach doesn't seem to work if you run git\nbisect view from, say, cmd (probably applies to other non-Cygwin\nshells as well).  I'm puzzled as to why this happens; I wrote a\nsimple shell script that echoes $SESSIONNAME and no matter how I\nrun it from cmd it always echoes Console.\n\nIt's certainly better than nothing and I wouldn't mind it ending up\nto the official git but...\n\n-- \nHannu\n"}]}