Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

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

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:45:04

"Murphy, John" [off-list ref] wrote:
I have rebuilt git-gui with version 0.10.2.18.gc629 it is still not finding gitk.
I have done some debugging in proc _which
I have found the issue is with the following line:

set p [file join $p $what$_search_exe]

The variable $p = gitk.exe

And there is no such animal

When I copy gitk to gitk.exe in /usr/local/git/bin, it works fine.

So, not sure if this is a git issue or a git-gui issue.
Since you are new to the list, I will politely point out we do
not top-post.  (http://www.html-faq.com/etiquette/?toppost) and
much prefer inline posting.  (Yea, I know, its Outlook.  Switch to
text only message format and then edit inline in the reply.)

This is definately a git-gui bug.  _which should search not just
.exe extensions, but also the base name itself in case it is a
shell script or perl script.  git-gui already has special cases
to handle executing those through their interpreters even on a
pure Win32 Tcl/Tk process.

Its wrong to install gitk as gitk.exe, it is not a Win32 executable
process and the Windows kernel cannot load it into memory on its own.

 
quoted hunk ↗ jump to hunk
From: spearce@spearce.org [mailto:spearce@spearce.org] 
Abhijit Menon-Sen [off-list ref] wrote:
quoted
At 2008-07-24 09:01:48 -0400, john.murphy@bankofamerica.com wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help