Skip to content

Commit

Permalink
On Windows, avoid git-gui to call Cygwin's nice utility
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  • Loading branch information
Sebastian Schuberth authored and Pat Thoyts committed Oct 5, 2010
1 parent 00e9de7 commit ff9db6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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] ne [file dirname $::_git]} {
set _nice {}
}
}
if {$_nice ne {}} {
Expand Down

0 comments on commit ff9db6c

Please sign in to comment.