git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk: handle external diff tool with spaces in the path

From
Pat Thoyts <patthoyts@users.sourceforge.net>
Date
Apr 15, 2009, 15:54 UTC
Message-ID
<87tz4pnc9g.fsf@users.sourceforge.net>
  This fixes the launching of external diff to handle a diff tool
  that has spaces in the path. This patch ensures a correctly formed
  tcl list is passed to the open command with a single pipe character
  prefixing the list (as per the tcl manual page for open).
  The specific fault observed was that selecting WinMerge as the diff
  tool from the default installed location in Program Files failed to
  be launched from the context menu.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/gitk b/gitk
index edb3ba2..656c2c1 100755
--- a/gitk
+++ b/gitk
@@ -3237,9 +3237,8 @@ proc external_diff {} {
     set difftofile [external_diff_get_one_file $diffidto $flist_menu_file $diffdir]
 
     if {$difffromfile ne {} && $difftofile ne {}} {
-        set cmd [concat | [shellsplit $extdifftool] \
-		     [list $difffromfile $difftofile]]
-        if {[catch {set fl [open $cmd r]} err]} {
+        set cmd [list [shellsplit $extdifftool] $difffromfile $difftofile]
+        if {[catch {set fl [open |$cmd r]} err]} {
             file delete -force $diffdir
             error_popup "$extdifftool: [mc "command failed:"] $err"
         } else {
-- 
1.6.2.2.1669.g7eaf8
Message 1 of 1 in “gitk: handle external diff tool with spaces in the path”
  1. gitk: handle external diff tool with spaces in the pathPat Thoyts, Apr 15, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.