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

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

From
Johannes Sixt <j6t@kdbg.org>
Date
Jul 31, 2025, 17:47 UTC
Message-ID
<c5f382d0-7a65-410a-bfee-ea3829a01087@kdbg.org>
In-Reply-To
<20250731080628.27917-6-carenas@gmail.com>
Am 31.07.25 um 10:06 schrieb Carlo Marcelo Arenas Belón:
Show 31 quoted lines
> When finding a location for the askpass helper, git will be asked
> for its exec path, but if that git is not the same that called
> git-gui then we might mistakenly point to its helper instead.
> 
> Assume that git-gui and the helper are colocated to derive its
> path instead.
> 
> This is specially useful in macOS where a broken version of that
> helper is provided by the system git.
> 
> Suggested-by: Mark Levedahl <mlevedahl@gmail.com>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  git-gui.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/git-gui.sh b/git-gui.sh
> index 8bb121d..78324db 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -1114,7 +1114,9 @@ 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 [file dirname [file normalize $::argv0]] \
> +			git-gui--askpass]
>  }
>  
>  ######################################################################
FYI, in my integration branch, this area looks like so without this change:
# 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]
}
if {![info exists env(GIT_ASKPASS)]} {
	set env(GIT_ASKPASS) [file join [git --exec-path] git-gui--askpass]
}
if {![info exists env(GIT_ASK_YESNO)]} {
	set env(GIT_ASK_YESNO) [file join [git --exec-path] git-gui--askyesno]
}

To help these other cases, I'll squash the following into this commit:

diff --git a/git-gui.sh b/git-gui.sh
index 78324db2b587..f28a23f844cf 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1113,11 +1113,11 @@ citool {
 ## execution environment
 
 # Suggest our implementation of askpass, if none is set
+set argv0dir [file dirname [file normalize $::argv0]]
 if {![info exists env(SSH_ASKPASS)]} {
-	set env(SSH_ASKPASS) \
-		[file join [file dirname [file normalize $::argv0]] \
-			git-gui--askpass]
+	set env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]
 }
+unset argv0dir
 
 ######################################################################
 ##
Previous: Carlo Marcelo Arenas Belón
Message 25 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.