* git bisect view's use of DISPLAY environment variable in Cygwin @ 2008-10-28 16:28 Hannu Koivisto 2008-10-28 17:15 ` Christian Couder 0 siblings, 1 reply; 8+ messages in thread From: Hannu Koivisto @ 2008-10-28 16:28 UTC (permalink / raw) To: git Greetings, git bisect view uses gitk if DISPLAY environment variable is set and git log otherwise. Since gitk doesn't require X server in Cygwin, that seems like a bit questionable condition in that environment. I'd prefer it to use gitk unless an option given. I think an option would be preferable (to DISPLAY= git bisect view) in Unix as well if you have DISPLAY set but you want it to use git log. -- Hannu ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: git bisect view's use of DISPLAY environment variable in Cygwin 2008-10-28 16:28 git bisect view's use of DISPLAY environment variable in Cygwin Hannu Koivisto @ 2008-10-28 17:15 ` Christian Couder 2008-10-28 17:51 ` Hannu Koivisto 0 siblings, 1 reply; 8+ messages in thread From: Christian Couder @ 2008-10-28 17:15 UTC (permalink / raw) To: Hannu Koivisto; +Cc: git Hi, On Tue, Oct 28, 2008 at 5:28 PM, Hannu Koivisto <azure@iki.fi> wrote: > Greetings, > > git bisect view uses gitk if DISPLAY environment variable is set > and git log otherwise. Since gitk doesn't require X server in > Cygwin, that seems like a bit questionable condition in that > environment. Do you know any environment variable that we could use to detect we can use gitk in Cygwin? In this case a patch seems trivial. > I'd prefer it to use gitk unless an option given. I think an > option would be preferable (to DISPLAY= git bisect view) in Unix as > well if you have DISPLAY set but you want it to use git log. You can use "git bisect view log" to use "git log" even if DISPLAY is set. Regards, Christian. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: git bisect view's use of DISPLAY environment variable in Cygwin 2008-10-28 17:15 ` Christian Couder @ 2008-10-28 17:51 ` Hannu Koivisto 2008-10-28 19:13 ` Christian Couder 0 siblings, 1 reply; 8+ messages in thread From: Hannu Koivisto @ 2008-10-28 17:51 UTC (permalink / raw) To: git "Christian Couder" <christian.couder@gmail.com> writes: > Hi, > > On Tue, Oct 28, 2008 at 5:28 PM, Hannu Koivisto <azure@iki.fi> wrote: >> Greetings, >> >> git bisect view uses gitk if DISPLAY environment variable is set >> and git log otherwise. Since gitk doesn't require X server in >> Cygwin, that seems like a bit questionable condition in that >> environment. > > Do you know any environment variable that we could use to detect we > can use gitk in Cygwin? I looked around and I believe there is no such variable. I suppose the only case where you cannot use gitk is when the user is logged on using ssh, telnet, psexec or similar (well, unless you use some non-standard Tcl/Tk build which is configured to use X instead of Windows graphics). Then again, I don't think typical Windows programs do any checks for such situations. So, easy fix: always use gitk unless log is specified. Harder fix: figure out a way to test if the login session is such that graphical applications can be run. > You can use "git bisect view log" to use "git log" even if DISPLAY is set. I'd rather not use undocumented functionality ;) -- Hannu ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: git bisect view's use of DISPLAY environment variable in Cygwin 2008-10-28 17:51 ` Hannu Koivisto @ 2008-10-28 19:13 ` Christian Couder 2008-10-28 22:37 ` Hannu Koivisto 0 siblings, 1 reply; 8+ messages in thread From: Christian Couder @ 2008-10-28 19:13 UTC (permalink / raw) To: Hannu Koivisto; +Cc: git On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote: > "Christian Couder" <christian.couder@gmail.com> writes: > >> Hi, >> >> On Tue, Oct 28, 2008 at 5:28 PM, Hannu Koivisto <azure@iki.fi> wrote: >>> Greetings, >>> >>> git bisect view uses gitk if DISPLAY environment variable is set >>> and git log otherwise. Since gitk doesn't require X server in >>> Cygwin, that seems like a bit questionable condition in that >>> environment. >> >> Do you know any environment variable that we could use to detect we >> can use gitk in Cygwin? > > I looked around and I believe there is no such variable. I suppose > the only case where you cannot use gitk is when the user is logged > on using ssh, telnet, psexec or similar (well, unless you use some > non-standard Tcl/Tk build which is configured to use X instead of > Windows graphics). Then again, I don't think typical Windows > programs do any checks for such situations. We need at least a way to detect we are under Cygwin, because we won't change the current behavior for all platforms. Is checking for the CYGWIN environment variable enough? > So, easy fix: always use gitk unless log is specified. Harder fix: > figure out a way to test if the login session is such that > graphical applications can be run. > >> You can use "git bisect view log" to use "git log" even if DISPLAY is set. > > I'd rather not use undocumented functionality ;) In this case you can use any "git log" option after "git bisect view" (for example: git bisect view -p). Regards, Christian. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: git bisect view's use of DISPLAY environment variable in Cygwin 2008-10-28 19:13 ` Christian Couder @ 2008-10-28 22:37 ` Hannu Koivisto 2008-10-28 23:26 ` Hannu Koivisto 0 siblings, 1 reply; 8+ messages in thread From: Hannu Koivisto @ 2008-10-28 22:37 UTC (permalink / raw) To: git "Christian Couder" <christian.couder@gmail.com> writes: > On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote: >> "Christian Couder" <christian.couder@gmail.com> writes: > We need at least a way to detect we are under Cygwin, because we won't > change the current behavior for all platforms. > Is checking for the CYGWIN environment variable enough? No, because it may not be set. I would probably do it at compile time using __CYGWIN__ definition. I don't know what's the status of merging MSysGit with "official" git but I suppose that when that happens, __MING32__ and/or _WIN32 or something would need to be considered as well. >>> You can use "git bisect view log" to use "git log" even if DISPLAY is set. >> >> I'd rather not use undocumented functionality ;) > > In this case you can use any "git log" option after "git bisect view" > (for example: git bisect view -p). I was implying that "log" after "git bisect view" is not documented by git-bisect(1). "log" is not a "git log" option. -- Hannu ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: git bisect view's use of DISPLAY environment variable in Cygwin 2008-10-28 22:37 ` Hannu Koivisto @ 2008-10-28 23:26 ` Hannu Koivisto 2008-10-29 0:46 ` Johannes Schindelin 0 siblings, 1 reply; 8+ messages in thread From: Hannu Koivisto @ 2008-10-28 23:26 UTC (permalink / raw) To: git Hannu Koivisto <azure@iki.fi> writes: > "Christian Couder" <christian.couder@gmail.com> writes: > >> On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote: >>> "Christian Couder" <christian.couder@gmail.com> writes: > >> We need at least a way to detect we are under Cygwin, because we won't >> change the current behavior for all platforms. >> Is checking for the CYGWIN environment variable enough? > > No, because it may not be set. I would probably do it at compile > time using __CYGWIN__ definition. I don't know what's the status Argh, I didn't realize git-bisect is a shell script. For detecting Cygwin in shell scripts I have tested if `uname` matches CYGWIN*. For detecting Windows I have tested if PROCESSOR_ARCHITECTURE is set. There may well be better ways. -- Hannu ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: git bisect view's use of DISPLAY environment variable in Cygwin 2008-10-28 23:26 ` Hannu Koivisto @ 2008-10-29 0:46 ` Johannes Schindelin 2008-10-29 13:31 ` Hannu Koivisto 0 siblings, 1 reply; 8+ messages in thread From: Johannes Schindelin @ 2008-10-29 0:46 UTC (permalink / raw) To: Hannu Koivisto; +Cc: git Hi, On Wed, 29 Oct 2008, Hannu Koivisto wrote: > Hannu Koivisto <azure@iki.fi> writes: > > > "Christian Couder" <christian.couder@gmail.com> writes: > > > >> On Tue, Oct 28, 2008 at 6:51 PM, Hannu Koivisto <azure@iki.fi> wrote: > >>> "Christian Couder" <christian.couder@gmail.com> writes: > > > >> We need at least a way to detect we are under Cygwin, because we > >> won't change the current behavior for all platforms. Is checking for > >> the CYGWIN environment variable enough? > > > > No, because it may not be set. I would probably do it at compile time > > using __CYGWIN__ definition. I don't know what's the status > > Argh, I didn't realize git-bisect is a shell script. For detecting > Cygwin in shell scripts I have tested if `uname` matches CYGWIN*. For > detecting Windows I have tested if PROCESSOR_ARCHITECTURE is set. > There may well be better ways. I submitted a patch a while ago, saying bisect view: call gitk if Cygwin's SESSIONNAME variable is set See http://repo.or.cz/w/git/dscho.git?a=commitdiff;h=a2637a3a003646c69ab5a6b85f0ee1bfac15e0b0 Ciao, Dscho ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: git bisect view's use of DISPLAY environment variable in Cygwin 2008-10-29 0:46 ` Johannes Schindelin @ 2008-10-29 13:31 ` Hannu Koivisto 0 siblings, 0 replies; 8+ messages in thread From: Hannu Koivisto @ 2008-10-29 13:31 UTC (permalink / raw) To: git Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > I submitted a patch a while ago, saying > > bisect view: call gitk if Cygwin's SESSIONNAME variable is set > > See > http://repo.or.cz/w/git/dscho.git?a=commitdiff;h=a2637a3a003646c69ab5a6b85f0ee1bfac15e0b0 Unfortunately this approach doesn't seem to work if you run git bisect view from, say, cmd (probably applies to other non-Cygwin shells as well). I'm puzzled as to why this happens; I wrote a simple shell script that echoes $SESSIONNAME and no matter how I run it from cmd it always echoes Console. It's certainly better than nothing and I wouldn't mind it ending up to the official git but... -- Hannu ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-10-29 13:32 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-10-28 16:28 git bisect view's use of DISPLAY environment variable in Cygwin Hannu Koivisto 2008-10-28 17:15 ` Christian Couder 2008-10-28 17:51 ` Hannu Koivisto 2008-10-28 19:13 ` Christian Couder 2008-10-28 22:37 ` Hannu Koivisto 2008-10-28 23:26 ` Hannu Koivisto 2008-10-29 0:46 ` Johannes Schindelin 2008-10-29 13:31 ` Hannu Koivisto
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).