Skip to content

Commit

Permalink
git-gui: Correct starting of git-remote to handle -w option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
spearce committed Sep 4, 2007
1 parent c80d25d commit 6e4ba05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-gui.sh
Expand Up @@ -261,7 +261,7 @@ proc _git_cmd {name} {
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 }
Expand All @@ -275,7 +275,7 @@ proc _git_cmd {name} {
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.
Expand Down

0 comments on commit 6e4ba05

Please sign in to comment.