Git development
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: paulus@samba.org
Cc: git@vger.kernel.org
Subject: [ANNOUNCE] mtkdiff-20050514 (integrated w/ gitk)
Date: Sat, 14 May 2005 11:58:15 +0900	[thread overview]
Message-ID: <20050514025815.GA5845@htj.dyndns.org> (raw)

 Hello, guys.

 This is mtkdiff-20050514.  I've modified gitk to invoke gitkdiff on
double click and right click.  If you double click on a commit mtkdiff
will show the commit.  If you right click on a commit while another
one is selected, mtkdiff will show the difference between the two
commits (as in bk revtool).  Also, I've modified gitk & gitkdiff to
show commit SHA1 in the info text when a commit is selected.

 The tarball can be found at

 http://home-tj.org/mtkdiff/files/mtkdiff-20050514.tar.gz

 Patch of the gitk changes follow.  (gitk-0.9 vs. the modified version)

 Thanks.

--- gitk-0.9	2005-05-14 11:57:02.000000000 +0900
+++ gitk	2005-05-14 11:57:04.000000000 +0900
@@ -175,6 +175,8 @@ proc makewindow {} {
     pack .ctop -side top -fill both -expand 1
 
     bindall <1> {selcanvline %x %y}
+    bindall <Double-1> {canvdclick %x %y}
+    bindall <3> {canvrclick %x %y}
     bindall <B1-Motion> {selcanvline %x %y}
     bindall <ButtonRelease-4> "allcanvs yview scroll -5 u"
     bindall <ButtonRelease-5> "allcanvs yview scroll 5 u"
@@ -473,7 +475,7 @@ proc drawgraph {start} {
     }
 }
 
-proc selcanvline {x y} {
+proc coordtoline {x, y} {
     global canv canvy0 ctext linespc selectedline
     global lineid linehtag linentag linedtag
     set ymax [lindex [$canv cget -scrollregion] 3]
@@ -483,8 +485,38 @@ proc selcanvline {x y} {
     if {$l < 0} {
 	set l 0
     }
-    if {[info exists selectedline] && $selectedline == $l} return
-    selectline $l
+    if {[info exists selectedline] && $selectedline == $l} {
+	return -1
+    }
+    return $l
+}
+
+proc selcanvline {x y} {
+    set l [coordtoline $x, $y]
+    if {$l >= 0} {
+	selectline $l
+    }
+}
+
+proc canvdclick {x y} {
+    global lineid selectedline
+    selcanvline $x $y
+    if {[info exists selectedline]} {
+	exec gitkdiff -r $lineid($selectedline) &
+    }
+}
+
+proc canvrclick {x y} {
+    global selectedline lineid
+
+    if {[info exists selectedline]} {
+	set l [coordtoline $x, $y]
+	if {$selectedline != $l} {
+	    exec gitkdiff -r $lineid($selectedline) -r $lineid($l) &
+	}
+    } else {
+	selcanvline $x $y
+    }
 }
 
 proc selectline {l} {
@@ -521,6 +553,7 @@ proc selectline {l} {
     $ctext conf -state normal
     $ctext delete 0.0 end
     set info $commitinfo($id)
+    $ctext insert end "Commit: $id\n"
     $ctext insert end "Author: [lindex $info 1]  [lindex $info 2]\n"
     $ctext insert end "Committer: [lindex $info 3]  [lindex $info 4]\n"
     $ctext insert end "\n"

             reply	other threads:[~2005-05-14  2:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-14  2:58 Tejun Heo [this message]
2005-05-14  6:50 ` [ANNOUNCE] mtkdiff-20050514 (integrated w/ gitk) Paul Mackerras

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=20050514025815.GA5845@htj.dyndns.org \
    --to=htejun@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.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