{"thread":{"id":"13961","subject":"[PATCH] gitk - convert gitk-path to Windows if on Cygwin","startedAt":"2008-06-15T00:33:33Z","lastAt":"2008-06-15T00:33:33Z","messageCount":1,"participants":["Mark Levedahl"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"79896","messageId":"1213490013-908-1-git-send-email-mlevedahl@gmail.com","threadId":"13961","inReplyTo":null,"subject":"[PATCH] gitk - convert gitk-path to Windows if on Cygwin","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-06-15T00:33:33Z","receivedAt":"2008-06-15T00:33:33Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Cygwin does not have a recent Tcl release (it is stuck at 8.4.1), and\nthere is small chance this will change soon. The only way Cygwin users\ncan have a more recent Tcl/Tk is to use a pure Windows release. However,\nthese do not understand POSIX paths as used in Cygwin. This really only\nmatters for finding the gitk script itself, all other arguments are\ninterpreted by git which is POSIX. This patch modifies gitk to convert\nthe path to the gitk script from POSIX to Windows before execution.\n\nThis patch was inspired by a patch submitted long ago by Shawn Pierce.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n Makefile |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex e1b6045..742ae5b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -51,9 +51,15 @@ uninstall::\n clean::\n \t$(RM) gitk-wish po/*.msg\n \n+OS := $(shell sh -c 'uname -o 2>/dev/null')\n+ifeq ($(OS), Cygwin)\n+\tEXECLINE = argv0=`cygpath --windows --absolute \"$$0\"`; \\\\\\nexec $(TCLTK_PATH_SQ) \"$$argv0\" -- \"$$@\"\n+else\n+\tEXECLINE = exec $(TCLTK_PATH_SQ) \"$$0\" -- \"$$@\"\n+endif\n gitk-wish: gitk\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tsed -e '1,3s|^exec .* \"$$0\"|exec $(subst |,'\\|',$(TCLTK_PATH_SQ)) \"$$0\"|' <gitk >$@+ && \\\n+\tsed -e '1,3s|^exec .*|$(EXECLINE)|' <gitk >$@+ && \\\n \tchmod +x $@+ && \\\n \tmv -f $@+ $@\n \n-- \n1.5.6.rc2.65.gcb6b9\n"}]}