git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] On Windows, avoid git-gui to call Cygwin's nice utility
@ 2010-10-05  9:12 Sebastian Schuberth
  2010-10-05 10:03 ` Pat Thoyts
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Schuberth @ 2010-10-05  9:12 UTC (permalink / raw)
  To: msysGit Mailinglist, Git Mailing List; +Cc: Pat Thoyts, Johannes Schindelin

It's a common case for Windows developers to have both Cygwin and msysGit
installed. Unfortunately, some scenarios also require to have Cygwin in PATH.
By default, Cygwin comes with nice.exe, while msysGit does not. Since git-gui
calls nice if it is in PATH, this results in Cygwin's nice.exe being called
from msysGit's git-gui. Mixing Cygwin and msysGit generally is not a good idea,
and in this particular case it causes differences not being correctly detected.
So we only call nice.exe on Windows if it is in the same directory as git.exe.
This way, this work-around does neither affect a pure Cygwin environment, or
the case when nice.exe will be shipped with msysGit at some point in time.

This fixes msysGit issue 394.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 git-gui/git-gui.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 3c9a8aa..288ec87 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -444,6 +444,8 @@ proc _lappend_nice {cmd_var} {
 		set _nice [_which nice]
 		if {[catch {exec $_nice git version}]} {
 			set _nice {}
+		} elseif {[is_Windows] && [file dirname $_nice] != [file dirname $::_git]} {
+			set _nice {}
 		}
 	}
 	if {$_nice ne {}} {
-- 
1.7.2.3.msysgit.6

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

* Re: [PATCH] On Windows, avoid git-gui to call Cygwin's nice utility
  2010-10-05  9:12 [PATCH] On Windows, avoid git-gui to call Cygwin's nice utility Sebastian Schuberth
@ 2010-10-05 10:03 ` Pat Thoyts
  0 siblings, 0 replies; 2+ messages in thread
From: Pat Thoyts @ 2010-10-05 10:03 UTC (permalink / raw)
  To: Sebastian Schuberth
  Cc: msysGit Mailinglist, Git Mailing List, Johannes Schindelin

Sebastian Schuberth <sschuberth@gmail.com> writes:

>It's a common case for Windows developers to have both Cygwin and msysGit
>installed. Unfortunately, some scenarios also require to have Cygwin in PATH.
>By default, Cygwin comes with nice.exe, while msysGit does not. Since git-gui
>calls nice if it is in PATH, this results in Cygwin's nice.exe being called
>from msysGit's git-gui. Mixing Cygwin and msysGit generally is not a good idea,
>and in this particular case it causes differences not being correctly detected.
>So we only call nice.exe on Windows if it is in the same directory as git.exe.
>This way, this work-around does neither affect a pure Cygwin environment, or
>the case when nice.exe will be shipped with msysGit at some point in time.
>
>This fixes msysGit issue 394.
>
>Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
>---
> git-gui/git-gui.sh |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
>diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>index 3c9a8aa..288ec87 100755
>--- a/git-gui/git-gui.sh
>+++ b/git-gui/git-gui.sh
>@@ -444,6 +444,8 @@ proc _lappend_nice {cmd_var} {
> 		set _nice [_which nice]
> 		if {[catch {exec $_nice git version}]} {
> 			set _nice {}
>+		} elseif {[is_Windows] && [file dirname $_nice] != [file dirname $::_git]} {
>+			set _nice {}
> 		}
> 	}
> 	if {$_nice ne {}} {

I just tested this out and its fine. It's marginally better to use 'ne'
rather than '!=' as the comparison operator here as this is a string
comparison and we don't support tcl older than 8.4 when 'eq/ne' was
introduced. I've applied it to git-gui's repository with 'ne'.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

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

end of thread, other threads:[~2010-10-05 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05  9:12 [PATCH] On Windows, avoid git-gui to call Cygwin's nice utility Sebastian Schuberth
2010-10-05 10:03 ` Pat Thoyts

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