diff options
author | Steffen Prohaska <prohaska@zib.de> | 2007-10-10 08:58:59 +0200 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-10-10 03:50:01 -0400 |
commit | 99fe594d9677d55d773db3ab180310a3d3bf090b (patch) | |
tree | 05bc38891c42e4f255022baaef71c55a99e9e315 /windows | |
parent | git-gui: set NO_MSGFMT to force using pure tcl replacement in msysgit (diff) | |
download | tgif-99fe594d9677d55d773db3ab180310a3d3bf090b.tar.xz |
git-gui: add mingw specific startup wrapper
The wrapper adds the directory it is installed in to PATH.
This is required for the git commands implemented in shell.
git-gui fails to launch them if PATH is not modified.
The wrapper script also accepts an optional command line
switch '--working-dir <dir>' and changes to <dir> before
launching the actual git-gui. This is required to implement
the "Git Gui Here" Explorer shell extension.
As a last step the original git-gui script is launched,
which is expected to be located in the same directory
under the name git-gui.tcl.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'windows')
-rw-r--r-- | windows/git-gui.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/windows/git-gui.sh b/windows/git-gui.sh new file mode 100644 index 0000000000..98f32c0a07 --- /dev/null +++ b/windows/git-gui.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Tcl ignores the next line -*- tcl -*- \ +exec wish "$0" -- "$@" + +if { $argc >=2 && [lindex $argv 0] == "--working-dir" } { + cd [lindex $argv 1] + set argv [lrange $argv 2 end] + incr argc -2 +} + +set gitguidir [file dirname [info script]] +regsub -all ";" $gitguidir "\\;" gitguidir +set env(PATH) "$gitguidir;$env(PATH)" +unset gitguidir + +source [file join [file dirname [info script]] git-gui.tcl] |