summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorSteffen Prohaska <prohaska@zib.de>2007-10-10 06:58:59 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-10 07:50:01 (GMT)
commit99fe594d9677d55d773db3ab180310a3d3bf090b (patch)
tree05bc38891c42e4f255022baaef71c55a99e9e315 /windows
parenta16b74e72c1dfb6cdef2c17d564d9857ab386d7d (diff)
downloadgit-99fe594d9677d55d773db3ab180310a3d3bf090b.zip
git-99fe594d9677d55d773db3ab180310a3d3bf090b.tar.gz
git-99fe594d9677d55d773db3ab180310a3d3bf090b.tar.bz2
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.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/windows/git-gui.sh b/windows/git-gui.sh
new file mode 100644
index 0000000..98f32c0
--- /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]