1

Today gitk stopped working. When I try to run it (with or without --all), it says this:

Error in startup script

can't read "git_version": no such variable
    while executing
"package vcompare $git_version "1.6.6.2""
    invoked from within
"if {[package vcompare $git_version "1.6.6.2"] >= 0} {
    set show_notes "--show-notes"
}"
    (file "C:\Program Files (x86)\Git\bin\gitk" line 12225)

This started when working with a repository where I couldn't fetch commits (from BitBucket) due to what appeared to be a corrupted object. But I was able to clone the repository again, and now I have that commit and others after it.

I'm not certain that's related, though, because gitk has the problem above in any repository.

How can I fix this?

Things I've tried:

  • Uninstall and reinstall Git. (Both with and without wiping out settings completely.)
  • Hacking at the Tcl script in gitk, changing all the version checks to if {1} and changing one version check line to a hard-coded:

    regexp {^git version ([\d.]*\d)} "1.9.5" _ git_version

    After doing that, I can get gitk to run, but there's no commit history; it just says "No commits selected".

  • Getting the very latest version of gitk and copying it over my existing gitk. Exact error message (except the line number, but it's the same actual line of code).

  • I don't usually use Git GUI, but if I try it (git gui), it fails with a similar message:

    git-gui: fatal error

    Cannot parse Git version string:

  • But if I do a regular git version, I get:

    git version 1.9.5.msysgit.1

Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
  • Are you sure that your hard drive is OK if you first encounter a corrupted object and then find some application not working? – martin Mar 24 '15 at 18:47
  • @martin, well, I haven't encountered any other anomalies. And it's not clear that the two problems are related. And I can get gitk to *run* with the hacks noted above; it just doesn't do anything useful then. Granted, my work computer *is* absolute garbage, but in four years of working with Git I've never seen this kind of problem. – Ryan Lundy Mar 24 '15 at 18:51

1 Answers1

0

It appears that these problems resulted from a change of my user directory, owing to some Active-Directory-related changes on my work network.

If you run into similar problems, see whether your user directory has moved around or become inaccessible, preventing Git from accessing global settings.

Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211