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

Re: [PATCH 5/5] git-gui: ensure own version of git-gui--askpass is used

From
Johannes Sixt <j6t@kdbg.org>
Date
Jul 30, 2025, 19:04 UTC
Message-ID
<ce964e5a-fe30-42da-bf8d-969893e3907f@kdbg.org>
In-Reply-To
<20250730164052.15371-6-carenas@gmail.com>
Am 30.07.25 um 18:40 schrieb Carlo Marcelo Arenas Belón:
Show 8 quoted lines
> Propagate the `git --exec-path` that is defined at build time
> and use it when defining which askpass helper to use by default.
> 
> This is specially useful in macOS where a broken version of that
> helper is provided by the system git.
> 
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---

This patch breaks Git GUI on builds with RUNTIME_PREFIX, I think, because it hard-codes the path to some exec-path that might not exist during runtime.

Show 35 quoted lines
>  generate-git-gui.sh |  1 +
>  git-gui.sh          | 10 +++++++++-
>  lib/about.tcl       |  4 ++--
>  3 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/generate-git-gui.sh b/generate-git-gui.sh
> index 39dfafd..f804686 100755
> --- a/generate-git-gui.sh
> +++ b/generate-git-gui.sh
> @@ -22,6 +22,7 @@ sed \
>  	-e "s|@@SHELL_PATH@@|$SHELL_PATH|" \
>  	-e "1,30s|^ exec wish | exec '$TCLTK_PATH' |" \
>  	-e "s|@@GITGUI_VERSION@@|$GITGUI_VERSION|g" \
> +	-e "s|@@GITGUI_GITEXECDIR@@|$GITGUI_GITEXECDIR|" \
>  	-e "s|@@GITGUI_RELATIVE@@|$GITGUI_RELATIVE|" \
>  	-e "${GITGUI_RELATIVE}s|@@GITGUI_LIBDIR@@|$GITGUI_LIBDIR|" \
>  	"$INPUT" >"$OUTPUT"+
> diff --git a/git-gui.sh b/git-gui.sh
> index 8bb121d..9e6c152 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -364,6 +364,7 @@ set _isbare {}
>  set _githtmldir {}
>  set _reponame {}
>  set _shellpath {@@SHELL_PATH@@}
> +set _gitexecdir {@@GITGUI_GITEXECDIR@@}
>  
>  set _trace [lsearch -exact $argv --trace]
>  if {$_trace >= 0} {
> @@ -387,6 +388,13 @@ if {[string match @@* $_shellpath]} {
>  	}
>  }
>  
> +if {[string match @@* $_gitexecdir]} {
> +	if {[catch {set _gitexecdir [exec git --exec-path]} err]} {

We can't use [git --exec-path] here, because proc git is not defined, yet. Good.

> +		error "Git not installed?\n\n$err"

We barely use 'error'. This is for developers, I would think, so it may be ok-ish. An alternative would be 'puts stderr ...' that we use elsewhere.

We must exit here, but 'error' doesn't do it for us. Insert 'exit 1'.
Show 35 quoted lines
> +	}
> +	set _gitexecdir [file normalize $_gitexecdir]
> +}
> +
>  if {[is_Windows]} {
>  	set _shellpath [safe_exec [list cygpath -m $_shellpath]]
>  }
> @@ -1114,7 +1122,7 @@ citool {
>  
>  # Suggest our implementation of askpass, if none is set
>  if {![info exists env(SSH_ASKPASS)]} {
> -	set env(SSH_ASKPASS) [file join [git --exec-path] git-gui--askpass]
> +	set env(SSH_ASKPASS) [file join $_gitexecdir git-gui--askpass]
>  }
>  
>  ######################################################################
> diff --git a/lib/about.tcl b/lib/about.tcl
> index 122ebfb..d68e23b 100644
> --- a/lib/about.tcl
> +++ b/lib/about.tcl
> @@ -2,7 +2,7 @@
>  # Copyright (C) 2006, 2007 Shawn Pearce
>  
>  proc do_about {} {
> -	global appvers copyright oguilib
> +	global appvers copyright oguilib _gitexecdir
>  	global tcl_patchLevel tk_patchLevel
>  	global ui_comm_spell
>  
> @@ -44,7 +44,7 @@ proc do_about {} {
>  
>  	set d {}
>  	append d "git wrapper: $::_git\n"
> -	append d "git exec dir: [git --exec-path]\n"
> +	append d "git exec dir: $_gitexecdir\n"
Nice touch to change this case as well!
>  	append d "git-gui lib: $oguilib"
>  
>  	paddedlabel $w.vers -text $v
-- Hannes
Previous: Carlo Marcelo Arenas BelónNext: Mark Levedahl
Message 10 of 25 in “git-gui: workaround deprecation of Tcl/TK 8.5 in macOS”
  1. 0/5 git-gui: workaround deprecation of Tcl/TK 8.5 in macOSCarlo Marcelo Arenas Belón, Jul 30, 2025
  2. 1/5 git-gui: remove uname_O in MakefileCarlo Marcelo Arenas Belón, Jul 30, 2025
  3. Junio C HamanoJul 30, 2025
  4. 2/5 git-gui: fix dependency of GITGUI_MAIN on generatorCarlo Marcelo Arenas Belón, Jul 30, 2025
  5. 3/5 git-gui: retire Git Gui.appCarlo Marcelo Arenas Belón, Jul 30, 2025
  6. 4/5 git-gui: honor TCLTK_PATH in git-gui--askpassCarlo Marcelo Arenas Belón, Jul 30, 2025
  7. Johannes SixtJul 30, 2025
  8. Patrick SteinhardtJul 31, 2025
  9. 5/5 git-gui: ensure own version of git-gui--askpass is usedCarlo Marcelo Arenas Belón, Jul 30, 2025
  10. Johannes SixtJul 30, 2025
  11. Mark LevedahlJul 30, 2025
  12. Johannes SixtJul 30, 2025
  13. Carlo ArenasJul 30, 2025
  14. Patrick SteinhardtJul 31, 2025
  15. Junio C HamanoJul 30, 2025
  16. Junio C HamanoJul 30, 2025
  17. Carlo ArenasJul 30, 2025
  18. Junio C HamanoJul 31, 2025
  19. 0/5 git-gui: workaround deprecation of Tcl/Tk 8.5 in macOSCarlo Marcelo Arenas Belón, Jul 31, 2025
  20. 1/5 git-gui: remove uname_O in MakefileCarlo Marcelo Arenas Belón, Jul 31, 2025
  21. 2/5 git-gui: fix dependency of GITGUI_MAIN on generatorCarlo Marcelo Arenas Belón, Jul 31, 2025
  22. 3/5 git-gui: retire Git Gui.appCarlo Marcelo Arenas Belón, Jul 31, 2025
  23. 4/5 git-gui: honor TCLTK_PATH in git-gui--askpassCarlo Marcelo Arenas Belón, Jul 31, 2025
  24. 5/5 git-gui: ensure own version of git-gui--askpass is usedCarlo Marcelo Arenas Belón, Jul 31, 2025
  25. Johannes SixtJul 31, 2025

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.