summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorLibravatar Steffen Prohaska <prohaska@zib.de>2007-10-10 08:58:59 +0200
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-10-10 03:50:01 -0400
commit99fe594d9677d55d773db3ab180310a3d3bf090b (patch)
tree05bc38891c42e4f255022baaef71c55a99e9e315 /windows
parentgit-gui: set NO_MSGFMT to force using pure tcl replacement in msysgit (diff)
downloadtgif-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.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 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]