{"thread":{"id":"610","subject":"[ANNOUNCE] mtkdiff-20050514 (integrated w/ gitk)","startedAt":"2005-05-14T02:58:15Z","lastAt":"2005-05-14T06:50:04Z","messageCount":2,"participants":["Tejun Heo","Paul Mackerras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"3280","messageId":"20050514025815.GA5845@htj.dyndns.org","threadId":"610","inReplyTo":null,"subject":"[ANNOUNCE] mtkdiff-20050514 (integrated w/ gitk)","fromName":"Tejun Heo","fromEmail":"htejun@gmail.com","sentAt":"2005-05-14T02:58:15Z","receivedAt":"2005-05-14T02:58:15Z","isPatch":false,"sender":{"key":"htejun@gmail.com","avatar":null},"body":" Hello, guys.\n\n This is mtkdiff-20050514.  I've modified gitk to invoke gitkdiff on\ndouble click and right click.  If you double click on a commit mtkdiff\nwill show the commit.  If you right click on a commit while another\none is selected, mtkdiff will show the difference between the two\ncommits (as in bk revtool).  Also, I've modified gitk & gitkdiff to\nshow commit SHA1 in the info text when a commit is selected.\n\n The tarball can be found at\n\n http://home-tj.org/mtkdiff/files/mtkdiff-20050514.tar.gz\n\n Patch of the gitk changes follow.  (gitk-0.9 vs. the modified version)\n\n Thanks.\n\n--- gitk-0.9\t2005-05-14 11:57:02.000000000 +0900\n+++ gitk\t2005-05-14 11:57:04.000000000 +0900\n@@ -175,6 +175,8 @@ proc makewindow {} {\n     pack .ctop -side top -fill both -expand 1\n \n     bindall <1> {selcanvline %x %y}\n+    bindall <Double-1> {canvdclick %x %y}\n+    bindall <3> {canvrclick %x %y}\n     bindall <B1-Motion> {selcanvline %x %y}\n     bindall <ButtonRelease-4> \"allcanvs yview scroll -5 u\"\n     bindall <ButtonRelease-5> \"allcanvs yview scroll 5 u\"\n@@ -473,7 +475,7 @@ proc drawgraph {start} {\n     }\n }\n \n-proc selcanvline {x y} {\n+proc coordtoline {x, y} {\n     global canv canvy0 ctext linespc selectedline\n     global lineid linehtag linentag linedtag\n     set ymax [lindex [$canv cget -scrollregion] 3]\n@@ -483,8 +485,38 @@ proc selcanvline {x y} {\n     if {$l < 0} {\n \tset l 0\n     }\n-    if {[info exists selectedline] && $selectedline == $l} return\n-    selectline $l\n+    if {[info exists selectedline] && $selectedline == $l} {\n+\treturn -1\n+    }\n+    return $l\n+}\n+\n+proc selcanvline {x y} {\n+    set l [coordtoline $x, $y]\n+    if {$l >= 0} {\n+\tselectline $l\n+    }\n+}\n+\n+proc canvdclick {x y} {\n+    global lineid selectedline\n+    selcanvline $x $y\n+    if {[info exists selectedline]} {\n+\texec gitkdiff -r $lineid($selectedline) &\n+    }\n+}\n+\n+proc canvrclick {x y} {\n+    global selectedline lineid\n+\n+    if {[info exists selectedline]} {\n+\tset l [coordtoline $x, $y]\n+\tif {$selectedline != $l} {\n+\t    exec gitkdiff -r $lineid($selectedline) -r $lineid($l) &\n+\t}\n+    } else {\n+\tselcanvline $x $y\n+    }\n }\n \n proc selectline {l} {\n@@ -521,6 +553,7 @@ proc selectline {l} {\n     $ctext conf -state normal\n     $ctext delete 0.0 end\n     set info $commitinfo($id)\n+    $ctext insert end \"Commit: $id\\n\"\n     $ctext insert end \"Author: [lindex $info 1]  [lindex $info 2]\\n\"\n     $ctext insert end \"Committer: [lindex $info 3]  [lindex $info 4]\\n\"\n     $ctext insert end \"\\n\"\n"},{"id":"3285","messageId":"17029.40860.516486.308420@cargo.ozlabs.ibm.com","threadId":"610","inReplyTo":"20050514025815.GA5845@htj.dyndns.org","subject":"Re: [ANNOUNCE] mtkdiff-20050514 (integrated w/ gitk)","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2005-05-14T06:50:04Z","receivedAt":"2005-05-14T06:50:04Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Tejun Heo writes:\n\n>  This is mtkdiff-20050514.  I've modified gitk to invoke gitkdiff on\n> double click and right click.  If you double click on a commit mtkdiff\n> will show the commit.  If you right click on a commit while another\n> one is selected, mtkdiff will show the difference between the two\n> commits (as in bk revtool).  Also, I've modified gitk & gitkdiff to\n> show commit SHA1 in the info text when a commit is selected.\n\nCute.  I was thinking along the same lines, but intending to use\ndirdiff to display the differences.  I'll make the diff viewer\nuser-configurable, I think.  Also, I'm planning to put a bar with the\nsha1 and a search facility in the next version of gitk.\n\nPaul.\n"}]}