summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c80d25d)
raw | patch | inline | side by side (parent: c80d25d)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 2 Sep 2007 19:19:07 +0000 (15:19 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 4 Sep 2007 03:01:44 +0000 (23:01 -0400) |
Current versions of git-remote apparently are passing the -w option
to Perl as part of the shbang line:
#!/usr/bin/perl -w
this caused a problem in git-gui and gave the user a Tcl error with
the message: "git-remote not supported: #!/usr/bin/perl -w".
The fix for this is to treat the shbang line as a Tcl list and look
at the first element only for guessing the executable name. Once
we know the executable name we use the remaining elements (if any
exist) as arguments to the executable, before the script filename.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
to Perl as part of the shbang line:
#!/usr/bin/perl -w
this caused a problem in git-gui and gave the user a Tcl error with
the message: "git-remote not supported: #!/usr/bin/perl -w".
The fix for this is to treat the shbang line as a Tcl list and look
at the first element only for guessing the executable name. Once
we know the executable name we use the remaining elements (if any
exist) as arguments to the executable, before the script filename.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index fa30ccc5d6df0e3b499b38ddb1b72211a6ce807e..e495046c3b9a99106e8fa3506aad45bd911dd5c8 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
set s [gets $f]
close $f
- switch -glob -- $s {
+ switch -glob -- [lindex $s 0] {
#!*sh { set i sh }
#!*perl { set i perl }
#!*python { set i python }
if {$interp eq {}} {
error "git-$name requires $i (not in PATH)"
}
- set v [list $interp $p]
+ set v [concat [list $interp] [lrange $s 1 end] [list $p]]
} else {
# Assume it is builtin to git somehow and we
# aren't actually able to see a file for it.