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.
Signed-off-by: Steffen Prohaska <redacted>
---
git-gui/Makefile | 14 ++++++++++++++
git-gui/windows/git-gui.sh | 16 ++++++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
create mode 100644 git-gui/windows/git-gui.sh
@@ -0,0 +1,16 @@+#!/bin/sh+# Tcl ignores the next line -*- tcl -*- \+execwish"$0"--"$@"++if{$argc>=2&&[lindex$argv0]=="--working-dir"}{+cd[lindex$argv1]+setargv[lrange$argv2end]+incrargc-2+}++setgitguidir[filedirname[infoscript]]+regsub-all";"$gitguidir"\\;"gitguidir+setenv(PATH)"$gitguidir;$env(PATH)"+unsetgitguidir++source[filejoin[filedirname[infoscript]]git-gui.tcl]
From: Shawn O. Pearce <hidden> Date: 2016-06-15 22:43:40
Steffen Prohaska [off-list ref] wrote:
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.
I don't have this context in my Makefile so I can't apply this
additional line here. Can someone package up the patch that
introduces the MINGW case above with a proper commit message,
so I can apply it in front of this patch?
@@ -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+}
Maybe we should just support this option directly in git-gui.
Today we also support doing something like this by setting the
GIT_DIR environment variable into a non-bare repository; see the
"# repository setup" block of git-gui.sh.
Hmmph. The install target was going into libdir but the above
source doesn't seem to read from there, its loading from the same
location as the git-gui wrapper script. You msys guys probably
don't have $(libdir) == $(gitexecdir), do you?
--
Shawn.
I don't have this context in my Makefile so I can't apply this
additional line here. Can someone package up the patch that
introduces the MINGW case above with a proper commit message,
so I can apply it in front of this patch?
You need the patch
"git-gui: set NO_MSGFMT to force using pure tcl replacement in msysgit"
that I'll send in a follow-up mail. Apologies for forgetting about that.
@@ -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+}
Maybe we should just support this option directly in git-gui.
Today we also support doing something like this by setting the
GIT_DIR environment variable into a non-bare repository; see the
"# repository setup" block of git-gui.sh.
would definitely be easier. It is an option that can be useful in
general.
I'll not take care of this right away.
Hmmph. The install target was going into libdir but the above
source doesn't seem to read from there, its loading from the same
location as the git-gui wrapper script. You msys guys probably
don't have $(libdir) == $(gitexecdir), do you?
Thanks for spotting that. I decided to put git-gui.tcl into
$(gitexecdir) with permissions 644.
A series of two patches will follow.
Steffen
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 <redacted>
---
git-gui/Makefile | 20 ++++++++++++++++++++
git-gui/windows/git-gui.sh | 16 ++++++++++++++++
2 files changed, 36 insertions(+), 0 deletions(-)
create mode 100644 git-gui/windows/git-gui.sh
@@ -0,0 +1,16 @@+#!/bin/sh+# Tcl ignores the next line -*- tcl -*- \+execwish"$0"--"$@"++if{$argc>=2&&[lindex$argv0]=="--working-dir"}{+cd[lindex$argv1]+setargv[lrange$argv2end]+incrargc-2+}++setgitguidir[filedirname[infoscript]]+regsub-all";"$gitguidir"\\;"gitguidir+setenv(PATH)"$gitguidir;$env(PATH)"+unsetgitguidir++source[filejoin[filedirname[infoscript]]git-gui.tcl]
From: Shawn O. Pearce <hidden> Date: 2016-06-15 22:43:40
Steffen Prohaska [off-list ref] wrote:
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.
Thanks, I have both of these applied now to master and will push
it out shortly, along with the mingw version fix you had sent
me much earlier.
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:43:40
Hi,
On Wed, 10 Oct 2007, Steffen Prohaska wrote:
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.
It should be mentioned here that the Explorer shell extension you talk
about is the very simple extension provided by the Inno Installer.
I have a much larger and versatile shell extension in mind: git-cheetah.
And fixing it is probably trivial; it can both change directory to the
current directory (sounds wrong, doesn't it?) and extend the PATH
appropriately before calling git-gui.
Note: the latter is not even necessary once we (correctly) add git to the
PATH in the installer.
Ciao,
Dscho
On Oct 10, 2007, at 5:56 PM, Johannes Schindelin wrote:
On Wed, 10 Oct 2007, Steffen Prohaska wrote:
quoted
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.
It should be mentioned here that the Explorer shell extension you talk
about is the very simple extension provided by the Inno Installer.
Yes, but it's already there. And Shawn even finds --working-dir
interesting
as a general feature.
I have a much larger and versatile shell extension in mind: git-
cheetah.
And fixing it is probably trivial; it can both change directory to the
current directory (sounds wrong, doesn't it?) and extend the PATH
appropriately before calling git-gui.
I know, but it's not yet there.
Note: the latter is not even necessary once we (correctly) add git
to the
PATH in the installer.
(wrongly ;) Adding git to the PATH will only become an option. git-gui
should also work if it's not added.
I comment on the PATH question in reply to another mail.
Steffen