One of these "weird usage causes weird bugs".

One way to reproduce:

mkdir foo
cd foo
git init
git commit -am "Initial"
gitk &
# or
gitk --all &

Resulting in (gitk-git/gitk line 503 - 512):

can't read "viewmainheadid_orig(1)": no such variable
can't read "viewmainheadid_orig(1)": no such variable
    while executing
"if {$mainheadid ne $viewmainheadid_orig($view)} {
        if {$showlocalchanges} {
        set viewmainheadid($view) $mainheadid
        set vie..."
    (procedure "updatecommits" line 13)
    invoked from within
    (command bound to event)

As "$mainheadid" is not set, should there be something in the
direction of this perhaps?

Subject: [PATCH] gitk catch missing head id on update

 gitk-git/gitk |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index d93bd99..fa869d7 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -499,6 +499,11 @@ proc updatecommits {} {

     set hasworktree [hasworktree]
+    if {$mainheadid eq ""} {
+       # error_popup "[mc "Error updating commits:"] No main HEAD id"
+       show_status [mc "No main HEAD id"]
+       return {}
+    }
     set view $curview
     if {$mainheadid ne $viewmainheadid_orig($view)} {
        if {$showlocalchanges} {

Or perhaps some logic in:
proc rereadrefs {}

Best regards,
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to