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

PATCH to add a button to perform a meld on the current file

From
PDPierre Marc Dumuid <pierre.dumuid@adelaide.edu.au>
Date
Sep 7, 2007, 04:46 UTC
Message-ID
<46E0D79E.3080606@adelaide.edu.au>

Here's a dodgy [not that good] patch to perform a GUI comparison on a file. It is dodgy because it assumes cogito is installed, and you want to use meld, and it doesn't remove the temporary files.

Not expecting this to go into main branch, but I find it handy for my own purposes nether-the-less.

Pierre

--- /usr/bin/gitk 2007-08-06 07:55:41.000000000 +0930 +++ /home/pmdumuid/bin/gitkpmd 2007-09-07 14:09:28.000000000 +0930

@@ -609,7 +609,9 @@
 	-command changediffdisp -variable diffelide -value {0 1}
     radiobutton .bleft.mid.new -text "New version" \
 	-command changediffdisp -variable diffelide -value {1 0}
-    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
+    button .bleft.top.meld -text "GUI diff" -command doguidiff \
+	-font $uifont
+    pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new .bleft.top.meld -side left
     set ctext .bleft.ctext
     text $ctext -background $bgcolor -foreground $fgcolor \
 	-state disabled -font $textfont \
@@ -4564,6 +4566,19 @@
     }
 }
 
+proc doguidiff {} {
+    global cflist sha1string
+
+    set taglist [$cflist tag ranges highlight]
+    set from [lindex $taglist 0]
+    set to [lindex $taglist 1]
+
+    set fname [$cflist get $from $to]
+    exec cg-admin-cat -r $sha1string^ $fname > .gitk_diffolder
+    exec cg-admin-cat -r $sha1string $fname > .gitk_diffnewer
+    exec meld .gitk_diffolder .gitk_diffnewer &
+}
+
 proc dosearch {} {
     global sstring ctext searchstring searchdirn
 
Next: Johannes Schindelin
Message 1 of 2 in “PATCH to add a button to perform a meld on the current file”
  1. Pierre Marc DumuidSep 7, 2007
  2. Johannes SchindelinSep 7, 2007

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.