threads / discuss / 45550

ttk error when starting git gui

Subject: ttk error when starting git gui

## tl;dr

12 messages between Mar 30, 2017 and Mar 31, 2017.

replies: 11people: 5as markdown or json

David Shrader· Mar 30, 2017, 17:01 UTC · lore
Hello,
I get the following error when trying to start git gui:
Error in startup script: wrong # args: should be "ttk::style theme use 
theme"
     while executing
"ttk::style theme use"
     (procedure "ttext" line 4)
     invoked from within
"ttext $ui_workdir -background white -foreground black \
         -borderwidth 0 \
         -width 20 -height 10 \
         -wrap none \
         -takefocus 1 -highlightthickness 1\
         ..."
     (file 
"/home/dshrader/opt/toss2/common/git/2.12.2/libexec/git-core/git-gui" 
line 3190)

I get this error with the latest released version 2.12.2. Two older git versions are also available on this system, and neither has this issue. Those older versions are 1.7.1 and 2.3.3. I don't see a call to ttext in those corresponding git-gui executables, so that is probably why they work.

Here are the steps to reproduce:
1) cd to existing git repository
2) run 'git gui' (no gui comes up, and the error is printed in the terminal)

I'm running on a RHEL6 based system. Do I have an insufficient version of whatever git gui uses for graphics in the later versions of git? When I try 2.12.2 on my personal workstation running Fedora 25, I don't see the same issue.

Thank you very much for your time, David

-- 
David Shrader
HPC-ENV High Performance Computer Systems
Los Alamos National Lab
Email: dshrader <at> lanl.gov
Peter van der Does· Mar 30, 2017, 19:54 UTC · re: David Shrader · lore

Re: ttk error when starting git gui

On 3/30/17 1:01 PM, David Shrader wrote:
Show 39 quoted lines
> Hello,
> 
> I get the following error when trying to start git gui:
> 
> Error in startup script: wrong # args: should be "ttk::style theme use
> theme"
>     while executing
> "ttk::style theme use"
>     (procedure "ttext" line 4)
>     invoked from within
> "ttext $ui_workdir -background white -foreground black \
>         -borderwidth 0 \
>         -width 20 -height 10 \
>         -wrap none \
>         -takefocus 1 -highlightthickness 1\
>         ..."
>     (file
> "/home/dshrader/opt/toss2/common/git/2.12.2/libexec/git-core/git-gui"
> line 3190)
> 
> I get this error with the latest released version 2.12.2. Two older git
> versions are also available on this system, and neither has this issue.
> Those older versions are 1.7.1 and 2.3.3. I don't see a call to ttext in
> those corresponding git-gui executables, so that is probably why they work.
> 
> Here are the steps to reproduce:
> 
> 1) cd to existing git repository
> 2) run 'git gui' (no gui comes up, and the error is printed in the
> terminal)
> 
> I'm running on a RHEL6 based system. Do I have an insufficient version
> of whatever git gui uses for graphics in the later versions of git? When
> I try 2.12.2 on my personal workstation running Fedora 25, I don't see
> the same issue.
> 
> Thank you very much for your time,
> David
> 

It looks like the git gui needs TCL/TK 8.6.0 or higher. Since that version the command 'ttk::style theme use' has been changed, which allows the command to be run without an argument and then returning the current theme used. I believe RHEL6 use Tk-8.5.7 but I can't be 100% sure.

-- 
Peter van der Does

Facebook : https://www.facebook.com/petervanderdoes
Twitter  : https://twitter.com/petervanderdoes
GitHub   : https://github.com/petervanderdoes
About Me : https://about.me/petervanderdoes
Dennis Kaarsemaker· Mar 30, 2017, 20:44 UTC · re: Peter van der Does · lore

Re: ttk error when starting git gui

On Thu, 2017-03-30 at 15:54 -0400, Peter van der Does wrote:
Show 5 quoted lines
> It looks like the git gui needs TCL/TK 8.6.0 or higher. Since that
> version the command 'ttk::style theme use' has been changed, which
> allows the command to be run without an argument and then returning the
> current theme used.
> I believe RHEL6 use Tk-8.5.7 but I can't be 100% sure.
It does.

$ rpm -q tk tk-8.5.7-5.el6.x86_64

D.
David Shrader· Mar 30, 2017, 21:33 UTC · re: Peter van der Does · lore

Re: ttk error when starting git gui

On 03/30/2017 01:54 PM, Peter van der Does wrote:
Show 47 quoted lines
> On 3/30/17 1:01 PM, David Shrader wrote:
>> Hello,
>>
>> I get the following error when trying to start git gui:
>>
>> Error in startup script: wrong # args: should be "ttk::style theme use
>> theme"
>>      while executing
>> "ttk::style theme use"
>>      (procedure "ttext" line 4)
>>      invoked from within
>> "ttext $ui_workdir -background white -foreground black \
>>          -borderwidth 0 \
>>          -width 20 -height 10 \
>>          -wrap none \
>>          -takefocus 1 -highlightthickness 1\
>>          ..."
>>      (file
>> "/home/dshrader/opt/toss2/common/git/2.12.2/libexec/git-core/git-gui"
>> line 3190)
>>
>> I get this error with the latest released version 2.12.2. Two older git
>> versions are also available on this system, and neither has this issue.
>> Those older versions are 1.7.1 and 2.3.3. I don't see a call to ttext in
>> those corresponding git-gui executables, so that is probably why they work.
>>
>> Here are the steps to reproduce:
>>
>> 1) cd to existing git repository
>> 2) run 'git gui' (no gui comes up, and the error is printed in the
>> terminal)
>>
>> I'm running on a RHEL6 based system. Do I have an insufficient version
>> of whatever git gui uses for graphics in the later versions of git? When
>> I try 2.12.2 on my personal workstation running Fedora 25, I don't see
>> the same issue.
>>
>> Thank you very much for your time,
>> David
>>
>
> It looks like the git gui needs TCL/TK 8.6.0 or higher. Since that
> version the command 'ttk::style theme use' has been changed, which
> allows the command to be run without an argument and then returning the
> current theme used.
> I believe RHEL6 use Tk-8.5.7 but I can't be 100% sure.
>

Yep, 8.5.7 is what I have on the RHEL6-based system. Thanks for the info! David

-- 
David Shrader
HPC-ENV High Performance Computer Systems
Los Alamos National Lab
Email: dshrader <at> lanl.gov
Jessie Hernandez· Mar 31, 2017, 06:44 UTC · re: David Shrader · lore

Re: ttk error when starting git gui

Show 39 quoted lines
> Hello,
>
> I get the following error when trying to start git gui:
>
> Error in startup script: wrong # args: should be "ttk::style theme use
> theme"
>      while executing
> "ttk::style theme use"
>      (procedure "ttext" line 4)
>      invoked from within
> "ttext $ui_workdir -background white -foreground black \
>          -borderwidth 0 \
>          -width 20 -height 10 \
>          -wrap none \
>          -takefocus 1 -highlightthickness 1\
>          ..."
>      (file
> "/home/dshrader/opt/toss2/common/git/2.12.2/libexec/git-core/git-gui"
> line 3190)
>
> I get this error with the latest released version 2.12.2. Two older git
> versions are also available on this system, and neither has this issue.
> Those older versions are 1.7.1 and 2.3.3. I don't see a call to ttext in
> those corresponding git-gui executables, so that is probably why they
> work.
>
> Here are the steps to reproduce:
>
> 1) cd to existing git repository
> 2) run 'git gui' (no gui comes up, and the error is printed in the
> terminal)
>
> I'm running on a RHEL6 based system. Do I have an insufficient version
> of whatever git gui uses for graphics in the later versions of git? When
> I try 2.12.2 on my personal workstation running Fedora 25, I don't see
> the same issue.
>
> Thank you very much for your time,
> David
Hi David,

I also got this problem when I wanted to build and run git 2.10.x. I have added the following change to git-gui/git-gui.sh

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 5bc21b878..5ce59ef94 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -894,7 +894,7 @@ set default_config(gui.fontui) [font configure font_ui]
 set default_config(gui.fontdiff) [font configure font_diff]
 # TODO: this option should be added to the git-config documentation
 set default_config(gui.maxfilesdisplayed) 5000
-set default_config(gui.usettk) 1
+set default_config(gui.usettk) 0
 set default_config(gui.warndetachedcommit) 1
 set default_config(gui.tabsize) 8
 set font_descs {


If you guys want I can submit it as a patch.
But i assume that 'fixing' this by disabling the feature is not really
what we want.

-----------------
Jessie Hernandez


> --
> David Shrader
> HPC-ENV High Performance Computer Systems
> Los Alamos National Lab
> Email: dshrader <at> lanl.gov
>
>
Konstantin Khomoutov· Mar 31, 2017, 07:33 UTC · re: Jessie Hernandez · lore

Re: ttk error when starting git gui

On Fri, 31 Mar 2017 08:44:27 +0200 "Jessie Hernandez" <git@jessiehernandez.com> wrote:

[...]
Show 21 quoted lines
> I also got this problem when I wanted to build and run git 2.10.x.
> I have added the following change to git-gui/git-gui.sh
> 
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 5bc21b878..5ce59ef94 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -894,7 +894,7 @@ set default_config(gui.fontui) [font configure
> font_ui] set default_config(gui.fontdiff) [font configure font_diff]
>  # TODO: this option should be added to the git-config documentation
>  set default_config(gui.maxfilesdisplayed) 5000
> -set default_config(gui.usettk) 1
> +set default_config(gui.usettk) 0
>  set default_config(gui.warndetachedcommit) 1
>  set default_config(gui.tabsize) 8
>  set font_descs {
> 
> 
> If you guys want I can submit it as a patch.
> But i assume that 'fixing' this by disabling the feature is not really
> what we want.

It's possible to have ttk with 8.5 as well (say, here on Debian 8.5 ships with ttk enabled).

A proper patch would be 

-set default_config(gui.usettk) 1 +set default_config(gui.usettk) [namespace exists ::ttk]

Could you please test it on your system?
Jessie Hernandez· Mar 31, 2017, 07:45 UTC · re: Konstantin Khomoutov · lore

Re: ttk error when starting git gui

Show 36 quoted lines
> On Fri, 31 Mar 2017 08:44:27 +0200
> "Jessie Hernandez" <git@jessiehernandez.com> wrote:
>
> [...]
>> I also got this problem when I wanted to build and run git 2.10.x.
>> I have added the following change to git-gui/git-gui.sh
>>
>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>> index 5bc21b878..5ce59ef94 100755
>> --- a/git-gui/git-gui.sh
>> +++ b/git-gui/git-gui.sh
>> @@ -894,7 +894,7 @@ set default_config(gui.fontui) [font configure
>> font_ui] set default_config(gui.fontdiff) [font configure font_diff]
>>  # TODO: this option should be added to the git-config documentation
>>  set default_config(gui.maxfilesdisplayed) 5000
>> -set default_config(gui.usettk) 1
>> +set default_config(gui.usettk) 0
>>  set default_config(gui.warndetachedcommit) 1
>>  set default_config(gui.tabsize) 8
>>  set font_descs {
>>
>>
>> If you guys want I can submit it as a patch.
>> But i assume that 'fixing' this by disabling the feature is not really
>> what we want.
>
> It's possible to have ttk with 8.5 as well (say, here on Debian 8.5
> ships with ttk enabled).
>
> A proper patch would be
>
> -set default_config(gui.usettk) 1
> +set default_config(gui.usettk) [namespace exists ::ttk]
>
> Could you please test it on your system?
>

Yeah that seems to work. Thanks for this.

I have tried it with git 2.12.2
Jessie Hernandez
Jessie Hernandez· Mar 31, 2017, 07:53 UTC · re: Jessie Hernandez · lore

Re: ttk error when starting git gui

Show 44 quoted lines
>> On Fri, 31 Mar 2017 08:44:27 +0200
>> "Jessie Hernandez" <git@jessiehernandez.com> wrote:
>>
>> [...]
>>> I also got this problem when I wanted to build and run git 2.10.x.
>>> I have added the following change to git-gui/git-gui.sh
>>>
>>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>>> index 5bc21b878..5ce59ef94 100755
>>> --- a/git-gui/git-gui.sh
>>> +++ b/git-gui/git-gui.sh
>>> @@ -894,7 +894,7 @@ set default_config(gui.fontui) [font configure
>>> font_ui] set default_config(gui.fontdiff) [font configure font_diff]
>>>  # TODO: this option should be added to the git-config documentation
>>>  set default_config(gui.maxfilesdisplayed) 5000
>>> -set default_config(gui.usettk) 1
>>> +set default_config(gui.usettk) 0
>>>  set default_config(gui.warndetachedcommit) 1
>>>  set default_config(gui.tabsize) 8
>>>  set font_descs {
>>>
>>>
>>> If you guys want I can submit it as a patch.
>>> But i assume that 'fixing' this by disabling the feature is not really
>>> what we want.
>>
>> It's possible to have ttk with 8.5 as well (say, here on Debian 8.5
>> ships with ttk enabled).
>>
>> A proper patch would be
>>
>> -set default_config(gui.usettk) 1
>> +set default_config(gui.usettk) [namespace exists ::ttk]
>>
>> Could you please test it on your system?
>>
>
> Yeah that seems to work.
> Thanks for this.
>
> I have tried it with git 2.12.2
>
> Jessie Hernandez
>
Hi Konstantin,

I spoke to soon. :( It does not work. I forgot to do a install when testing. Sorry for the confusion.

Konstantin Khomoutov· Mar 31, 2017, 07:58 UTC · re: Jessie Hernandez · lore

Re: ttk error when starting git gui

On Fri, 31 Mar 2017 09:53:38 +0200 "Jessie Hernandez" <git@jessiehernandez.com> wrote:

[...]
Show 15 quoted lines
> >> It's possible to have ttk with 8.5 as well (say, here on Debian 8.5
> >> ships with ttk enabled).
> >>
> >> A proper patch would be
> >>
> >> -set default_config(gui.usettk) 1
> >> +set default_config(gui.usettk) [namespace exists ::ttk]
> >>
> >> Could you please test it on your system?
> >>
> >
> > Yeah that seems to work.
> > Thanks for this.
> >
> > I have tried it with git 2.12.2
[...]
> I spoke to soon. :(
> It does not work. I forgot to do a install when testing.
> Sorry for the confusion.
Care to elaborate on the exact error, please?
Jessie Hernandez· Mar 31, 2017, 11:29 UTC · re: Konstantin Khomoutov · lore

Re: ttk error when starting git gui

Show 26 quoted lines
> On Fri, 31 Mar 2017 09:53:38 +0200
> "Jessie Hernandez" <git@jessiehernandez.com> wrote:
>
> [...]
>> >> It's possible to have ttk with 8.5 as well (say, here on Debian 8.5
>> >> ships with ttk enabled).
>> >>
>> >> A proper patch would be
>> >>
>> >> -set default_config(gui.usettk) 1
>> >> +set default_config(gui.usettk) [namespace exists ::ttk]
>> >>
>> >> Could you please test it on your system?
>> >>
>> >
>> > Yeah that seems to work.
>> > Thanks for this.
>> >
>> > I have tried it with git 2.12.2
> [...]
>> I spoke to soon. :(
>> It does not work. I forgot to do a install when testing.
>> Sorry for the confusion.
>
> Care to elaborate on the exact error, please?
>
The error I get is the following
Error in startup script: wrong # args: should be "ttk::style theme use theme"
    while executing
"ttk::style theme use"
    (procedure "ttext" line 4)
    invoked from within
"ttext $ui_workdir -background white -foreground black \
	-borderwidth 0 \
	-width 20 -height 10 \
	-wrap none \
	-takefocus 1 -highlightthickness 1\
	..."
    (file "/usr/libexec/git-core/git-gui" line 3190)
Konstantin Khomoutov· Mar 31, 2017, 14:34 UTC · re: Jessie Hernandez · lore

Re: ttk error when starting git gui

On Fri, 31 Mar 2017 13:29:04 +0200 "Jessie Hernandez" <git@jessiehernandez.com> wrote:

Show 41 quoted lines
> > On Fri, 31 Mar 2017 09:53:38 +0200
> > "Jessie Hernandez" <git@jessiehernandez.com> wrote:
> >
> > [...]
> >> >> It's possible to have ttk with 8.5 as well (say, here on Debian
> >> >> 8.5 ships with ttk enabled).
> >> >>
> >> >> A proper patch would be
> >> >>
> >> >> -set default_config(gui.usettk) 1
> >> >> +set default_config(gui.usettk) [namespace exists ::ttk]
> >> >>
> >> >> Could you please test it on your system?
> >> >>
> >> >
> >> > Yeah that seems to work.
> >> > Thanks for this.
> >> >
> >> > I have tried it with git 2.12.2
> > [...]
> >> I spoke to soon. :(
> >> It does not work. I forgot to do a install when testing.
> >> Sorry for the confusion.
> >
> > Care to elaborate on the exact error, please?
> >
> 
> The error I get is the following
> 
> Error in startup script: wrong # args: should be "ttk::style theme
> use theme" while executing
> "ttk::style theme use"
>     (procedure "ttext" line 4)
>     invoked from within
> "ttext $ui_workdir -background white -foreground black \
> 	-borderwidth 0 \
> 	-width 20 -height 10 \
> 	-wrap none \
> 	-takefocus 1 -highlightthickness 1\
> 	..."
>     (file "/usr/libexec/git-core/git-gui" line 3190)

Too bad: the git-gui relies on the [ttk::style theme use] command -- that is, the two-argument invocation of [ttk::style] -- to return the theme being currently in use, and this feature was implemented on 2008-05-27 [1] by Pat Thoyts.

Judging from the output of
  fossil descendants e83b7dd29ddae998f96538584afb518849ac1e2c
the first Tk release to have this change was 8.6b2.
So the proper fix appears to be more involved:
 set default_config(gui.usettk) \
   [expr {[package vcompare [info patchlevel] 8.6b2] >= 0}]

(The slash+newline sequence is not needed -- it's here mostly for pretty-printing.)

1. http://core.tcl.tk/tk/info/e83b7dd29ddae998
Konstantin Khomoutov· Mar 31, 2017, 07:56 UTC · re: Jessie Hernandez · lore

Re: ttk error when starting git gui

On Fri, 31 Mar 2017 09:45:03 +0200 "Jessie Hernandez" <git@jessiehernandez.com> wrote:

Show 38 quoted lines
> >> I also got this problem when I wanted to build and run git 2.10.x.
> >> I have added the following change to git-gui/git-gui.sh
> >>
> >> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> >> index 5bc21b878..5ce59ef94 100755
> >> --- a/git-gui/git-gui.sh
> >> +++ b/git-gui/git-gui.sh
> >> @@ -894,7 +894,7 @@ set default_config(gui.fontui) [font configure
> >> font_ui] set default_config(gui.fontdiff) [font configure
> >> font_diff]
> >>  # TODO: this option should be added to the git-config
> >>  # documentation
> >>  set default_config(gui.maxfilesdisplayed) 5000
> >> -set default_config(gui.usettk) 1
> >> +set default_config(gui.usettk) 0
> >>  set default_config(gui.warndetachedcommit) 1
> >>  set default_config(gui.tabsize) 8
> >>  set font_descs {
> >>
> >> If you guys want I can submit it as a patch.
> >> But i assume that 'fixing' this by disabling the feature is not
> >> really what we want.
> >
> > It's possible to have ttk with 8.5 as well (say, here on Debian 8.5
> > ships with ttk enabled).
> >
> > A proper patch would be
> >
> > -set default_config(gui.usettk) 1
> > +set default_config(gui.usettk) [namespace exists ::ttk]
> >
> > Could you please test it on your system?
> >
> 
> Yeah that seems to work.
> Thanks for this.
> 
> I have tried it with git 2.12.2
Please consider re-posting this as a proper patch, then. ;-)

← back to recent threads