git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-gui: msys2 compatibility patches
@ 2020-04-14 21:45 Konstantin Podsvirov via GitGitGadget
  2020-04-27 19:45 ` Pratyush Yadav
  0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Podsvirov via GitGitGadget @ 2020-04-14 21:45 UTC (permalink / raw)
  To: git; +Cc: Konstantin Podsvirov, Pratyush Yadav, Konstantin Podsvirov

From: Konstantin Podsvirov <konstantin@podsvirov.pro>

Allow using `git gui` command via MSYS2's MINGW32/64 subsystems (apropriate shells).

Just install apropriate `tk` package:

```bash
user@host MINGW32 ~
pacman -S mingw-w64-i686-tk
```

or

```bash
user@host MINGW64 ~
pacman -S mingw-w64-x86_64-tk
```

For more info see: https://github.com/msys2/MSYS2-packages/pull/1912

Signed-off-by: Konstantin Podsvirov <konstantin@podsvirov.pro>
---
    git-gui: msys2 compatibility patches
    
    Allow using git gui command via MSYS2's MINGW32/64 subsystems
    (apropriate shells).
    
    Just install apropriate tk package:
    
    user@host MINGW32 ~
    pacman -S mingw-w64-i686-tk
    
    or
    
    user@host MINGW64 ~
    pacman -S mingw-w64-x86_64-tk
    
    For more info see: https://github.com/msys2/MSYS2-packages/pull/1912

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-612%2Fpodsvirov%2Fgit-gui%2Fmsys2-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-612/podsvirov/git-gui/msys2-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/612

 git-gui.sh | 52 ++++++++++++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index 4610e4ca72a..512f4f121aa 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -44,6 +44,28 @@ if {[catch {package require Tcl 8.5} err]
 
 catch {rename send {}} ; # What an evil concept...
 
+######################################################################
+##
+## platform detection
+
+set _iscygwin {}
+
+proc is_Cygwin {} {
+	global _iscygwin
+	if {$_iscygwin eq {}} {
+		if {$::tcl_platform(platform) eq {windows}} {
+			if {[catch {set p [exec cygpath --windir]} err]} {
+				set _iscygwin 0
+			} else {
+				set _iscygwin 1
+			}
+		} else {
+			set _iscygwin 0
+		}
+	}
+	return $_iscygwin
+}
+
 ######################################################################
 ##
 ## locate our library
@@ -51,7 +73,14 @@ catch {rename send {}} ; # What an evil concept...
 if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
 	set oguilib $::env(GIT_GUI_LIB_DIR)
 } else {
-	set oguilib {@@GITGUI_LIBDIR@@}
+	if {[is_Cygwin]} {
+		set oguilib [exec cygpath \
+			--windows \
+			--absolute \
+			@@GITGUI_LIBDIR@@]
+	} else {
+		set oguilib {@@GITGUI_LIBDIR@@}
+	}
 }
 set oguirel {@@GITGUI_RELATIVE@@}
 if {$oguirel eq {1}} {
@@ -163,7 +192,6 @@ set _isbare {}
 set _gitexec {}
 set _githtmldir {}
 set _reponame {}
-set _iscygwin {}
 set _search_path {}
 set _shellpath {@@SHELL_PATH@@}
 
@@ -266,26 +294,6 @@ proc is_Windows {} {
 	return 0
 }
 
-proc is_Cygwin {} {
-	global _iscygwin
-	if {$_iscygwin eq {}} {
-		if {$::tcl_platform(platform) eq {windows}} {
-			if {[catch {set p [exec cygpath --windir]} err]} {
-				set _iscygwin 0
-			} else {
-				set _iscygwin 1
-				# Handle MSys2 which is only cygwin when MSYSTEM is MSYS.
-				if {[info exists ::env(MSYSTEM)] && $::env(MSYSTEM) ne "MSYS"} {
-					set _iscygwin 0
-				}
-			}
-		} else {
-			set _iscygwin 0
-		}
-	}
-	return $_iscygwin
-}
-
 proc is_enabled {option} {
 	global enabled_options
 	if {[catch {set on $enabled_options($option)}]} {return 0}

base-commit: a5728022e07c53e5ac91db0960870518e243b7c1
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-05 12:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 21:45 [PATCH] git-gui: msys2 compatibility patches Konstantin Podsvirov via GitGitGadget
2020-04-27 19:45 ` Pratyush Yadav
2020-04-27 21:33   ` Konstantin Podsvirov
2020-05-05 12:28     ` Pratyush Yadav

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).