git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] gitk: clicking on a connecting line produces can't read "cflist_top"
@ 2012-10-01  8:40 Johannes Sixt
  2012-10-04 20:50 ` Stefan Haller
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Sixt @ 2012-10-01  8:40 UTC (permalink / raw)
  To: Stefan Haller; +Cc: Paul Mackerras, Git Mailing List

Clicking on a line that connects commit nodes produces this error:

can't read "cflist_top": no such variable
can't read "cflist_top": no such variable
    while executing
"$cflist tag remove highlight $cflist_top.0 "$cflist_top.0 lineend""
    (procedure "highlightfile" line 4)
    invoked from within
"highlightfile 0"
    (procedure "highlightfile_for_scrollpos" line 8)
    invoked from within
"highlightfile_for_scrollpos $topidx"
    (procedure "scrolltext" line 9)
    invoked from within
"scrolltext 0.0 1.0"
    (vertical scrolling command executed by text)


Bisection points to b967135d (Synchronize highlighting in file view when
scrolling diff).

gitk remains responsive after the error window is closed, so it is not
urgent. A fix would be appreciated nevertheless.

-- Hannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] gitk: clicking on a connecting line produces can't read "cflist_top"
  2012-10-01  8:40 [BUG] gitk: clicking on a connecting line produces can't read "cflist_top" Johannes Sixt
@ 2012-10-04 20:50 ` Stefan Haller
  2012-10-04 20:50   ` [PATCH 1/2] gitk: Fix error message when clicking on a connecting line Stefan Haller
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefan Haller @ 2012-10-04 20:50 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Johannes Sixt, git

Sorry, I didn't realize that there is a display mode where the
list of files is empty, not even showing a "Comments" entry.

Here's a patch that fixes it, plus another patch that is only related
in so far as the bug that it fixes was introduced by the same commit.

[PATCH 1/2] gitk: Fix error message when clicking on a connecting line
[PATCH 2/2] gitk: When searching, only highlight files when in Patch mode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] gitk: Fix error message when clicking on a connecting line
  2012-10-04 20:50 ` Stefan Haller
@ 2012-10-04 20:50   ` Stefan Haller
  2012-10-04 20:50   ` [PATCH 2/2] gitk: When searching, only highlight files when in Patch mode Stefan Haller
  2012-10-21 22:25   ` [BUG] gitk: clicking on a connecting line produces can't read "cflist_top" Paul Mackerras
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Haller @ 2012-10-04 20:50 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Johannes Sixt, git

When clicking on the line that connects two commit nodes, gitk
would bring up an error dialog saying "can't read "cflist_top":
no such variable".

This fixes a regression that was introduced with b967135 ("gitk:
Synchronize highlighting in file view when scrolling diff").

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
 gitk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gitk b/gitk
index 379582a..8935284 100755
--- a/gitk
+++ b/gitk
@@ -7958,6 +7958,8 @@ proc changediffdisp {} {
 proc highlightfile {cline} {
     global cflist cflist_top
 
+    if {![info exists cflist_top]} return
+
     $cflist tag remove highlight $cflist_top.0 "$cflist_top.0 lineend"
     $cflist tag add highlight $cline.0 "$cline.0 lineend"
     $cflist see $cline.0
-- 
1.8.0.rc0.36.gef0f079

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] gitk: When searching, only highlight files when in Patch mode
  2012-10-04 20:50 ` Stefan Haller
  2012-10-04 20:50   ` [PATCH 1/2] gitk: Fix error message when clicking on a connecting line Stefan Haller
@ 2012-10-04 20:50   ` Stefan Haller
  2012-10-21 22:25   ` [BUG] gitk: clicking on a connecting line produces can't read "cflist_top" Paul Mackerras
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Haller @ 2012-10-04 20:50 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Johannes Sixt, git

This fixes another regression that was introduced in b967135 ("gitk:
Synchronize highlighting in file view when scrolling diff"): when
searching for a string in tree mode, jumping to the next search hit
would highlight the "Comments" entry in the file list.

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
 gitk | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/gitk b/gitk
index 8935284..0ee5585 100755
--- a/gitk
+++ b/gitk
@@ -7967,8 +7967,9 @@ proc highlightfile {cline} {
 }
 
 proc highlightfile_for_scrollpos {topidx} {
-    global difffilestart
+    global cmitmode difffilestart
 
+    if {$cmitmode eq "tree"} return
     if {![info exists difffilestart]} return
 
     set top [lindex [split $topidx .] 0]
@@ -8192,12 +8193,10 @@ proc scrolltext {f0 f1} {
     global searchstring cmitmode ctext
     global suppress_highlighting_file_for_this_scrollpos
 
-    if {$cmitmode ne "tree"} {
-	set topidx [$ctext index @0,0]
-	if {![info exists suppress_highlighting_file_for_this_scrollpos]
-	    || $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
-	    highlightfile_for_scrollpos $topidx
-	}
+    set topidx [$ctext index @0,0]
+    if {![info exists suppress_highlighting_file_for_this_scrollpos]
+	|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
+	highlightfile_for_scrollpos $topidx
     }
 
     catch {unset suppress_highlighting_file_for_this_scrollpos}
-- 
1.8.0.rc0.36.gef0f079

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [BUG] gitk: clicking on a connecting line produces can't read "cflist_top"
  2012-10-04 20:50 ` Stefan Haller
  2012-10-04 20:50   ` [PATCH 1/2] gitk: Fix error message when clicking on a connecting line Stefan Haller
  2012-10-04 20:50   ` [PATCH 2/2] gitk: When searching, only highlight files when in Patch mode Stefan Haller
@ 2012-10-21 22:25   ` Paul Mackerras
  2 siblings, 0 replies; 5+ messages in thread
From: Paul Mackerras @ 2012-10-21 22:25 UTC (permalink / raw)
  To: Stefan Haller; +Cc: Johannes Sixt, git

On Thu, Oct 04, 2012 at 10:50:15PM +0200, Stefan Haller wrote:
> Sorry, I didn't realize that there is a display mode where the
> list of files is empty, not even showing a "Comments" entry.
> 
> Here's a patch that fixes it, plus another patch that is only related
> in so far as the bug that it fixes was introduced by the same commit.
> 
> [PATCH 1/2] gitk: Fix error message when clicking on a connecting line
> [PATCH 2/2] gitk: When searching, only highlight files when in Patch mode

Thanks, applied both.

Paul.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-21 22:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-01  8:40 [BUG] gitk: clicking on a connecting line produces can't read "cflist_top" Johannes Sixt
2012-10-04 20:50 ` Stefan Haller
2012-10-04 20:50   ` [PATCH 1/2] gitk: Fix error message when clicking on a connecting line Stefan Haller
2012-10-04 20:50   ` [PATCH 2/2] gitk: When searching, only highlight files when in Patch mode Stefan Haller
2012-10-21 22:25   ` [BUG] gitk: clicking on a connecting line produces can't read "cflist_top" Paul Mackerras

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