summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Klaeger <thklaeger@gmail.com>2019-09-26 10:46:19 -0700
committerPratyush Yadav <me@yadavpratyush.com>2019-10-01 19:10:34 +0530
commit6a72d44fc274db71f9b7350a2977a27cf13ca550 (patch)
tree32f5f3637ffd58c4b1fc132d07246c8af614d2e0
parentMerge branch 'py/git-git-extra-stuff' (diff)
downloadgit-6a72d44fc274db71f9b7350a2977a27cf13ca550.tar.xz
git-6a72d44fc274db71f9b7350a2977a27cf13ca550.zip
git-gui (Windows): use git-bash.exe if it is available
Git for Windows 2.x ships with an executable that starts the Git Bash with all the environment variables and what not properly set up. It is also adjusted according to the Terminal emulator option chosen when installing Git for Windows (while `bash.exe --login -i` would always launch with Windows' default console). So let's use that executable (usually C:\Program Files\Git\git-bash.exe) instead of `bash.exe --login -i` if its presence was detected. This fixes https://github.com/git-for-windows/git/issues/490 Signed-off-by: Thomas Kläger <thomas.klaeger@10a.ch> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
-rwxr-xr-xgit-gui.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/git-gui.sh b/git-gui.sh
index fd476b69993..20b8afe526b 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2736,10 +2736,18 @@ if {![is_bare]} {
}
if {[is_Windows]} {
+ # Use /git-bash.exe if available
+ set normalized [file normalize $::argv0]
+ regsub "/mingw../libexec/git-core/git-gui$" \
+ $normalized "/git-bash.exe" cmdLine
+ if {$cmdLine != $normalized && [file exists $cmdLine]} {
+ set cmdLine [list "Git Bash" $cmdLine &]
+ } else {
+ set cmdLine [list "Git Bash" bash --login -l &]
+ }
.mbar.repository add command \
-label [mc "Git Bash"] \
- -command {eval exec [auto_execok start] \
- [list "Git Bash" bash --login -l &]}
+ -command {eval exec [auto_execok start] $cmdLine}
}
if {[is_Windows] || ![is_bare]} {