# ttk error when starting git gui

12 messages from 2017-03-30 to 2017-03-31. Participants: David Shrader, Peter van der Does, Dennis Kaarsemaker, Jessie Hernandez, Konstantin Khomoutov.
Thread: https://gitlist.dev/t/45550

## David Shrader, 2017-03-30 17:01

Subject: ttk error when starting git gui
Message-ID: <0fc69c73-73aa-5355-264b-a7c55377eec2@lanl.gov>
URL: https://gitlist.dev/e/0fc69c73-73aa-5355-264b-a7c55377eec2%40lanl.gov

```
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, 2017-03-30 19:54

Subject: Re: ttk error when starting git gui
Message-ID: <4addfbdb-1289-7958-87e5-8d8caa9febfb@avirtualhome.com>
URL: https://gitlist.dev/e/4addfbdb-1289-7958-87e5-8d8caa9febfb%40avirtualhome.com
In-Reply-To: <0fc69c73-73aa-5355-264b-a7c55377eec2@lanl.gov>

```
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.

-- 
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, 2017-03-30 20:44

Subject: Re: ttk error when starting git gui
Message-ID: <1490906641.2546.1.camel@kaarsemaker.net>
URL: https://gitlist.dev/e/1490906641.2546.1.camel%40kaarsemaker.net
In-Reply-To: <4addfbdb-1289-7958-87e5-8d8caa9febfb@avirtualhome.com>

```
On Thu, 2017-03-30 at 15:54 -0400, Peter van der Does wrote:

> 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, 2017-03-30 21:33

Subject: Re: ttk error when starting git gui
Message-ID: <c4e7185d-cef9-ce1b-a944-e92e0d17249c@lanl.gov>
URL: https://gitlist.dev/e/c4e7185d-cef9-ce1b-a944-e92e0d17249c%40lanl.gov
In-Reply-To: <4addfbdb-1289-7958-87e5-8d8caa9febfb@avirtualhome.com>

```


On 03/30/2017 01:54 PM, Peter van der Does wrote:
> 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, 2017-03-31 06:44

Subject: Re: ttk error when starting git gui
Message-ID: <916067befdc828e5d33dd3c1817989e7.squirrel@mail.jessiehernandez.com>
URL: https://gitlist.dev/e/916067befdc828e5d33dd3c1817989e7.squirrel%40mail.jessiehernandez.com
In-Reply-To: <0fc69c73-73aa-5355-264b-a7c55377eec2@lanl.gov>

```
> 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, 2017-03-31 07:33

Subject: Re: ttk error when starting git gui
Message-ID: <20170331103330.5d7c414b6a0273cefb8508f2@domain007.com>
URL: https://gitlist.dev/e/20170331103330.5d7c414b6a0273cefb8508f2%40domain007.com
In-Reply-To: <916067befdc828e5d33dd3c1817989e7.squirrel@mail.jessiehernandez.com>

```
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?

```

## Jessie Hernandez, 2017-03-31 07:45

Subject: Re: ttk error when starting git gui
Message-ID: <ff7628d7c69ecd3d212b29fec33f6ba1.squirrel@mail.jessiehernandez.com>
URL: https://gitlist.dev/e/ff7628d7c69ecd3d212b29fec33f6ba1.squirrel%40mail.jessiehernandez.com
In-Reply-To: <20170331103330.5d7c414b6a0273cefb8508f2@domain007.com>

```
> 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, 2017-03-31 07:53

Subject: Re: ttk error when starting git gui
Message-ID: <7447cca107bbc922877f8b80e9f3d934.squirrel@mail.jessiehernandez.com>
URL: https://gitlist.dev/e/7447cca107bbc922877f8b80e9f3d934.squirrel%40mail.jessiehernandez.com
In-Reply-To: <ff7628d7c69ecd3d212b29fec33f6ba1.squirrel@mail.jessiehernandez.com>

```
>> 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, 2017-03-31 07:56

Subject: Re: ttk error when starting git gui
Message-ID: <20170331105614.15746aadd7c3a51e1fda65b3@domain007.com>
URL: https://gitlist.dev/e/20170331105614.15746aadd7c3a51e1fda65b3%40domain007.com
In-Reply-To: <ff7628d7c69ecd3d212b29fec33f6ba1.squirrel@mail.jessiehernandez.com>

```
On Fri, 31 Mar 2017 09:45:03 +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

Please consider re-posting this as a proper patch, then. ;-)

```

## Konstantin Khomoutov, 2017-03-31 07:58

Subject: Re: ttk error when starting git gui
Message-ID: <20170331105803.814cef2ce06b9171901206f4@domain007.com>
URL: https://gitlist.dev/e/20170331105803.814cef2ce06b9171901206f4%40domain007.com
In-Reply-To: <7447cca107bbc922877f8b80e9f3d934.squirrel@mail.jessiehernandez.com>

```
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?

```

## Jessie Hernandez, 2017-03-31 11:29

Subject: Re: ttk error when starting git gui
Message-ID: <2db3bf6de4e169f0c116ba77b74998b4.squirrel@mail.jessiehernandez.com>
URL: https://gitlist.dev/e/2db3bf6de4e169f0c116ba77b74998b4.squirrel%40mail.jessiehernandez.com
In-Reply-To: <20170331105803.814cef2ce06b9171901206f4@domain007.com>

```
> 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, 2017-03-31 14:34

Subject: Re: ttk error when starting git gui
Message-ID: <20170331173435.c822389c9fc7ebe15c20ed00@domain007.com>
URL: https://gitlist.dev/e/20170331173435.c822389c9fc7ebe15c20ed00%40domain007.com
In-Reply-To: <2db3bf6de4e169f0c116ba77b74998b4.squirrel@mail.jessiehernandez.com>

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

> > 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

```
