git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Levedahl <mlevedahl@gmail.com>
To: paulus@samba.org, spearc@spearce.org
Cc: git@vger.kernel.org, Mark Levedahl <mlevedahl@gmail.com>
Subject: [PATCH] gitk - convert gitk-path to Windows if on Cygwin
Date: Sat, 14 Jun 2008 20:33:33 -0400	[thread overview]
Message-ID: <1213490013-908-1-git-send-email-mlevedahl@gmail.com> (raw)

Cygwin does not have a recent Tcl release (it is stuck at 8.4.1), and
there is small chance this will change soon. The only way Cygwin users
can have a more recent Tcl/Tk is to use a pure Windows release. However,
these do not understand POSIX paths as used in Cygwin. This really only
matters for finding the gitk script itself, all other arguments are
interpreted by git which is POSIX. This patch modifies gitk to convert
the path to the gitk script from POSIX to Windows before execution.

This patch was inspired by a patch submitted long ago by Shawn Pierce.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
---
 Makefile |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index e1b6045..742ae5b 100644
--- a/Makefile
+++ b/Makefile
@@ -51,9 +51,15 @@ uninstall::
 clean::
 	$(RM) gitk-wish po/*.msg
 
+OS := $(shell sh -c 'uname -o 2>/dev/null')
+ifeq ($(OS), Cygwin)
+	EXECLINE = argv0=`cygpath --windows --absolute "$$0"`; \\\nexec $(TCLTK_PATH_SQ) "$$argv0" -- "$$@"
+else
+	EXECLINE = exec $(TCLTK_PATH_SQ) "$$0" -- "$$@"
+endif
 gitk-wish: gitk
 	$(QUIET_GEN)$(RM) $@ $@+ && \
-	sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
+	sed -e '1,3s|^exec .*|$(EXECLINE)|' <gitk >$@+ && \
 	chmod +x $@+ && \
 	mv -f $@+ $@
 
-- 
1.5.6.rc2.65.gcb6b9

                 reply	other threads:[~2008-06-15  0:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1213490013-908-1-git-send-email-mlevedahl@gmail.com \
    --to=mlevedahl@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=spearc@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).