tags:

views:

225

answers:

2

I get the following error message when I try to start the Git GUI:

Error in Wish

Can't find a usable init.tcl in the following directories: ... [list of directories follows, init.tcl is in the first one listed]

This probably means that Tcl wasn't installed properly.

I'm running Windows 7 and I'm sure this problem is related to that, but I don't know where to start. I can, and most often will, use the Bash tool, but it annoys me that this doesn't work.

I installed the msysgit package: Git-1.7.0.2-preview20100309.exe

+1  A: 

It was reported in issue 121 as an "issue with TCL and NTFS junction points, and not Git on Windows."
(junction point = symlink for local directories on Windows)

You will find in issue 301 various test to make in order to reinstall msysgit (or TCL only), to see if the problem persists.

Rather than delete a number of programs to try ensure a specific version of Tcl/Tk you can instead just modify the git.cmd batch script and feed it a specific executable path.
For instance, if you download a tclkit executable (a standalone single-file Tcl/Tk executable) you can modify the last line in git.cmd (in the Program Files\Git\cmd folder) so that it looks like:

:gui
@if "%2"=="citool" @goto default
@start c:\opt\bin\tclkit.exe "%git_install_root%\libexec\git-core\git-gui" -- %2 %3
%4 %5 %6 %7 %8 %9

Tclkit will absolutely not look outside itself for any tcl/tk related files.
It is a Tcl and Tk runtime with a virtual filesystem bound onto the executable and it will only look inside this virtual filesystem for files needed by the runtime.
I use this approach to test tcl 8.6 versions with git-gui and gitk. This also makes it easier to check different versions of Tcl/Tk to see if your issue is related to a particular release.
Likewise you can install ActiveTcl and provide the path to the ActiveTcl wish.exe file.
The other thing you could try is to edit the libexec/git-core/git-gui.tcl script and add the following line near the top (maybe after the 'evil concept' comment:

console show

This will cause the Tk console to be shown and you can enter commands into this while git-gui is running. You can then use the introspection commands (info, winfo, wm and bind) to look at the state of the system.
If I was to try and prevent minimization I think I'd have to hook up the Visibility event. We can check what events are bound using 'bind .' which returns a list of all the bound events for the main window.
Nothing suspicious on my version (<Configure>,<Map> and <Visibility> would be suspicious IMO).

VonC
Thanks so much. I will have a good look at this when I get home this evening!
Leslie
+1  A: 

I have the same problem (win7 prof. 32bit) and just found out that everything runs as it should, as soon as I try running gitk as administrator.

Edit: it also helps to change permissions for git/bin/wish.exe to "always run as administrator", though it'll then ask for administrator credentials any time I run gitk.

klickreflex
Thanks! This makes sense and fits with another similar experience I had with another program. I just didn't connect the dots.
Leslie