Skip to content

Commit d5257fb

Browse files
committed
git-gui: handle textconv filter on Windows and in development
When developing/testing we run git-gui.sh directly and the makefile configured variables are not properly set. Configure the new shellpath accessor to handle this case. On Windows we may not find the shell so in this case revert to simply executing the filter command without the shell intermediate. Signed-off-by: Pat Thoyts <[email protected]>
1 parent 62f9a63 commit d5257fb

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

git-gui.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,14 @@ if {$_trace >= 0} {
139139
}
140140

141141
proc shellpath {} {
142-
global _shellpath
142+
global _shellpath env
143+
if {[string match @@* $_shellpath]} {
144+
if {[info exists env(SHELL)]} {
145+
return $env(SHELL)
146+
} else {
147+
return /bin/sh
148+
}
149+
}
143150
return $_shellpath
144151
}
145152

lib/blame.tcl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,13 @@ method _load {jump} {
461461
if {$commit eq {}} {
462462
if {$do_textconv ne 0} {
463463
# Run textconv with sh -c "..." to allow it to
464-
# contain command + arguments.
465-
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
464+
# contain command + arguments. On windows, just
465+
# call the filter command.
466+
if {![file executable [shellpath]]} {
467+
set fd [open |[linsert $textconv end $path] r]
468+
} else {
469+
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
470+
}
466471
} else {
467472
set fd [open $path r]
468473
}

0 commit comments

Comments
 (0)