Subject: Re: [PATCH] git-gui: Look for gitk in $PATH, not $LIBEXEC/git-core

From: "Shawn O. Pearce" <[email-masked]>
Date: Fri, 25 Jul 2008 17:05:44 -0500

Abhijit Menon-Sen <[email-masked]> wrote:
> At 2008-07-24 09:01:48 -0400, [email-masked] wrote:
> >
> > I presume this was just an oversight when git- commands were removed
> > from the bin directory.
> 
> Looks like it. The following patch fixes it for me. Does it work for
> you on Windows?

Thanks.

This patch is obviously correct on any platform except Mac OS X.
On Mac OS X it gets confusing because [info nameofexecutable] is
a wrapper .app which loads its own main script.  That main script
needs to use the gitk location it receives from git-gui, and not
the location it computes from gitexecdir.  So I'm following up
your patch with this:

diff --git a/macosx/AppMain.tcl b/macosx/AppMain.tcl
index 41ca08e..ddbe633 100644
--- a/macosx/AppMain.tcl
+++ b/macosx/AppMain.tcl
@@ -7,7 +7,7 @@ if {[string first -psn [lindex $argv 0]] == 0} {
 }
 
 if {[file tail [lindex $argv 0]] eq {gitk}} {
-	set argv0 [file join $gitexecdir gitk]
+	set argv0 [lindex $argv 0]
 	set AppMain_source $argv0
 } else {
 	set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]]
 
-- 
Shawn.