Re: [PATCH v2] git-gui - re-enable use of hook scripts
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 16, 2023, 21:51 UTC
- Message-ID
- <xmqqy1h5aisw.fsf@gitster.g>
- In-Reply-To
- <20230916210131.78593-1-mlevedahl@gmail.com>
Mark Levedahl <mlevedahl@gmail.com> writes:
Show 10 quoted lines
> uses tcl's "file split" command. Experiments on Linux and Windows, using
> tclsh, show that command names with relative and absolute paths always
> give at least two components, while a bare command gives only one.
>
> Linux: puts [file split {foo}] ==> foo
> Linux: puts [file split {/foo}] ==> / foo
> Linux: puts [file split {.git/foo}] ==> .git foo
> Windows: puts [file split {foo}] ==> foo
> Windows: puts [file split {c:\foo}] ==> c:/ foo
> Windows: puts [file split {.git\foo}] ==> .git foo;-) Nice documentation of what you found out.
Show 13 quoted lines
> diff --git a/git-gui.sh b/git-gui.sh
> index 8bc8892..8603437 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -118,7 +118,7 @@ proc sanitize_command_line {command_line from_index} {
> set i $from_index
> while {$i < [llength $command_line]} {
> set cmd [lindex $command_line $i]
> - if {[file pathtype $cmd] ne "absolute"} {
> + if {[llength [file split $cmd]] < 2} {
> set fullpath [_which $cmd]
> if {$fullpath eq ""} {
> throw {NOT-FOUND} "$cmd not found in PATH"Nice. Now we need to find a replacement maintainer for Git-gui ;-) In the meantime, I can queue this patch on top of what I updated git-gui part the last time with and merge it in.
Thanks.