git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Pierre Marc Dumuid <pierre.dumuid@adelaide.edu.au>
To: git@vger.kernel.org
Subject: PATCH to add a button to perform a meld on the current file
Date: Fri, 07 Sep 2007 14:16:22 +0930	[thread overview]
Message-ID: <46E0D79E.3080606@adelaide.edu.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

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

[-- Attachment #2: gitk_addGUIdiff01.patch --]
[-- Type: text/x-patch, Size: 1166 bytes --]

--- /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
 

             reply	other threads:[~2007-09-07  5:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-07  4:46 Pierre Marc Dumuid [this message]
2007-09-07 11:25 ` Johannes Schindelin

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=46E0D79E.3080606@adelaide.edu.au \
    --to=pierre.dumuid@adelaide.edu.au \
    --cc=git@vger.kernel.org \
    --subject='Re: PATCH to add a button to perform a meld on the current file' \
    /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

Code repositories for project(s) associated with this 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).