git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	"Pat Thoyts" <patthoyts@users.sourceforge.net>,
	"Kirill Smelkov" <kirr@landau.phys.spbu.ru>,
	"Clément Poulain" <clement.poulain@ensimag.imag.fr>,
	"Matthieu Moy" <Matthieu.Moy@imag.fr>
Subject: [PATCH] git-gui: Use shell to launch textconv filter in "blame"
Date: Thu,  5 Aug 2010 12:05:22 +0200	[thread overview]
Message-ID: <1281002722-3042-1-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <vpqlj8l2xd5.fsf@bauges.imag.fr>

This allows one to use textconv commands with arguments.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 git-gui/Makefile      |    1 +
 git-gui/git-gui.sh    |    6 ++++++
 git-gui/lib/blame.tcl |    4 +++-
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/git-gui/Makefile b/git-gui/Makefile
index 197b55e..e22ba5c 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -215,6 +215,7 @@ endif
 $(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS
 	$(QUIET_GEN)rm -f $@ $@+ && \
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
+		-e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \
 		-e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \
 		-e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \
 		-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index bb10489..9049abf 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -128,6 +128,7 @@ set _githtmldir {}
 set _reponame {}
 set _iscygwin {}
 set _search_path {}
+set _shellpath {@@SHELL_PATH@@}
 
 set _trace [lsearch -exact $argv --trace]
 if {$_trace >= 0} {
@@ -137,6 +138,11 @@ if {$_trace >= 0} {
 	set _trace 0
 }
 
+proc shellpath {} {
+	global _shellpath
+	return $_shellpath
+}
+
 proc appname {} {
 	global _appname
 	return $_appname
diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl
index 2137ec9..77656d3 100644
--- a/git-gui/lib/blame.tcl
+++ b/git-gui/lib/blame.tcl
@@ -460,7 +460,9 @@ method _load {jump} {
 	}
 	if {$commit eq {}} {
 		if {$do_textconv ne 0} {
-			set fd [open |[list $textconv $path] r]
+			# Run textconv with sh -c "..." to allow it to
+			# contain command + arguments.
+			set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
 		} else {
 			set fd [open $path r]
 		}
-- 
1.7.2.1.30.g18195

  reply	other threads:[~2010-08-05 10:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 19:25 [BUG] git gui blame fails for multi-word textconv filter Kirill Smelkov
2010-08-04 23:46 ` Clément Poulain
2010-08-05  9:59   ` Matthieu Moy
2010-08-05 10:05     ` Matthieu Moy [this message]
2010-08-05 23:10       ` [PATCH] git-gui: Use shell to launch textconv filter in "blame" Pat Thoyts
2010-08-06  8:51         ` Matthieu Moy
2010-08-06 17:56           ` Pat Thoyts
2010-08-19  8:05           ` [BUG] git gui blame fails for multi-word textconv filter Kirill Smelkov
2010-08-05 22:58   ` Pat Thoyts

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=1281002722-3042-1-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=clement.poulain@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    --cc=kirr@landau.phys.spbu.ru \
    --cc=patthoyts@users.sourceforge.net \
    --cc=spearce@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).