{"thread":{"id":"14296","subject":"[PATCH] git-gui: Fix pre-commit hooks under MinGW/MSYS","startedAt":"2008-07-05T11:38:52Z","lastAt":"2008-07-05T11:38:52Z","messageCount":1,"participants":["Alexander N. Gavrilov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82280","messageId":"200807051538.53692.angavrilov@gmail.com","threadId":"14296","inReplyTo":null,"subject":"[PATCH] git-gui: Fix pre-commit hooks under MinGW/MSYS","fromName":"Alexander N. Gavrilov","fromEmail":"angavrilov@gmail.com","sentAt":"2008-07-05T11:38:52Z","receivedAt":"2008-07-05T11:38:52Z","isPatch":true,"sender":{"key":"angavrilov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42666?v=4"},"body":"\nFrom: Alexander Gavrilov <angavrilov@gmail.com>\n\nApply the work-around for checking the executable\npermission of hook files not only on Cygwin, but on\nWindows in general.\n\nSigned-off-by: Alexander Gavrilov <angavrilov@gmail.com>\n---\n\tThis is a fix for msysgit issue #118.\n\t(http://code.google.com/p/msysgit/issues/detail?id=118)\n\n\tIt may be possible to fix this in a better way, e.g. perhaps assume\n\tthat if the hook exists on Windows, then it's executable (msysgit\n\tuses renaming to disable hooks), or at least check existance\n\tbefore running the shell, but I don't know enough Tcl to do it.\n\n\t-- Alexander\n\n git-gui.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex e6e8890..2d14bf2 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -473,10 +473,10 @@ proc githook_read {hook_name args} {\n \tset pchook [gitdir hooks $hook_name]\n \tlappend args 2>@1\n \n-\t# On Cygwin [file executable] might lie so we need to ask\n+\t# On Windows [file executable] might lie so we need to ask\n \t# the shell if the hook is executable.  Yes that's annoying.\n \t#\n-\tif {[is_Cygwin]} {\n+\tif {[is_Windows]} {\n \t\tupvar #0 _sh interp\n \t\tif {![info exists interp]} {\n \t\t\tset interp [_which sh]\n-- \n1.5.3.3\n"}]}