{"thread":{"id":"12122","subject":"git-gui not working in a non-default Cygwin installation.","startedAt":"2008-02-16T01:48:38Z","lastAt":"2008-02-22T06:46:42Z","messageCount":5,"participants":["Jurko Gospodnetić","Shawn O. Pearce","Brian Dessent"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"68856","messageId":"fp5fdj$5fi$1@ger.gmane.org","threadId":"12122","inReplyTo":null,"subject":"git-gui not working in a non-default Cygwin installation.","fromName":"Jurko Gospodnetić","fromEmail":"jurko.gospodnetic@docte.hr","sentAt":"2008-02-16T01:48:38Z","receivedAt":"2008-02-16T01:48:38Z","isPatch":false,"sender":{"key":"jurko.gospodnetic@docte.hr","avatar":null},"body":"   Hi all.\n\n   I am unsure whether this is the right group for asking this question \nand if it is not please excuse me and/or redirect me to a more suitable one.\n\n   We are looking into using git for our source control needs but ran \ninto some problems.\n\n   One of these is that it seems that with the latest git release the \ngit-gui script changed and started hardcoding some absolute paths in it \nduring its build (git-gui/Makefile replaces @@GITGUI_SCRIPT@@ with a \nhardcoded path). However, this causes the prebuilt Cygwin package to not \nwork in case Cygwin is not installed in its default location at \nC:\\Cygwin (e.g. D:\\Cygwin or C:\\Program Files\\Cygwin).\n\n   Everything works fine if you manually edit the git-gui script and \nchange the hard-coded path defined there.\n\n   Is there something I'm missing here? E.g. is there any way for the \nCygwin installation to set the correct path here? Or is the user \nsupposed to modify this by hand on every installation? If this is so, \nthen what other such files are expected to be modified?\n\n   Many thanks.\n\n   Best regards,\n     Jurko Gospodnetić\n"},{"id":"68959","messageId":"20080217080255.GQ24004@spearce.org","threadId":"12122","inReplyTo":"fp5fdj$5fi$1@ger.gmane.org","subject":"Re: git-gui not working in a non-default Cygwin installation.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-17T08:02:55Z","receivedAt":"2008-02-17T08:02:55Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Jurko Gospodneti <jurko.gospodnetic@docte.hr> wrote:\n>   I am unsure whether this is the right group for asking this question \n> and if it is not please excuse me and/or redirect me to a more suitable one.\n\nThis is a pretty good place to start for all things Git related.  :)\n \n>   One of these is that it seems that with the latest git release the \n> git-gui script changed and started hardcoding some absolute paths in it \n> during its build (git-gui/Makefile replaces @@GITGUI_SCRIPT@@ with a \n> hardcoded path). However, this causes the prebuilt Cygwin package to not \n> work in case Cygwin is not installed in its default location at \n> C:\\Cygwin (e.g. D:\\Cygwin or C:\\Program Files\\Cygwin).\n> \n>   Everything works fine if you manually edit the git-gui script and \n> change the hard-coded path defined there.\n> \n>   Is there something I'm missing here? E.g. is there any way for the \n> Cygwin installation to set the correct path here? Or is the user \n> supposed to modify this by hand on every installation? If this is so, \n> then what other such files are expected to be modified?\n\nGaaaaah.\n\nThis is not what I had intended to have happen.  Users should not\nneed to edit binary package files post installation to make things\nwork correctly.\n\nThere's a lot of people I could try to point fingers at for this,\nbut I think its all mine.  :-\\\n\nFirst, let me point out that Cygwin's Tcl/Tk is stuck on 8.4.1 and\nwill probably never get updated again.  I have had some bugs with\ngit-gui on 8.4.1 on Windows where git-fetch/git-push processes\nget hung and don't function correctly.  Upgrading Tcl/Tk to the\nnative Windows binaries of version 8.4.15 resolves the problem,\nbut that binary cannot handle Cygwin paths and Cygwin mount points.\n\nCygwin gets around needing to embed absolute paths into binary\nfiles at build time by using the mount point feature to relocate\nthose paths onto the user's system.  Thus '/' can be D:\\Cygwin on\nyour system and C:\\Program Files\\Cygwin on mine.  Executables linked\nagainst the Cygwin library can still function just fine, but native\nWin32 programs (like Tcl/Tk 8.4.15) can't.\n\ngit-gui assumes its going to be running on a newer (and more stable)\nTcl/Tk so its build process embeds the Windows path into the script.\n*sigh*\n\nI'll have to figure out on Cygwin if the $TCL_PATH I'm using is\nable to resolve Cygwin absolute paths or not, and then build the\nscript accordingly.  Fun.\n\nI'll try to work up a Makefile patch in the next few days and get\nit into a gitgui-0.9.3 maint release, which will probably roll up\ninto git 1.5.4.3.\n\n-- \nShawn.\n"},{"id":"68977","messageId":"fp95jr$r08$1@ger.gmane.org","threadId":"12122","inReplyTo":"20080217080255.GQ24004@spearce.org","subject":"Re: git-gui not working in a non-default Cygwin installation.","fromName":"Jurko Gospodnetić","fromEmail":"jurko.gospodnetic@docte.hr","sentAt":"2008-02-17T11:25:50Z","receivedAt":"2008-02-17T11:25:50Z","isPatch":false,"sender":{"key":"jurko.gospodnetic@docte.hr","avatar":null},"body":"   Hi Shawn.\n\n> First, let me point out that Cygwin's Tcl/Tk is stuck on 8.4.1 and\n> will probably never get updated again.  I have had some bugs with\n> git-gui on 8.4.1 on Windows where git-fetch/git-push processes\n> get hung and don't function correctly.  Upgrading Tcl/Tk to the\n> native Windows binaries of version 8.4.15 resolves the problem,\n> but that binary cannot handle Cygwin paths and Cygwin mount points.\n\n   Sorry, I seem to be a bit confused about this... Why does cygwin not \nsupport Tcl/Tk above version 8.4.1?\n\n   What about the information found on \nhttp://opencircuitdesign.com/cygwin under 'Tcl-Cygwin binary \ndistribution download and install:'? It lists some additional downloads \nthat may be used to install the latest Tcl/Tk on cygwin... Why is this \nnot included in the regular Cygwin distribution (setup.exe)?\n\n\n> git-gui assumes its going to be running on a newer (and more stable)\n> Tcl/Tk so its build process embeds the Windows path into the script.\n> *sigh*\n\n   But new version of Tcl/Tk or not, this will not work unless you \nactually *build* git-gui on your final target system. Why does this \ninformation need to be hardcoded in the script at all? Can it not be \ndetected at run-time?\n\n\n> I'll try to work up a Makefile patch in the next few days and get\n> it into a gitgui-0.9.3 maint release, which will probably roll up\n> into git 1.5.4.3.\n\n   Thanks!\n\n   Best regards,\n     Jurko Gospodnetić\n"},{"id":"68987","messageId":"47B8392B.4D90DFD1@dessent.net","threadId":"12122","inReplyTo":"fp95jr$r08$1@ger.gmane.org","subject":"Re: git-gui not working in a non-default Cygwin installation.","fromName":"Brian Dessent","fromEmail":"brian@dessent.net","sentAt":"2008-02-17T13:39:55Z","receivedAt":"2008-02-17T13:39:55Z","isPatch":false,"sender":{"key":"brian@dessent.net","avatar":null},"body":"Jurko Gospodneti? wrote:\n\n>    Sorry, I seem to be a bit confused about this... Why does cygwin not\n> support Tcl/Tk above version 8.4.1?\n> \n>    What about the information found on\n> http://opencircuitdesign.com/cygwin under 'Tcl-Cygwin binary\n> distribution download and install:'? It lists some additional downloads\n> that may be used to install the latest Tcl/Tk on cygwin... Why is this\n> not included in the regular Cygwin distribution (setup.exe)?\n\nThe Cygwin tcl/tk package exists primarily to support the Insight\ndebugger which uses its own bundled in-tree copy of tcl + tk + itcl +\nitk.  If someone were to hack on Insight to decouple it, then it might\nbe possible to ship a different/newer version, but not until then.\n\nBrian\n"},{"id":"69552","messageId":"20080222064642.GD8410@spearce.org","threadId":"12122","inReplyTo":"20080217080255.GQ24004@spearce.org","subject":"Re: git-gui not working in a non-default Cygwin installation.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-02-22T06:46:42Z","receivedAt":"2008-02-22T06:46:42Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> wrote:\n> Jurko Gospodneti <jurko.gospodnetic@docte.hr> wrote:\n> > \n> >   One of these is that it seems that with the latest git release the \n> > git-gui script changed and started hardcoding some absolute paths in it \n> > during its build (git-gui/Makefile replaces @@GITGUI_SCRIPT@@ with a \n> > hardcoded path). However, this causes the prebuilt Cygwin package to not \n> > work in case Cygwin is not installed in its default location at \n> > C:\\Cygwin (e.g. D:\\Cygwin or C:\\Program Files\\Cygwin).\n...\n> I'll have to figure out on Cygwin if the $TCL_PATH I'm using is\n> able to resolve Cygwin absolute paths or not, and then build the\n> script accordingly.  Fun.\n> \n> I'll try to work up a Makefile patch in the next few days and get\n> it into a gitgui-0.9.3 maint release, which will probably roll up\n> into git 1.5.4.3.\n\nSo it took me longer than \"next few days\" but there is now a\ntwo patch series in my maint branch that resolves this issue.\nIf git-gui is built with a Tcl/Tk that understands Cygwin path\ntranslations it keeps the library path in POSIX format, but if it\nbuilds with a Tcl/Tk that is a native Win32 binary then it uses\ncygpath to translate the path.\n\nAlthough now that I think about it the relative path case should\nbe able to be enabled again in the native Win32 codepath, as we\nonly ran into problems with it on Cygwin.\n\nAnyway, it will be in gitgui-0.9.3, which I expect will be bundled\ninto git 1.5.4.3, which Junio has stated may be next week.\n\n--8<--\ndiff --git a/Makefile b/Makefile\nindex 081d755..01e0a46 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -92,8 +92,12 @@ ifndef V\n \tREMOVE_F1 = && echo '   ' REMOVE `basename \"$$dst\"` && $(RM_RF) \"$$dst\"\n endif\n \n-TCL_PATH   ?= tclsh\n TCLTK_PATH ?= wish\n+ifeq (./,$(dir $(TCLTK_PATH)))\n+\tTCL_PATH ?= $(subst wish,tclsh,$(TCLTK_PATH))\n+else\n+\tTCL_PATH ?= $(dir $(TCLTK_PATH))$(notdir $(subst wish,tclsh,$(TCLTK_PATH)))\n+endif\n \n ifeq ($(uname_S),Darwin)\n \tTKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app\n@@ -127,7 +131,17 @@ GITGUI_MACOSXAPP :=\n \n ifeq ($(uname_O),Cygwin)\n \tGITGUI_SCRIPT := `cygpath --windows --absolute \"$(GITGUI_SCRIPT)\"`\n-\tgg_libdir_sed_in := $(shell cygpath --windows --absolute \"$(gg_libdir)\")\n+\n+\t# Is this a Cygwin Tcl/Tk binary?  If so it knows how to do\n+\t# POSIX path translation just like cygpath does and we must\n+\t# keep libdir in POSIX format so Cygwin packages of git-gui\n+\t# work no matter where the user installs them.\n+\t#\n+\tifeq ($(shell echo 'puts [file normalize /]' | '$(TCL_PATH_SQ)'),$(shell cygpath --mixed --absolute /))\n+\t\tgg_libdir_sed_in := $(gg_libdir)\n+\telse\n+\t\tgg_libdir_sed_in := $(shell cygpath --windows --absolute \"$(gg_libdir)\")\n+\tendif\n else\n \tifeq ($(exedir),$(gg_libdir))\n \t\tGITGUI_RELATIVE := 1\n\n-- \nShawn.\n"}]}