{"thread":{"id":"25353","subject":"[PATCH] On Windows, avoid git-gui to call Cygwin's nice utility","startedAt":"2010-10-05T09:12:00Z","lastAt":"2010-10-05T10:03:02Z","messageCount":2,"participants":["Sebastian Schuberth","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"152656","messageId":"AANLkTik4WdEcfQCGETJ6VQs=fj0DLr1DA+5JQCXqYpUP@mail.gmail.com","threadId":"25353","inReplyTo":null,"subject":"[PATCH] On Windows, avoid git-gui to call Cygwin's nice utility","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2010-10-05T09:12:00Z","receivedAt":"2010-10-05T09:12:00Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"It's a common case for Windows developers to have both Cygwin and msysGit\ninstalled. Unfortunately, some scenarios also require to have Cygwin in PATH.\nBy default, Cygwin comes with nice.exe, while msysGit does not. Since git-gui\ncalls nice if it is in PATH, this results in Cygwin's nice.exe being called\nfrom msysGit's git-gui. Mixing Cygwin and msysGit generally is not a good idea,\nand in this particular case it causes differences not being correctly detected.\nSo we only call nice.exe on Windows if it is in the same directory as git.exe.\nThis way, this work-around does neither affect a pure Cygwin environment, or\nthe case when nice.exe will be shipped with msysGit at some point in time.\n\nThis fixes msysGit issue 394.\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n git-gui/git-gui.sh |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 3c9a8aa..288ec87 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -444,6 +444,8 @@ proc _lappend_nice {cmd_var} {\n \t\tset _nice [_which nice]\n \t\tif {[catch {exec $_nice git version}]} {\n \t\t\tset _nice {}\n+\t\t} elseif {[is_Windows] && [file dirname $_nice] != [file dirname $::_git]} {\n+\t\t\tset _nice {}\n \t\t}\n \t}\n \tif {$_nice ne {}} {\n-- \n1.7.2.3.msysgit.6\n"},{"id":"152659","messageId":"8762xhq7mx.fsf@fox.patthoyts.tk","threadId":"25353","inReplyTo":"AANLkTik4WdEcfQCGETJ6VQs=fj0DLr1DA+5JQCXqYpUP@mail.gmail.com","subject":"Re: [PATCH] On Windows, avoid git-gui to call Cygwin's nice utility","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2010-10-05T10:03:02Z","receivedAt":"2010-10-05T10:03:02Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Sebastian Schuberth <sschuberth@gmail.com> writes:\n\n>It's a common case for Windows developers to have both Cygwin and msysGit\n>installed. Unfortunately, some scenarios also require to have Cygwin in PATH.\n>By default, Cygwin comes with nice.exe, while msysGit does not. Since git-gui\n>calls nice if it is in PATH, this results in Cygwin's nice.exe being called\n>from msysGit's git-gui. Mixing Cygwin and msysGit generally is not a good idea,\n>and in this particular case it causes differences not being correctly detected.\n>So we only call nice.exe on Windows if it is in the same directory as git.exe.\n>This way, this work-around does neither affect a pure Cygwin environment, or\n>the case when nice.exe will be shipped with msysGit at some point in time.\n>\n>This fixes msysGit issue 394.\n>\n>Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n>---\n> git-gui/git-gui.sh |    2 ++\n> 1 files changed, 2 insertions(+), 0 deletions(-)\n>\n>diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n>index 3c9a8aa..288ec87 100755\n>--- a/git-gui/git-gui.sh\n>+++ b/git-gui/git-gui.sh\n>@@ -444,6 +444,8 @@ proc _lappend_nice {cmd_var} {\n> \t\tset _nice [_which nice]\n> \t\tif {[catch {exec $_nice git version}]} {\n> \t\t\tset _nice {}\n>+\t\t} elseif {[is_Windows] && [file dirname $_nice] != [file dirname $::_git]} {\n>+\t\t\tset _nice {}\n> \t\t}\n> \t}\n> \tif {$_nice ne {}} {\n\nI just tested this out and its fine. It's marginally better to use 'ne'\nrather than '!=' as the comparison operator here as this is a string\ncomparison and we don't support tcl older than 8.4 when 'eq/ne' was\nintroduced. I've applied it to git-gui's repository with 'ne'.\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}