git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alexander N. Gavrilov" <angavrilov@gmail.com>
To: Shawn O. Pearce <spearce@spearce.org>
Cc: git@vger.kernel.org, msysgit@googlegroups.com,
	Steffen Prohaska <prohaska@zib.de>
Subject: [PATCH] git-gui: Fix pre-commit hooks under MinGW/MSYS
Date: Sat, 5 Jul 2008 15:38:52 +0400	[thread overview]
Message-ID: <200807051538.53692.angavrilov@gmail.com> (raw)


From: Alexander Gavrilov <angavrilov@gmail.com>

Apply the work-around for checking the executable
permission of hook files not only on Cygwin, but on
Windows in general.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
	This is a fix for msysgit issue #118.
	(http://code.google.com/p/msysgit/issues/detail?id=118)

	It may be possible to fix this in a better way, e.g. perhaps assume
	that if the hook exists on Windows, then it's executable (msysgit
	uses renaming to disable hooks), or at least check existance
	before running the shell, but I don't know enough Tcl to do it.

	-- Alexander

 git-gui.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index e6e8890..2d14bf2 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -473,10 +473,10 @@ proc githook_read {hook_name args} {
 	set pchook [gitdir hooks $hook_name]
 	lappend args 2>@1
 
-	# On Cygwin [file executable] might lie so we need to ask
+	# On Windows [file executable] might lie so we need to ask
 	# the shell if the hook is executable.  Yes that's annoying.
 	#
-	if {[is_Cygwin]} {
+	if {[is_Windows]} {
 		upvar #0 _sh interp
 		if {![info exists interp]} {
 			set interp [_which sh]
-- 
1.5.3.3

             reply	other threads:[~2008-07-05 11:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-05 11:38 Alexander N. Gavrilov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-16 20:12 [PATCH (GIT-GUI)] Fix pre-commit hooks under MinGW/MSYS Alexander Gavrilov
2008-07-17  1:18 ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200807051538.53692.angavrilov@gmail.com \
    --to=angavrilov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=msysgit@googlegroups.com \
    --cc=prohaska@zib.de \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).