git-gui on Windows prepends three directories to PATH so does not honor PATH as configured. This can have undesirable consequences, for instance by preventing use of a different git for testing. This also provides at best a subset of the configuration included with Git for Windows (g4w), so is neither necessary nor sufficient there. Since commitbe700fe3, git-gui.sh adds its directory to the front of PATH: this is essentially adding $(git --execdir) to the path, this is long deprecated as git moved to using "dashless" subcommands. The windows/git-gui.sh wrapper file, since commit99fe594d, adds two directories relative to its installed location to PATH, and does so without checking that either exists or is needed. The above modifications were made before the Git For Windows project took responsibility for distributing a working solution on Windows. g4w assures a correct configuration on Windows without these, and doing so requires more than the above modifications. See [1] for a more thorough treatment. git-gui does not modify PATH on any platform except on Windows, and doing so is not needed by g4w. Let's stop modifying PATH on Windows as well. [1] https://gitforwindows.org/git-wrapper.html Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
18 lines
451 B
Bash
Executable File
18 lines
451 B
Bash
Executable File
#!/bin/sh
|
|
# Tcl ignores the next line -*- tcl -*- \
|
|
exec wish "$0" -- "$@"
|
|
|
|
if { $argc >=2 && [lindex $argv 0] == "--working-dir" } {
|
|
set workdir [lindex $argv 1]
|
|
cd $workdir
|
|
if {[lindex [file split $workdir] end] eq {.git}} {
|
|
# Workaround for Explorer right click "Git GUI Here" on .git/
|
|
cd ..
|
|
}
|
|
set argv [lrange $argv 2 end]
|
|
incr argc -2
|
|
}
|
|
|
|
set thisdir [file normalize [file dirname [info script]]]
|
|
source [file join $thisdir git-gui.tcl]
|