git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] git-gui: fix detection of Cygwin

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 30, 2015, 19:09 UTC
Message-ID
<alpine.DEB.1.00.1510302009510.31610@s15462909.onlinehome-server.info>
In-Reply-To
<cover.1443619795.git.johannes.schindelin@gmx.de>

MSys2 might *look* like Cygwin, but it is *not* Cygwin... Unless it is run with `MSYSTEM=MSYS`, that is.

This change is backwards-compatible because MSys also used the MSYSTEM variable to determine whether to run in MSys or in MinGW mode. The only difference is that MSys does not support running in 64-bit mode at all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-gui.sh | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 11048c7..9038a4c 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -270,12 +270,10 @@ proc is_Windows {} {
 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
-			}
+		if {$::tcl_platform(platform) eq {windows} &&
+				(![info exists ::env(MSYSTEM)] ||
+				 $::env(MSYSTEM) ne {MSYS})} {
+			set _iscygwin 1
 		} else {
 			set _iscygwin 0
 		}
-- 
2.5.3.windows.1.3.gc322723
Next: Johannes Schindelin
Message 1 of 2 in “git-gui: fix detection of Cygwin”
  1. 1/2 git-gui: fix detection of CygwinJohannes Schindelin, Oct 30, 2015
  2. 2/2 git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`Johannes Schindelin, Oct 30, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.