git bisect view's use of DISPLAY environment variable in Cygwin
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.
Signature · 1 line
Hannu
Hi,
Quoted 6 lines · Hannu Koivisto
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.
Quoted 3 lines
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.
Quoted 5 lines · Christian Couder
Hi,
Quoted 2 lines · Hannu Koivisto
Greetings,
Quoted 7 lines
Quoted 4 lines
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.
Quoted 1 line
You can use "git bisect view log" to use "git log" even if DISPLAY is set.
I'd rather not use undocumented functionality ;)
Signature · 1 line
Hannu
Quoted 15 lines · Hannu Koivisto
Quoted 5 lines · Christian Couder
Hi,
Quoted 2 lines · Hannu Koivisto
Greetings,
Quoted 7 lines
Quoted 4 lines
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?
Quoted 6 lines
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?
Quoted 7 lines
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.Quoted 1 line
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.
Quoted 6 lines · Christian Couder
Quoted 1 line · Hannu Koivisto
"Christian Couder" <[email protected]> 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.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
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.
Signature · 1 line
Hannu
Quoted 11 lines · Hannu Koivisto
Quoted 6 lines · Christian Couder
Quoted 1 line · Hannu Koivisto
"Christian Couder" <[email protected]> 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.
Signature · 1 line
Hannu
Hi,
Quoted 11 lines · Hannu Koivisto
Quoted 9 lines · Hannu Koivisto
Quoted 6 lines · Christian Couder
Quoted 1 line · Hannu Koivisto
"Christian Couder" <[email protected]> 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?
Quoted 7 lines
Quoted 2 lines
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 statusArgh, I didn't realize git-bisect is a shell script. For detecting Cygwin in shell scripts I have tested if
unamematches CYGWIN*. For detecting Windows I have tested ifPROCESSOR_ARCHITECTUREis 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
Quoted 6 lines · Johannes Schindelin
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...
Signature · 1 line
Hannu