Skip to content

Commit

Permalink
git-gui: handle textconv filter on Windows and in development
Browse files Browse the repository at this point in the history
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 <patthoyts@users.sourceforge.net>
  • Loading branch information
Pat Thoyts committed Aug 12, 2010
1 parent 62f9a63 commit d5257fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 8 additions & 1 deletion git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,14 @@ if {$_trace >= 0} {
}

proc shellpath {} {
global _shellpath
global _shellpath env
if {[string match @@* $_shellpath]} {
if {[info exists env(SHELL)]} {
return $env(SHELL)
} else {
return /bin/sh
}
}
return $_shellpath
}

Expand Down
9 changes: 7 additions & 2 deletions lib/blame.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,13 @@ method _load {jump} {
if {$commit eq {}} {
if {$do_textconv ne 0} {
# Run textconv with sh -c "..." to allow it to
# contain command + arguments.
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
# contain command + arguments. On windows, just
# call the filter command.
if {![file executable [shellpath]]} {
set fd [open |[linsert $textconv end $path] r]
} else {
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
}
} else {
set fd [open $path r]
}
Expand Down

0 comments on commit d5257fb

Please sign in to comment.