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

Re: git-gui not working in a non-default Cygwin installation.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 22, 2008, 06:46 UTC
Message-ID
<20080222064642.GD8410@spearce.org>
In-Reply-To
<20080217080255.GQ24004@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> wrote:
Show 8 quoted lines
> Jurko Gospodneti <jurko.gospodnetic@docte.hr> wrote:
> > 
> >   One of these is that it seems that with the latest git release the 
> > git-gui script changed and started hardcoding some absolute paths in it 
> > during its build (git-gui/Makefile replaces @@GITGUI_SCRIPT@@ with a 
> > hardcoded path). However, this causes the prebuilt Cygwin package to not 
> > work in case Cygwin is not installed in its default location at 
> > C:\Cygwin (e.g. D:\Cygwin or C:\Program Files\Cygwin).
...
Show 7 quoted lines
> I'll have to figure out on Cygwin if the $TCL_PATH I'm using is
> able to resolve Cygwin absolute paths or not, and then build the
> script accordingly.  Fun.
> 
> I'll try to work up a Makefile patch in the next few days and get
> it into a gitgui-0.9.3 maint release, which will probably roll up
> into git 1.5.4.3.

So it took me longer than "next few days" but there is now a two patch series in my maint branch that resolves this issue. If git-gui is built with a Tcl/Tk that understands Cygwin path translations it keeps the library path in POSIX format, but if it builds with a Tcl/Tk that is a native Win32 binary then it uses cygpath to translate the path.

Although now that I think about it the relative path case should be able to be enabled again in the native Win32 codepath, as we only ran into problems with it on Cygwin.

Anyway, it will be in gitgui-0.9.3, which I expect will be bundled into git 1.5.4.3, which Junio has stated may be next week.

--8<--
diff --git a/Makefile b/Makefile
index 081d755..01e0a46 100644
--- a/Makefile
+++ b/Makefile
@@ -92,8 +92,12 @@ ifndef V
 	REMOVE_F1 = && echo '   ' REMOVE `basename "$$dst"` && $(RM_RF) "$$dst"
 endif
 
-TCL_PATH   ?= tclsh
 TCLTK_PATH ?= wish
+ifeq (./,$(dir $(TCLTK_PATH)))
+	TCL_PATH ?= $(subst wish,tclsh,$(TCLTK_PATH))
+else
+	TCL_PATH ?= $(dir $(TCLTK_PATH))$(notdir $(subst wish,tclsh,$(TCLTK_PATH)))
+endif
 
 ifeq ($(uname_S),Darwin)
 	TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
@@ -127,7 +131,17 @@ GITGUI_MACOSXAPP :=
 
 ifeq ($(uname_O),Cygwin)
 	GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`
-	gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)")
+
+	# Is this a Cygwin Tcl/Tk binary?  If so it knows how to do
+	# POSIX path translation just like cygpath does and we must
+	# keep libdir in POSIX format so Cygwin packages of git-gui
+	# work no matter where the user installs them.
+	#
+	ifeq ($(shell echo 'puts [file normalize /]' | '$(TCL_PATH_SQ)'),$(shell cygpath --mixed --absolute /))
+		gg_libdir_sed_in := $(gg_libdir)
+	else
+		gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)")
+	endif
 else
 	ifeq ($(exedir),$(gg_libdir))
 		GITGUI_RELATIVE := 1
-- 
Shawn.
Previous: Brian Dessent
Message 5 of 5 in “git-gui not working in a non-default Cygwin installation.”
  1. Jurko GospodnetićFeb 16, 2008
  2. Shawn O. PearceFeb 17, 2008
  3. Jurko GospodnetićFeb 17, 2008
  4. Brian DessentFeb 17, 2008
  5. Shawn O. PearceFeb 22, 2008

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.