iEFdev

Code, Computers & Random Junk

Git and “gitk” in OS X

gitk is the bundled git browser. In OS X it might throw an error when starting up. I’ve seen this before when I was creating a couple of alert/dialogs (for fun). It’s an error from an old(er) Adobe Type Unit program that is 32-bit. This program is installed if/when you install Adobe CS3 or CS4.

So, when you want to start gitk, it looks like this:

Terminal output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(master) [me@myhost] somerepodir$ gitk
Error in startup script: 2015-01-01 12:34:56.789 osascript[12345:1234] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:
  /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.
    while executing
"exec osascript -e [format {
        tell application "System Events"
            set frontmost of processes whose unix id is %d to true
        end te..."
    invoked from within
"if {[tk windowingsystem] eq "aqua"} {
    exec osascript -e [format {
        tell application "System Events"
            set frontmost of processes ..."
    (file "/usr/local/git/bin/gitk" line 11925)

Solution(s)

One can solve this in 2 ways… Either install another version of Adobe Type Unit, or edit the gitk file.

Upating

There is a page over at Adobe describing the issue, and they also provide a download for a new file.

Unpack it and then:

1
2
3
4
5
6
cd /Library/ScriptingAdditions

# backup the original file
sudo cp -r Adobe\ Unit\ Types.osax{,.bak}

sudo cp -r /Path/to/your/new/Adobe\ Unit\ Types.osax .

Editing “gitk”

The other way is to edit the file it self.

  • Open the file: /usr/local/git/bin/gitk.
  • at line ~ 11924 you’ll find:
/usr/local/git/bin/gitk @ ~ line 11924
1
2
3
4
5
6
7
8
# on OSX bring the current Wish process window to front
if {[tk windowingsystem] eq "aqua"} {
    exec osascript -e [format {
        tell application "System Events"
            set frontmost of processes whose unix id is %d to true
        end tell
    } [pid] ]
}

Add: arch -i386, and the Wish.app (gitk) starts fine.

/usr/local/git/bin/gitk @ ~ line 11924
1
2
3
4
5
6
7
8
# on OSX bring the current Wish process window to front
if {[tk windowingsystem] eq "aqua"} {
    exec arch -i386 osascript -e [format {
        tell application "System Events"
            set frontmost of processes whose unix id is %d to true
        end tell
    } [pid] ]
}

git-gui

Another problem I’ve had is with the Git-gui. It didn’t start. But I managed to get around that on by using another version of wish. The error message recieved is: error: git-gui died of signal 11.

If you get the same problem, try symlinking another version in.

In my case I did this:

1
2
3
4
5
6
cd /usr/local/git/share/git-gui/lib/Git\ Gui.app/Contents/MacOS/

# backup
sudo cp Wish{,.orig}

sudo ln -sf Library/Frameworks/Tk.framework/Versions/8.5/Resources/Wish.app/Contents/MacOS/Wish .

At least it starts now. Not that I use it, but it’s nice to get things to work.


If you don’t have Tcl/Tk you can get it from ActiveState.

Comments