{"thread":{"id":"31699","subject":"[BUG] gitk: clicking on a connecting line produces can't read \"cflist_top\"","startedAt":"2012-10-01T08:40:01Z","lastAt":"2012-10-21T22:25:45Z","messageCount":5,"participants":["Johannes Sixt","Stefan Haller","Paul Mackerras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200251","messageId":"506956E1.1080303@viscovery.net","threadId":"31699","inReplyTo":null,"subject":"[BUG] gitk: clicking on a connecting line produces can't read \"cflist_top\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-10-01T08:40:01Z","receivedAt":"2012-10-01T08:40:01Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Clicking on a line that connects commit nodes produces this error:\n\ncan't read \"cflist_top\": no such variable\ncan't read \"cflist_top\": no such variable\n    while executing\n\"$cflist tag remove highlight $cflist_top.0 \"$cflist_top.0 lineend\"\"\n    (procedure \"highlightfile\" line 4)\n    invoked from within\n\"highlightfile 0\"\n    (procedure \"highlightfile_for_scrollpos\" line 8)\n    invoked from within\n\"highlightfile_for_scrollpos $topidx\"\n    (procedure \"scrolltext\" line 9)\n    invoked from within\n\"scrolltext 0.0 1.0\"\n    (vertical scrolling command executed by text)\n\n\nBisection points to b967135d (Synchronize highlighting in file view when\nscrolling diff).\n\ngitk remains responsive after the error window is closed, so it is not\nurgent. A fix would be appreciated nevertheless.\n\n-- Hannes\n"},{"id":"200564","messageId":"1349383817-14457-1-git-send-email-stefan@haller-berlin.de","threadId":"31699","inReplyTo":"506956E1.1080303@viscovery.net","subject":"Re: [BUG] gitk: clicking on a connecting line produces can't read \"cflist_top\"","fromName":"Stefan Haller","fromEmail":"stefan@haller-berlin.de","sentAt":"2012-10-04T20:50:15Z","receivedAt":"2012-10-04T20:50:15Z","isPatch":false,"sender":{"key":"stefan@haller-berlin.de","avatar":"https://avatars.githubusercontent.com/u/1225667?v=4"},"body":"Sorry, I didn't realize that there is a display mode where the\nlist of files is empty, not even showing a \"Comments\" entry.\n\nHere's a patch that fixes it, plus another patch that is only related\nin so far as the bug that it fixes was introduced by the same commit.\n\n[PATCH 1/2] gitk: Fix error message when clicking on a connecting line\n[PATCH 2/2] gitk: When searching, only highlight files when in Patch mode\n"},{"id":"200536","messageId":"1349383817-14457-2-git-send-email-stefan@haller-berlin.de","threadId":"31699","inReplyTo":"1349383817-14457-1-git-send-email-stefan@haller-berlin.de","subject":"[PATCH 1/2] gitk: Fix error message when clicking on a connecting line","fromName":"Stefan Haller","fromEmail":"stefan@haller-berlin.de","sentAt":"2012-10-04T20:50:16Z","receivedAt":"2012-10-04T20:50:16Z","isPatch":true,"sender":{"key":"stefan@haller-berlin.de","avatar":"https://avatars.githubusercontent.com/u/1225667?v=4"},"body":"When clicking on the line that connects two commit nodes, gitk\nwould bring up an error dialog saying \"can't read \"cflist_top\":\nno such variable\".\n\nThis fixes a regression that was introduced with b967135 (\"gitk:\nSynchronize highlighting in file view when scrolling diff\").\n\nSigned-off-by: Stefan Haller <stefan@haller-berlin.de>\n---\n gitk | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/gitk b/gitk\nindex 379582a..8935284 100755\n--- a/gitk\n+++ b/gitk\n@@ -7958,6 +7958,8 @@ proc changediffdisp {} {\n proc highlightfile {cline} {\n     global cflist cflist_top\n \n+    if {![info exists cflist_top]} return\n+\n     $cflist tag remove highlight $cflist_top.0 \"$cflist_top.0 lineend\"\n     $cflist tag add highlight $cline.0 \"$cline.0 lineend\"\n     $cflist see $cline.0\n-- \n1.8.0.rc0.36.gef0f079\n"},{"id":"200568","messageId":"1349383817-14457-3-git-send-email-stefan@haller-berlin.de","threadId":"31699","inReplyTo":"1349383817-14457-1-git-send-email-stefan@haller-berlin.de","subject":"[PATCH 2/2] gitk: When searching, only highlight files when in Patch mode","fromName":"Stefan Haller","fromEmail":"stefan@haller-berlin.de","sentAt":"2012-10-04T20:50:17Z","receivedAt":"2012-10-04T20:50:17Z","isPatch":true,"sender":{"key":"stefan@haller-berlin.de","avatar":"https://avatars.githubusercontent.com/u/1225667?v=4"},"body":"This fixes another regression that was introduced in b967135 (\"gitk:\nSynchronize highlighting in file view when scrolling diff\"): when\nsearching for a string in tree mode, jumping to the next search hit\nwould highlight the \"Comments\" entry in the file list.\n\nSigned-off-by: Stefan Haller <stefan@haller-berlin.de>\n---\n gitk | 13 ++++++-------\n 1 file changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 8935284..0ee5585 100755\n--- a/gitk\n+++ b/gitk\n@@ -7967,8 +7967,9 @@ proc highlightfile {cline} {\n }\n \n proc highlightfile_for_scrollpos {topidx} {\n-    global difffilestart\n+    global cmitmode difffilestart\n \n+    if {$cmitmode eq \"tree\"} return\n     if {![info exists difffilestart]} return\n \n     set top [lindex [split $topidx .] 0]\n@@ -8192,12 +8193,10 @@ proc scrolltext {f0 f1} {\n     global searchstring cmitmode ctext\n     global suppress_highlighting_file_for_this_scrollpos\n \n-    if {$cmitmode ne \"tree\"} {\n-\tset topidx [$ctext index @0,0]\n-\tif {![info exists suppress_highlighting_file_for_this_scrollpos]\n-\t    || $topidx ne $suppress_highlighting_file_for_this_scrollpos} {\n-\t    highlightfile_for_scrollpos $topidx\n-\t}\n+    set topidx [$ctext index @0,0]\n+    if {![info exists suppress_highlighting_file_for_this_scrollpos]\n+\t|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {\n+\thighlightfile_for_scrollpos $topidx\n     }\n \n     catch {unset suppress_highlighting_file_for_this_scrollpos}\n-- \n1.8.0.rc0.36.gef0f079\n"},{"id":"201668","messageId":"20121021222545.GC7407@bloggs.ozlabs.ibm.com","threadId":"31699","inReplyTo":"1349383817-14457-1-git-send-email-stefan@haller-berlin.de","subject":"Re: [BUG] gitk: clicking on a connecting line produces can't read \"cflist_top\"","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2012-10-21T22:25:45Z","receivedAt":"2012-10-21T22:25:45Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, Oct 04, 2012 at 10:50:15PM +0200, Stefan Haller wrote:\n> Sorry, I didn't realize that there is a display mode where the\n> list of files is empty, not even showing a \"Comments\" entry.\n> \n> Here's a patch that fixes it, plus another patch that is only related\n> in so far as the bug that it fixes was introduced by the same commit.\n> \n> [PATCH 1/2] gitk: Fix error message when clicking on a connecting line\n> [PATCH 2/2] gitk: When searching, only highlight files when in Patch mode\n\nThanks, applied both.\n\nPaul.\n"}]}