gitk broken or user error?
Hi,
I get the following error when invoking gitk with any command line argument, for example, 'gitk --all':
ziti:~/proj/R-devel seth$ gitk --all
Error in startup script: unknown option "-state"
while executing
".bar.view entryconf 3 -state normal"
invoked from within
"if {$cmdline_files ne {} || $revtreeargs ne {}} {
# create a view for the files/dirs specified on the command line set curview 1
set selec..."
(file "/Users/seth/scm/bin/gitk" line 6298)
I tried a certainly incorrect thing; just commenting out the offending lines:
gitk +2 -2
@@ -6305,8 +6305,8 @@ if {$cmdline_files ne {} || $revtreeargs set viewargs(1) $revtreeargs set viewperm(1) 0 addviewmenu 1 - .bar.view entryconf 2 -state normal - .bar.view entryconf 3 -state normal +# .bar.view entryconf 2 -state normal +# .bar.view entryconf 3 -state normal } if {[info exists permviews]} {
And now gitk _seems_ to work. No error message, and I can pass argument to gitk like --all (wow, very useful).
I posted about this in October [*1*], but didn't get any response. I'd like to be able to use gitk without my must-be-wrong patch. This is on OS X ppc (git version 1.4.4.rc1.g73347) with Tcl & Tk at 8.4.7. Can I provide more info? Have I missed a configuration step?
Thanks,
+ seth
Quoted 2 lines · Seth Falcon
I tried a certainly incorrect thing; just commenting out the offending lines:
[snip]
Quoted 10 lines
gitk +2
-2- .bar.view entryconf 2 -state normal - .bar.view entryconf 3 -state normal +# .bar.view entryconf 2 -state normal +# .bar.view entryconf 3 -state normal } if {[info exists permviews]} {And now gitk _seems_ to work. No error message, and I can pass argument to gitk like --all (wow, very useful).
Those lines are intended to enable the "Edit view" and "Delete view" entries in the View menu. Those entries start out disabled and are supposed to be disabled when the "All files" view is displayed, and enabled when any other view is displayed.
I suspect that under OSX, the menu gets an extra entry, or something, that throws off the numbering. Instead of commenting out those lines, could you instead try changing the 2 and 3 to "Edit*" and "Delete*" instead? If that works I'll do a patch to fix the problem properly.
Quoted 1 line
I posted about this in October [*1*], but didn't get any response.
I tend to read the git list intermittently (lkml and linuxppc-dev keep me pretty much occupied :). Please cc me on any gitk bug reports.
Quoted 9 lines · Paul Mackerras
Those lines are intended to enable the "Edit view" and "Delete view" entries in the View menu. Those entries start out disabled and are supposed to be disabled when the "All files" view is displayed, and enabled when any other view is displayed.
I suspect that under OSX, the menu gets an extra entry, or something, that throws off the numbering. Instead of commenting out those lines, could you instead try changing the 2 and 3 to "Edit*" and "Delete*" instead? If that works I'll do a patch to fix the problem properly.
I tried this patch:
gitk +2 -2
@@ -6305,8 +6305,8 @@ if {$cmdline_files ne {} || $revtreeargs set viewargs(1) $revtreeargs set viewperm(1) 0 addviewmenu 1 - .bar.view entryconf 2 -state normal - .bar.view entryconf 3 -state normal + .bar.view entryconf "Edit*" -state normal + .bar.view entryconf "Delete*" -state normal } if {[info exists permviews]} {
And, yes, this allows gitk to load up and be useful. So this is much better than the current behavior. However, if I try clicking on the "All files" view in the view menu, I get an error box along these lines:
unknown option "-state"
unknown option "-state"
while executing
".bar.view entryconf 3 -state [expr {$n == 0? "disabled": "normal"}]"
(procedure "showview" line 56)
invoked from within
"showview 0"
(menu invoke)
Perhaps a similar fix is needed in other parts of the code.
+ seth
Quoted 1 line · Seth Falcon
I tried this patch:
And then I used grep :-)
This patch seems to get the view menu items working. The only strange thing I see now is that if I create a new view and then try to delete it, it stays around in the menu.
+ seth
gitk +4 -4
@@ -1632,8 +1632,8 @@ proc showview {n} { set curview $n set selectedview $n - .bar.view entryconf 2 -state [expr {$n == 0? "disabled": "normal"}] - .bar.view entryconf 3 -state [expr {$n == 0? "disabled": "normal"}] + .bar.view entryconf "Edit*" -state [expr {$n == 0? "disabled": "normal"}] + .bar.view entryconf "Delete*" -state [expr {$n == 0? "disabled": "normal"}] if {![info exists viewdata($n)]} { set pending_select $selid
@@ -6305,8 +6305,8 @@ if {$cmdline_files ne {} || $revtreeargs set viewargs(1) $revtreeargs set viewperm(1) 0 addviewmenu 1 - .bar.view entryconf 2 -state normal - .bar.view entryconf 3 -state normal + .bar.view entryconf "Edit*" -state normal + .bar.view entryconf "Delete*" -state normal }
Quoted 1 line · Seth Falcon
Perhaps a similar fix is needed in other parts of the code.
Sure, the change I asked you to test was just to verify what the underlying problem was.
Quoted 13 lines · Seth Falcon
I get the following error when invoking gitk with any command line argument, for example, 'gitk --all':
ziti:~/proj/R-devel seth$ gitk --all
Error in startup script: unknown option "-state"
while executing
".bar.view entryconf 3 -state normal"
invoked from within
"if {$cmdline_files ne {} || $revtreeargs ne {}} {
# create a view for the files/dirs specified on the command line set curview 1
set selec..."
(file "/Users/seth/scm/bin/gitk" line 6298)
You are not alone on this. I see the same thing on my Mac and it makes it quite difficult to use gitk. However the same version of gitk does not have this problem on Windows. Its clearly related to platform differences.
Of course Windows is unable to open a gitk window without it being collapsed down to only the titlebar, and is also unable to sucessfully reread the user's ~/.gitk file, but that's another bug...
I really should try to figure out what these problems are, but gitk is 6323 lines of Tcl/Tk code which I'm not all too familiar with, and I've got my own growing mass of ~2473 lines of Tcl/Tk code in git-gui to worry about right now...