{"thread":{"id":"8652","subject":"git-gui cannot find share/git-gui under cygwin","startedAt":"2007-06-19T12:28:07Z","lastAt":"2007-06-21T03:30:30Z","messageCount":4,"participants":["Mark Levedahl","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"45347","messageId":"4677CBD7.9050606@gmail.com","threadId":"8652","inReplyTo":null,"subject":"git-gui cannot find share/git-gui under cygwin","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-06-19T12:28:07Z","receivedAt":"2007-06-19T12:28:07Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Commit ea75ee3598ab6f8d0828f introduced logic to guess where \nshare/git-gui/lib is at runtime, and this is broken on Cygwin. The basic \nproblem is that:\n\n/usr/bin = c:\\cygwin\\bin\n/usr/share = c:\\cygwin\\usr\\share\n\nThe detection logic correctly finds the wish binary in c:\\cygwin\\bin, \nand then assumes that the share directory is c:\\cygwin\\share rather than \nc:\\cygwin\\usr\\share. Given this, git-gui does not load as it cannot find \nits share/git-gui/lib directory\n\nMark Levedahl\n"},{"id":"45359","messageId":"20070619144928.GA8477@spearce.org","threadId":"8652","inReplyTo":"4677CBD7.9050606@gmail.com","subject":"Re: git-gui cannot find share/git-gui under cygwin","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-06-19T14:49:28Z","receivedAt":"2007-06-19T14:49:28Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Mark Levedahl <mlevedahl@gmail.com> wrote:\n> Commit ea75ee3598ab6f8d0828f introduced logic to guess where \n> share/git-gui/lib is at runtime, and this is broken on Cygwin. The basic \n> problem is that:\n> \n> /usr/bin = c:\\cygwin\\bin\n> /usr/share = c:\\cygwin\\usr\\share\n> \n> The detection logic correctly finds the wish binary in c:\\cygwin\\bin, \n> and then assumes that the share directory is c:\\cygwin\\share rather than \n> c:\\cygwin\\usr\\share. Given this, git-gui does not load as it cannot find \n> its share/git-gui/lib directory\n\nYuck.  I'm considering applying the following.  It works ok on Mac\nOS X where the bug isn't triggered anyway.  ;-) I won't be able to\ntest on Cygwin until tomorrow.\n\n-->8--\ngit-gui: Correctly install to /usr/bin on Cygwin\n\nMark Levedahl <mlevedahl@gmail.com> noted that installation on Cygwin\nto /usr/bin can cause problems with the automatic guessing of our\nlibrary location.  The problem is that installation to /usr/bin\nmeans we actually have:\n\n  /usr/bin   = c:\\cygwin\\bin\n  /usr/share = c:\\cygwin\\usr\\share\n\nSo git-gui guesses that its library should be found within the\nc:\\cygwin\\share directory, as that is where it should be relative\nto the script itself in c:\\cygwin\\bin.\n\nIn this case we have to use `cygpath` during installation to find out\nwhat the mapping is from the UNIX path we are seeing in GNU make,\nto the Windows path we will actually see in our Tcl/Tk process.\nAfter that mapping has been performed we can then test to see if\nour share directory can be found by relative location, or if we\nneed to encode the absolute location.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Makefile |   14 ++++++++++++--\n 1 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3de0de1..1c01c83 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -7,6 +7,8 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n -include GIT-VERSION-FILE\n \n+uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n+\n SCRIPT_SH = git-gui.sh\n GITGUI_BUILT_INS = git-citool\n ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))\n@@ -58,14 +60,22 @@ exedir_SQ = $(subst ','\\'',$(exedir))\n \n $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n \t$(QUIET_GEN)rm -f $@ $@+ && \\\n-\tif test '$(exedir_SQ)' = '$(libdir_SQ)'; then \\\n+\tA='$(exedir_SQ)' && \\\n+\tB='$(libdir_SQ)' && \\\n+\tif test \"$(uname_O)\" = Cygwin; then \\\n+\t\tA=\"$$(cygpath -m -a \"$$A\")\" && \\\n+\t\tB=\"$$(cygpath -m -a \"$$B\")\"; \\\n+\tfi && \\\n+\tif test \"$$A\" = \"$$B\"; then \\\n \t\tGITGUI_RELATIVE=1; \\\n+\telse \\\n+\t\tGITGUI_RELATIVE=; \\\n \tfi && \\\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t\t-e 's|^exec wish \"$$0\"|exec $(subst |,'\\|',$(TCLTK_PATH_SQ)) \"$$0\"|' \\\n \t\t-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \\\n \t\t-e 's|@@GITGUI_RELATIVE@@|'$$GITGUI_RELATIVE'|' \\\n-\t\t-e $$GITGUI_RELATIVE's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \\\n+\t\t-e $$GITGUI_RELATIVE\"s|@@GITGUI_LIBDIR@@|$$B|\" \\\n \t\t$@.sh >$@+ && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n-- \n1.5.2.2.1012.ge05f4\n\n\n-- \nShawn.\n"},{"id":"45373","messageId":"4678236A.9000606@gmail.com","threadId":"8652","inReplyTo":"20070619144928.GA8477@spearce.org","subject":"Re: git-gui cannot find share/git-gui under cygwin","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-06-19T18:41:46Z","receivedAt":"2007-06-19T18:41:46Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Shawn O. Pearce wrote:\n> Yuck.  I'm considering applying the following.  It works ok on Mac\n> OS X where the bug isn't triggered anyway.  ;-) I won't be able to\n> test on Cygwin until tomorrow.\n>\n>   \nsorry, no joy. The problem is that gitexecdir=/usr/bin, but...\n\n/usr/bin is a Cygwin mount point that points at c:\\cygwin\\bin.\n\nso...\n\n$ cygpath -m -a /bin\nC:/cygwin/bin\n$ cygpath -m -a /usr\nC:/cygwin/usr\n$ cygpath -m -a /usr/bin\nC:/cygwin/bin\n$ cygpath -m -a /usr/share\nC:/cygwin/usr/share\n\nand the result is that both  exedir_SQ  and  libdir_SQ  have the value  \n/usr/share/git-gui-lib\n\nI don't think there is a portable solution here. Maybe just say\n\n    if test \"$(uname_O)\" = Cygwin; then \\\n        GITGUI_RELATIVE=; \\\n \nand be done with it.\n\nMark\n"},{"id":"45460","messageId":"20070621033030.GE8477@spearce.org","threadId":"8652","inReplyTo":"4678236A.9000606@gmail.com","subject":"Re: git-gui cannot find share/git-gui under cygwin","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-06-21T03:30:30Z","receivedAt":"2007-06-21T03:30:30Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Mark Levedahl <mlevedahl@gmail.com> wrote:\n> Shawn O. Pearce wrote:\n> >Yuck.  I'm considering applying the following.  It works ok on Mac\n> >OS X where the bug isn't triggered anyway.  ;-) I won't be able to\n> >test on Cygwin until tomorrow.\n>  \n> sorry, no joy. The problem is that gitexecdir=/usr/bin, but...\n\nThanks for the feedback.\n\n> I don't think there is a portable solution here. Maybe just say\n> \n>    if test \"$(uname_O)\" = Cygwin; then \\\n>        GITGUI_RELATIVE=; \\\n> \n> and be done with it.\n\nYup.  Done.  Now in my `maint`, `master` and `pu` branches.\n\n-- \nShawn.\n"}]}