git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GIT GUI PATCH 1/2] git-gui: teach _which procedure to work with absolute paths

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Mar 25, 2012, 17:09 UTC
Message-ID
<20120325170947.GD38866@book.hvoigt.net>
In-Reply-To
<7v8virt8qw.fsf@alter.siamese.dyndns.org>
Hi,
On Fri, Mar 23, 2012 at 12:31:03PM -0700, Junio C Hamano wrote:
Show 22 quoted lines
> Heiko Voigt <hvoigt@hvoigt.net> writes:
> >  git-gui/git-gui.sh |    4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> > index ba4e5c1..35cdee8 100755
> > --- a/git-gui/git-gui.sh
> > +++ b/git-gui/git-gui.sh
> > @@ -429,6 +429,10 @@ proc _git_cmd {name} {
> >  proc _which {what args} {
> >  	global env _search_exe _search_path
> >  
> > +	if {[file exists $what]} {
> > +		return [file normalize $what]
> > +	}
> 
> Has $what been verified that it is either an absolute path, or contains a
> directory separator, at this point in the code?
> 
> Otherwise, "_which Makefile" would say "Yeah, that is the one I will
> launch" in a directory that has a "Makefile" even when the user does not
> have "." in his $PATH, no?

Thats a good point. Will add something for that if we have another iteration which depends on Berts patch which seems to try to achieve the same goal as this series.

Cheers Heiko
Previous: Junio C HamanoNext: Heiko Voigt
Message 4 of 8 in “teach git gui to open the configured editor”
  1. 0/2 teach git gui to open the configured editorHeiko Voigt, Mar 23, 2012
  2. 1/2 git-gui: teach _which procedure to work with absolute pathsHeiko Voigt, Mar 23, 2012
  3. Junio C HamanoMar 23, 2012
  4. Heiko VoigtMar 25, 2012
  5. 2/2 git-gui: add "open in editor" diff context menu entryHeiko Voigt, Mar 23, 2012
  6. Bert WesargMar 23, 2012
  7. Heiko VoigtMar 25, 2012
  8. Bert WesargMar 25, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.