threads / patch / 14492

patchFix pre-commit hooks under MinGW/MSYS

Subject: [PATCH (GIT-GUI)] Fix pre-commit hooks under MinGW/MSYS

## tl;dr

2 messages between Jul 16, 2008 and Jul 17, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Alexander Gavrilov· Jul 16, 2008, 20:12 UTC · lore

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)
	I've already sent this patch, but resend it as I haven't received any reply,
	and it is not in git-gui.git yet.
	-- Alexander
 git-gui.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Show changes to git-gui.sh +2 −2
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
Shawn O. Pearce· Jul 17, 2008, 01:18 UTC · re: Alexander Gavrilov · lore

Re: [PATCH (GIT-GUI)] Fix pre-commit hooks under MinGW/MSYS

Alexander Gavrilov <angavrilov@gmail.com> wrote:
Show 11 quoted lines
> 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)
> 
> 	I've already sent this patch, but resend it as I haven't received any reply,
> 	and it is not in git-gui.git yet.

Thanks. I'm not sure why I dropped this earlier, but it is in my git-gui tree now.

 
Show 17 quoted lines
> 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]
-- 
Shawn.

← back to recent threads