git-gui: workaround deprecation of Tcl/TK 8.5 in macOS
Subsystems (3)
cover git-gui: workaround deprecation of Tcl/TK 8.5 in macOS
This series, add improvements to allow running git-gui in macOS, which is stuck in an ancient version of Tcl/TK that is no longer supported by git.
Patches 1 and 2 are minor fixes that could also apply to maint, but the main change is in Patch 3, which removes the long obsoleted "Git Gui" app that was tied to the system provided Tcl/TK framework and that has been broken for a while.
Patches 4 and 5 are needed to avoid the system framework and facilitate using a third party provided package of Tcl/TK 8.6 instead, but the last patch also protects against a conflict with the Xcode provided git that for some reason includes a copy pf git-gui--askpass even if git-gui is missing.
Carlo Marcelo Arenas Belón (5):
git-gui: remove uname_O in Makefile
git-gui: fix dependency of GITGUI_MAIN on generator
git-gui: retire Git Gui.app
git-gui: honor TCLTK_PATH in git-gui--askpass
git-gui: ensure own version of git-gui--askpass is used
.gitignore | 2 +- GIT-GUI-BUILD-OPTIONS.in | 1 - Makefile | 63 +++---------------- generate-git-gui.sh | 1 + generate-macos-app.sh | 30 --------- generate-macos-wrapper.sh | 35 ----------- generate-script.sh | 22 +++++++ git-gui--askpass => git-gui--askpass.sh | 0 git-gui.sh | 10 ++- lib/about.tcl | 4 +- macosx/AppMain.tcl | 29 --------- macosx/Info.plist | 30 --------- macosx/git-gui.icns | Bin 28866 -> 0 bytes meson.build | 79 +++++------------------- 14 files changed, 56 insertions(+), 250 deletions(-) delete mode 100755 generate-macos-app.sh delete mode 100755 generate-macos-wrapper.sh create mode 100755 generate-script.sh rename git-gui--askpass => git-gui--askpass.sh (100%) delete mode 100644 macosx/AppMain.tcl delete mode 100644 macosx/Info.plist delete mode 100644 macosx/git-gui.icns
Signature · 1 line
2.50.1.475.g795bb014d8
PATCH 1/5 git-gui: remove uname_O in Makefile
Last used in ae49066 (git gui Makefile - remove Cygwin modifications, 2023-06-26), and unused since.
--- Makefile | 1 - 1 file changed, 1 deletion(-)
Makefile +0 -1
@@ -11,7 +11,6 @@ GIT-VERSION-FILE: FORCE @$(SHELL_PATH) ./GIT-VERSION-GEN . $@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') -uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') SCRIPT_SH = git-gui.sh
Signature · 1 line
2.50.1.475.g795bb014d8
Re: [PATCH 1/5] git-gui: remove uname_O in Makefile
Quoted 7 lines · Carlo Marcelo Arenas Belón
Last used in ae49066 (git gui
Makefile- remove Cygwin modifications, 2023-06-26), and unused since.Signed-off-by Carlo Marcelo Arenas Belón <[email protected]>--- Makefile | 1 - 1 file changed, 1 deletion(-)
An obvious improvement ;-).
Quoted 12 lines
Makefile +0
-1@@ -11,7 +11,6 @@ GIT-VERSION-FILE: FORCE @$(SHELL_PATH) ./GIT-VERSION-GEN . $@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') -uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') SCRIPT_SH = git-gui.sh
PATCH 2/5 git-gui: fix dependency of GITGUI_MAIN on generator
In reply to Carlo Marcelo Arenas BelónSince 854e883 (git-gui: extract script to generate "git-gui", 2025-03-11), the logic to generate the main script was pulled out of the Makefile, but adding the resulting generator as a dependency was missed.
If the logic changes, the main script should be regenerated, so add it as a dependency.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -168,7 +168,7 @@ git-gui: windows/git-gui.sh cp $< $@ endif -$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS +$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS generate-git-gui.sh $(QUIET_GEN)$(SHELL_PATH) generate-git-gui.sh "$<" "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE XGETTEXT ?= xgettext
Signature · 1 line
2.50.1.475.g795bb014d8
PATCH 3/5 git-gui: retire Git Gui.app
In reply to Carlo Marcelo Arenas BelónIn a recent commit, the minimum version of Tcl/Tk was raised to 8.6, but the "app" relies on the system provided Framework that is based on 8.5.
Remove it, and let git-gui use a third party version of Wish if available.
--- .gitignore | 1 - GIT-GUI-BUILD-OPTIONS.in | 1 - Makefile | 51 ---------------------------------- generate-macos-app.sh | 30 -------------------- generate-macos-wrapper.sh | 35 ----------------------- macosx/AppMain.tcl | 29 ------------------- macosx/Info.plist | 30 -------------------- macosx/git-gui.icns | Bin 28866 -> 0 bytes meson.build | 57 -------------------------------------- 9 files changed, 234 deletions(-) delete mode 100755 generate-macos-app.sh delete mode 100755 generate-macos-wrapper.sh delete mode 100644 macosx/AppMain.tcl delete mode 100644 macosx/Info.plist delete mode 100644 macosx/git-gui.icns
.gitignore +0 -1
@@ -1,6 +1,5 @@ .DS_Store config.mak -Git Gui.app* git-gui.tcl GIT-GUI-BUILD-OPTIONS GIT-VERSION-FILE
GIT-GUI-BUILD-OPTIONS.in +0 -1
@@ -4,4 +4,3 @@ GITGUI_RELATIVE=@GITGUI_RELATIVE@ SHELL_PATH=@SHELL_PATH@ TCLTK_PATH=@TCLTK_PATH@ TCL_PATH=@TCL_PATH@ -TKEXECUTABLE=@TKEXECUTABLE@
Makefile +0 -51
113 lines not on this page · raw message
generate-macos-app.sh deleted +0 -30
@@ -1,30 +0,0 @@ -#!/bin/sh - -set -e - -SOURCE_DIR="$1" -OUTPUT="$2" -BUILD_OPTIONS="$3" -VERSION_FILE="$4" - -. "$BUILD_OPTIONS" -. "$VERSION_FILE" - -rm -rf "$OUTPUT" "$OUTPUT+" - -mkdir -p "$OUTPUT+/Contents/MacOS" -mkdir -p "$OUTPUT+/Contents/Resources/Scripts" - -cp "$TKEXECUTABLE" "$OUTPUT+/Contents/MacOS" -cp "$SOURCE_DIR/macosx/git-gui.icns" "$OUTPUT+/Contents/Resources" -sed \ - -e "s/@@GITGUI_VERSION@@/$GITGUI_VERSION/g" \ - -e "s/@@GITGUI_TKEXECUTABLE@@/$(basename "$TKEXECUTABLE")/g" \ - "$SOURCE_DIR/macosx/Info.plist" \ - >"$OUTPUT+/Contents/Info.plist" -sed \ - -e "s|@@gitexecdir@@|$GITGUI_GITEXECDIR|" \ - -e "s|@@GITGUI_LIBDIR@@|$GITGUI_LIBDIR|" \ - "$SOURCE_DIR/macosx/AppMain.tcl" \ - >"$OUTPUT+/Contents/Resources/Scripts/AppMain.tcl" -mv "$OUTPUT+" "$OUTPUT"
generate-macos-wrapper.sh deleted +0 -35
@@ -1,35 +0,0 @@ -#!/bin/sh - -set -e - -if test "$#" -ne 3 -then - echo >&2 "usage: $0 <OUTPUT> <BUILD_OPTIONS> <VERSION_FILE>" - exit 1 -fi - -OUTPUT="$1" -BUILD_OPTIONS="$2" -VERSION_FILE="$3" - -. "$BUILD_OPTIONS" - -rm -f "$OUTPUT" "$OUTPUT+" - -( - echo "#!$SHELL_PATH" - cat "$BUILD_OPTIONS" "$VERSION_FILE" - cat <<-'EOF' - if test "z$*" = zversion || - test "z$*" = z--version - then - echo "git-gui version $GITGUI_VERSION" - else - libdir="${GIT_GUI_LIB_DIR:-$GITGUI_LIBDIR}" - exec "$libdir/Git Gui.app/Contents/MacOS/$(basename "$TKEXECUTABLE")" "$0" "$@" - fi - EOF -) >"$OUTPUT+" - -chmod +x "$OUTPUT+" -mv "$OUTPUT+" "$OUTPUT"
macosx/AppMain.tcl deleted +0 -29
@@ -1,29 +0,0 @@ -set gitexecdir {@@gitexecdir@@} -if { [info exists ::env(GIT_GUI_LIB_DIR) ] } { - set gitguilib $::env(GIT_GUI_LIB_DIR) -} else { - set gitguilib {@@GITGUI_LIBDIR@@} -} - -set env(PATH) "$gitexecdir:$env(PATH)" - -if {[string first -psn [lindex $argv 0]] == 0} { - lset argv 0 [file join $gitexecdir git-gui] -} - -if {[file tail [lindex $argv 0]] eq {gitk}} { - set argv0 [lindex $argv 0] - set AppMain_source $argv0 -} else { - set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]] - set AppMain_source [file join $gitguilib git-gui.tcl] - if {[info exists env(PWD)]} { - cd $env(PWD) - } elseif {[pwd] eq {/}} { - cd $env(HOME) - } -} - -unset gitexecdir gitguilib -set argv [lrange $argv 1 end] -source $AppMain_source
macosx/Info.plist deleted +0 -30
@@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>@@GITGUI_TKEXECUTABLE@@</string> - <key>CFBundleGetInfoString</key> - <string>Git Gui @@GITGUI_VERSION@@ © 2006-2007 Shawn Pearce, et. al.</string> - <key>CFBundleIconFile</key> - <string>git-gui.icns</string> - <key>CFBundleIdentifier</key> - <string>cz.or.repo.git-gui</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>Git Gui</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>@@GITGUI_VERSION@@</string> - <key>CFBundleSignature</key> - <string>GITg</string> - <key>CFBundleVersion</key> - <string>@@GITGUI_VERSION@@</string> - <key>NSHighResolutionCapable</key> - <true/> -</dict> -</plist>
macosx/git-gui.icns deleted binary +0 -0
meson.build +0 -57
69 lines not on this page · raw message
Signature · 1 line
2.50.1.475.g795bb014d8
PATCH 4/5 git-gui: honor TCLTK_PATH in git-gui--askpass
In reply to Carlo Marcelo Arenas BelónSince its introduction in 8c76212 (git-gui: Add a simple implementation of SSH_ASKPASS., 2008-10-15), git-gui--askpass has been calling whatever wish interpreter is in the path, unlike git-gui.
Correct that by turning it into a script that would be processed at build time.
--- .gitignore | 1 + Makefile | 9 ++++++--- generate-script.sh | 22 ++++++++++++++++++++++ git-gui--askpass => git-gui--askpass.sh | 0 meson.build | 22 ++++++++++++++-------- 5 files changed, 43 insertions(+), 11 deletions(-) create mode 100755 generate-script.sh rename git-gui--askpass => git-gui--askpass.sh (100%)
.gitignore +1 -0
@@ -4,4 +4,5 @@ git-gui.tcl GIT-GUI-BUILD-OPTIONS GIT-VERSION-FILE git-gui +git-gui--askpass lib/tclIndex
Makefile +6 -3
@@ -173,10 +173,13 @@ GIT-GUI-BUILD-OPTIONS: FORCE @if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi +git-gui--askpass: git-gui--askpass.sh GIT-GUI-BUILD-OPTIONS generate-script.sh + $(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< GIT-GUI-BUILD-OPTIONS + ifdef GITGUI_WINDOWS_WRAPPER -all:: git-gui +all:: git-gui git-gui--askpass endif -all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES) +all:: $(GITGUI_MAIN) git-gui--askpass lib/tclIndex $(ALL_MSGFILES) install: all $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -215,7 +218,7 @@ dist-version: GIT-VERSION-FILE @sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version clean:: - $(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg $(PO_TEMPLATE) + $(RM_RF) $(GITGUI_MAIN) git-gui--askpass lib/tclIndex po/*.msg $(PO_TEMPLATE) $(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS ifdef GITGUI_WINDOWS_WRAPPER $(RM_RF) git-gui
generate-script.sh new file +22 -0
@@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +if test $# -ne 3 +then + echo >&2 "USAGE: $0 <OUTPUT> <INPUT> <GIT-GUI-BUILD-OPTIONS>" + exit 1 +fi + +OUTPUT="$1" +INPUT="$2" +BUILD_OPTIONS="$3" + +. "$BUILD_OPTIONS" + +sed \ + -e "1s|#!.*/sh|#!$SHELL_PATH|" \ + -e "1,3s|^exec wish|exec '$TCLTK_PATH'|" \ + "$INPUT" >"$OUTPUT" + +chmod a+x "$OUTPUT"
git-gui--askpass.sh renamed from git-gui--askpass +0 -0
meson.build +14 -8
@@ -38,14 +38,6 @@ version_file = custom_target( build_always_stale: true, ) -configure_file( - input: 'git-gui--askpass', - output: 'git-gui--askpass', - copy: true, - install: true, - install_dir: get_option('libexecdir') / 'git-core', -) - gitgui_main = 'git-gui' gitgui_main_install_dir = get_option('libexecdir') / 'git-core'
@@ -61,6 +53,20 @@ if target_machine.system() == 'windows' ) endif +custom_target( + output: 'git-gui--askpass', + input: 'git-gui--askpass.sh', + command: [ + shell, + meson.current_source_dir() / 'generate-script.sh', + '@OUTPUT@', + '@INPUT@', + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', + ], + install: true, + install_dir: get_option('libexecdir') / 'git-core', +) + custom_target( input: 'git-gui.sh', output: gitgui_main,
Signature · 1 line
2.50.1.475.g795bb014d8
Re: [PATCH 4/5] git-gui: honor TCLTK_PATH in git-gui--askpass
Am 30.07.25 um 18:40 schrieb Carlo Marcelo Arenas Belón:
Quoted 35 lines
Since its introduction in 8c76212 (git-gui: Add a simple implementation of
SSH_ASKPASS., 2008-10-15), git-gui--askpass has been calling whatever wish interpreter is in the path, unlike git-gui.Correct that by turning it into a script that would be processed at build time.
Signed-off-by Carlo Marcelo Arenas Belón <[email protected]>--- .gitignore | 1 + Makefile | 9 ++++++--- generate-script.sh | 22 ++++++++++++++++++++++ git-gui--askpass => git-gui--askpass.sh | 0 meson.build | 22 ++++++++++++++-------- 5 files changed, 43 insertions(+), 11 deletions(-) create mode 100755 generate-script.sh rename git-gui--askpass => git-gui--askpass.sh (100%).gitignore +1
-0@@ -4,4 +4,5 @@ git-gui.tcl GIT-GUI-BUILD-OPTIONS GIT-VERSION-FILE git-gui +git-gui--askpass lib/tclIndexMakefile +0
-0@@ -173,10 +173,13 @@ GIT-GUI-BUILD-OPTIONS: FORCE @if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
Makefile GIT-GUI-BUILD-OPTIONS: FORCE · line 182
Quoted 10 lines
Makefile +5
-2+git-gui--askpass: git-gui--askpass.sh GIT-GUI-BUILD-OPTIONS generate-script.sh + $(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< GIT-GUI-BUILD-OPTIONS + ifdef GITGUI_WINDOWS_WRAPPER -all:: git-gui +all:: git-gui git-gui--askpass endif -all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES) +all:: $(GITGUI_MAIN) git-gui--askpass lib/tclIndex $(ALL_MSGFILES)
I'm not a Makefile expert concerning double-colon targets. Therefore, I wonder why do we need git-gui--ask-pass twice on Windows.
Makefile dist-version: GIT-VERSION-FILE · line 224
Quoted 12 lines
Makefile +1
-1install: all $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)@@ -215,7 +218,7 @@ dist-version: GIT-VERSION-FILE @sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version clean:: - $(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg $(PO_TEMPLATE) + $(RM_RF) $(GITGUI_MAIN) git-gui--askpass lib/tclIndex po/*.msg $(PO_TEMPLATE) $(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS ifdef GITGUI_WINDOWS_WRAPPER $(RM_RF) git-gui
Some dependency must be missing here, since my build fails with
git-gui@cb/no-tcl86-on-macos:1015> make GITGUI_VERSION=0.21.0.221.g8045a
GEN git-gui
GEN git-gui--askpassgenerate-script.sh: line 15: .: GIT-GUI-BUILD-OPTIONS: file not found
make: *** [Makefile:177: git-gui--askpass] Error 1
Quoted 62 lines
generate-script.sh new file +22
-0@@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +if test $# -ne 3 +then + echo >&2 "USAGE: $0 <OUTPUT> <INPUT> <GIT-GUI-BUILD-OPTIONS>" + exit 1 +fi + +OUTPUT="$1" +INPUT="$2" +BUILD_OPTIONS="$3" + +. "$BUILD_OPTIONS" + +sed \ + -e "1s|#!.*/sh|#!$SHELL_PATH|" \ + -e "1,3s|^exec wish|exec '$TCLTK_PATH'|" \ + "$INPUT" >"$OUTPUT" + +chmod a+x "$OUTPUT"git-gui--askpass.sh renamed from git-gui--askpass +0
-0meson.build +7
-8@@ -38,14 +38,6 @@ version_file = custom_target( build_always_stale: true, ) -configure_file( - input: 'git-gui--askpass', - output: 'git-gui--askpass', - copy: true, - install: true, - install_dir: get_option('libexecdir') / 'git-core', -) - gitgui_main = 'git-gui' gitgui_main_install_dir = get_option('libexecdir') / 'git-core'@@ -61,6 +53,20 @@ if target_machine.system() == 'windows' ) endif +custom_target( + output: 'git-gui--askpass', + input: 'git-gui--askpass.sh', + command: [ + shell, + meson.current_source_dir() / 'generate-script.sh', + '@OUTPUT@',
meson.build if target_machine.system() == 'windows' · line 72
Quoted 10 lines
meson.build +7
-0+ '@INPUT@', + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', + ], + install: true, + install_dir: get_option('libexecdir') / 'git-core', +) + custom_target( input: 'git-gui.sh', output: gitgui_main,
I can't comment on the meson part at all.
-- Hannes
Re: [PATCH 4/5] git-gui: honor TCLTK_PATH in git-gui--askpass
Quoted 35 lines · Johannes Sixt
Am 30.07.25 um 18:40 schrieb Carlo Marcelo Arenas Belón:
Quoted 34 lines
meson.build +11
-8@@ -38,14 +38,6 @@ version_file = custom_target( build_always_stale: true, ) -configure_file( - input: 'git-gui--askpass', - output: 'git-gui--askpass', - copy: true, - install: true, - install_dir: get_option('libexecdir') / 'git-core', -) - gitgui_main = 'git-gui' gitgui_main_install_dir = get_option('libexecdir') / 'git-core'@@ -61,6 +53,20 @@ if target_machine.system() == 'windows' ) endif +custom_target( + output: 'git-gui--askpass', + input: 'git-gui--askpass.sh', + command: [ + shell, + meson.current_source_dir() / 'generate-script.sh', + '@OUTPUT@', + '@INPUT@', + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', + ], + install: true,
Quoted 8 lines
meson.build if target_machine.system() == 'windows' · line 72
Quoted 6 lines
meson.build +3
-0+ install_dir: get_option('libexecdir') / 'git-core', +) + custom_target( input: 'git-gui.sh', output: gitgui_main,I can't comment on the meson part at all.
The Meson part looks reasonable to me.
Patrick
PATCH 5/5 git-gui: ensure own version of git-gui--askpass is used
In reply to Carlo Marcelo Arenas BelónPropagate 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.
--- generate-git-gui.sh | 1 + git-gui.sh | 10 +++++++++- lib/about.tcl | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-)
generate-git-gui.sh +1 -0
@@ -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"+
git-gui.sh +9 -1
@@ -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]} { + error "Git not installed?\n\n$err" + } + 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] } ######################################################################
lib/about.tcl +2 -2
@@ -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" append d "git-gui lib: $oguilib" paddedlabel $w.vers -text $v
Signature · 1 line
2.50.1.475.g795bb014d8
Re: [PATCH 5/5] git-gui: ensure own version of git-gui--askpass is used
Am 30.07.25 um 18:40 schrieb Carlo Marcelo Arenas Belón:
Quoted 8 lines
Propagate the
git --exec-paththat 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 <[email protected]>---
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.
Quoted 30 lines
generate-git-gui.sh | 1 + git-gui.sh | 10 +++++++++- lib/about.tcl | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-)generate-git-gui.sh +1
-0@@ -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"+git-gui.sh +1
-0@@ -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} {
git-gui.sh if {[string match @@* $_shellpath]} { · line 392
Quoted 5 lines
git-gui.sh +2
-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.
git-gui.sh if {[string match @@* $_shellpath]} { · line 393
Quoted 1 line
git-gui.sh +1
-0+ 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'.
Quoted 30 lines
git-gui.sh +5
-1+ } + 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] } ######################################################################lib/about.tcl +1
-1@@ -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
lib/about.tcl proc do_about {} { · line 47
Quoted 5 lines
lib/about.tcl +1
-1@@ -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!
lib/about.tcl proc do_about {} { · line 50
Quoted 3 lines
lib/about.tcl +0
-0append d "git-gui lib: $oguilib" paddedlabel $w.vers -text $v
-- Hannes
Re: [PATCH 5/5] git-gui: ensure own version of git-gui--askpass is used
Quoted 10 lines · Johannes Sixt
Am 30.07.25 um 18:40 schrieb Carlo Marcelo Arenas Belón:
Quoted 8 lines
Propagate the
git --exec-paththat 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 <[email protected]>---
The expectation is that git-gui--askpass is colocated with git-gui, and not with git. This directory is found at runtime as
[file dirname [file normalize $::argv0]]]
It seems to me we could just put this into git-gui.sh instead of [git --exec-path], and the patch is much simpler.
Mark
Am 30.07.25 um 18:40 schrieb Carlo Marcelo Arenas Belón:
Quoted 7 lines
This series, add improvements to allow running
git-guiin macOS, which is stuck in an ancient version of Tcl/TK that is no longer supported by git.Patches 1 and 2 are minor fixes that could also apply to maint, but the main change is in Patch 3, which removes the long obsoleted "Git Gui" app that was tied to the system provided Tcl/TK framework and that has been broken for a while.
This sounds like the lifted requirement of Tcl 8.6 isn't the cause why this part is broken. But the commit message of patch 3 says it is. Which one is it?
Quoted 5 lines
Patches 4 and 5 are needed to avoid the system framework and facilitate using a third party provided package of Tcl/TK 8.6 instead, but the last patch also protects against a conflict with the Xcode provided git that for some reason includes a copy pf
git-gui--askpasseven ifgit-guiis missing.
Patch 5, I fear, needs a different approach as it breaks RUNTIME_PREFIX builds. I say that after having looked at the patch; I haven't test it.
Any help would be appreciated on the Meson parts and whether the updated git-gui--askpass build still works. I don't use either of them.
Quoted 31 lines
Carlo Marcelo Arenas Belón (5):
git-gui: removeuname_OinMakefile
git-gui: fix dependency ofGITGUI_MAINon generator
git-gui: retire Git Gui.app
git-gui: honorTCLTK_PATHin git-gui--askpass
git-gui: ensure own version of git-gui--askpass is used.gitignore | 2 +- GIT-GUI-BUILD-OPTIONS.in | 1 - Makefile | 63 +++---------------- generate-git-gui.sh | 1 + generate-macos-app.sh | 30 --------- generate-macos-wrapper.sh | 35 ----------- generate-script.sh | 22 +++++++ git-gui--askpass => git-gui--askpass.sh | 0 git-gui.sh | 10 ++- lib/about.tcl | 4 +- macosx/AppMain.tcl | 29 --------- macosx/Info.plist | 30 --------- macosx/git-gui.icns | Bin 28866 -> 0 bytes meson.build | 79 +++++------------------- 14 files changed, 56 insertions(+), 250 deletions(-) delete mode 100755 generate-macos-app.sh delete mode 100755 generate-macos-wrapper.sh create mode 100755 generate-script.sh rename git-gui--askpass => git-gui--askpass.sh (100%) delete mode 100644 macosx/AppMain.tcl delete mode 100644 macosx/Info.plist delete mode 100644 macosx/git-gui.icns
Quoted 1 line
Signed-off-by Carlo Marcelo Arenas Belón <[email protected]>
-- Hannes
Quoted 11 lines · Johannes Sixt
Am 30.07.25 um 18:40 schrieb Carlo Marcelo Arenas Belón:
Quoted 5 lines
Patches 1 and 2 are minor fixes that could also apply to maint, but the main change is in Patch 3, which removes the long obsoleted "Git Gui" app that was tied to the system provided Tcl/TK framework and that has been broken for a while.
This sounds like the lifted requirement of Tcl 8.6 isn't the cause why this part is broken. But the commit message of patch 3 says it is. Which one is it?
It has been broken multiple times. Since macOS 11 (released in 2020) using the system provided Framework had caused problems, some were worked around by use_ttk=0, but it was more reliable to use a third party Tcl/Tk.
For example, Homebrew tricks the Makefile to fail to detect the system Tcl/Tk and
to use their own version of that dependency.
Something in the recent meson related changes broke the generator for the App and it wouldn't even start, I didn't propose a fix, since that is likely also affecting
maint and nobody complained, which is why I was proposing to remove the App instead.
The last changes that remove use_ttk and force a version that is no longer provided
by the hard coded dependency of the App are just the last nail on its coffin.
Quoted 7 lines
Quoted 4 lines
Patches 4 and 5 are needed to avoid the system framework and facilitate using a third party provided package of Tcl/TK 8.6 instead, but the last patch also protects against a conflict with the Xcode provided git that for some reason includes a copy of
git-gui--askpasseven ifgit-guiis missing.Patch 5, I fear, needs a different approach as it breaks
RUNTIME_PREFIXbuilds. I say that after having looked at the patch; I haven't test it.
I tried not to break RUNTIME_PREFIX by only using the build provided execpath to locate the askpass helper, but the suggestion by Mark seems like a better approach.
Quoted 1 line
Any help would be appreciated on the Meson parts
The Meson build works when tested outside the git repository, but since the main meson.build doesn't yet use that to build/install git-gui there is no way to do a full
test.
Eitherway, it can't make things worse.
Quoted 2 lines
and whether the updated
git-gui--askpass build still works. I don't use either of them.
to trigger the helper you might need OpenSSH >= 8.4 and having the following variable in the environment before calling git-gui:
SSH_ASKPASS_REQUIRE=force
note that G4W provides its own native SSH_ASKPASS=git-askpass.exeso that must be unset first.
Carlo
Quoted 9 lines · Carlo Arenas
Quoted 1 line · Johannes Sixt
Any help would be appreciated on the Meson parts
The Meson build works when tested outside the git repository, but since the main meson.build doesn't yet use that to build/install git-gui there is no way to do a full
test.Eitherway, it can't make things worse.
The Meson part looks reasonable to me.
In any case yes, I haven't yet wired up gitk/git-gui in Git itself. It is trivial to do in theory, and I've already got the patch series sitting locally for quite a while. But there's one catch: we'll have to add those as subprojects, and Meson looks for subprojects in the "subprojects/" directory. Which means that we'd have to move around both gitk and git-gui directories to be located in "subprojects/". We can pick the name of that directory, but it must not be the top-level directory of the project.
I shied away from sending such a patch series for now because I wasn't quite sure how it'll be received. I don't think it's too bad, but it certainly is a bit akward.
Patrick
Quoted 2 lines · Carlo Marcelo Arenas Belón
This series, add improvements to allow running
git-guiin macOS, which is stuck in an ancient version of Tcl/TK that is no longer supported by git.
A naïve question.
Just like Git is a third-party software from macOS's point of view, wouldn't Tcl/Tk be equally a third-party software, or is it more ingrained to the base operation system offering for some reason?
The reason why I ask this question is because I do not see how it would make it a lot more hassle having to upgrade the version of tcl/tk on their macOS machine than having to upgrade the Git to the version that ships with this change, from an end-user's point of view.
Quoted 2 lines · Carlo Marcelo Arenas Belón
This series, add improvements to allow running
git-guiin macOS, which is stuck in an ancient version of Tcl/TK that is no longer supported by git.
A naïve question.
Just like Git is a third-party software from macOS's point of view, wouldn't Tcl/Tk be equally a third-party software, or is it more ingrained to the base operation system offering for some reason?
The reason why I ask this question is because I do not see how it would make it a lot more hassle having to upgrade the version of tcl/tk on their macOS machine than having to upgrade the Git to the version that ships with this change, from an end-user's point of view.
Quoted 11 lines · Junio C Hamano
Quoted 2 lines · Carlo Marcelo Arenas Belón
This series adds improvements to allow running
git-guiin macOS, which is stuck in an ancient version of Tcl/TK that is no longer supported by git.A naïve question.
Just like Git is a third-party software from macOS's point of view, wouldn't Tcl/Tk be equally a third-party software, or is it more ingrained to the base operation system offering for some reason?
It is more ingrained as Tcl/Tk comes with the OS as a Framework, although one that hasn't had updates for half a decade, and that prints a message saying it is deprecated and might be gone in a future release for several releases, when it works.
git comes as part of the "Development tools" (both the command line that is independent of Xcode and as part of Xcode) and therefore must be installed independently.
Quoted 5 lines
The reason why I ask this question is because I do not see how it would make it a lot more hassle having to upgrade the version of tcl/tk on their macOS machine than having to upgrade the Git to the version that ships with this change, from an end-user's point of view.
Not sure I understand the question, but "upgrading" is not the problem.
Users can (and had been doing for a while) install a newer version for both but the Makefile that comes with git-gui tries to find the system provided Tcl/Tk and use that, which IMHO makes little sense once the git-gui codebase is no longer compatible with the version provided by that Framework.
Carlo
Quoted 1 line · Carlo Arenas
Not sure I understand the question, but "upgrading" is not the problem.
What I read from your description tells us that "upgrading" Tcl/Tk beyond the version that is given as part of "Framework" *is* a huge problem for end-users. That was exactly what I was trying to find out.
Thanks.
v2 cover git-gui: workaround deprecation of Tcl/Tk 8.5 in macOS
In reply to Carlo Marcelo Arenas BelónThis series, adds improvements to allow running git-gui in macOS, which is stuck in an ancient version of Tcl/Tk that is no longer supported by git.
Patches 1 and 2 are minor fixes that could also apply to maint, but the main change is in Patch 3, which removes the long obsoleted "Git Gui" app that was tied to the system provided Tcl/Tk framework and that has been broken for a while.
Patches 4 and 5 are needed to avoid the system framework and facilitate using a third party provided package of Tcl/Tk 8.6 instead, but the last patch also protects against a conflict with the Xcode provided git that for some reason includes a copy of git-gui--askpass, even if git-gui is missing.
Carlo Marcelo Arenas Belón (5):
git-gui: remove uname_O in Makefile
git-gui: fix dependency of GITGUI_MAIN on generator
git-gui: retire Git Gui.app
git-gui: honor TCLTK_PATH in git-gui--askpass
git-gui: ensure own version of git-gui--askpass is used
.gitignore | 2 +- GIT-GUI-BUILD-OPTIONS.in | 1 - Makefile | 61 ++---------------- generate-macos-app.sh | 30 --------- generate-macos-wrapper.sh | 35 ----------- generate-script.sh | 22 +++++++ git-gui--askpass => git-gui--askpass.sh | 0 git-gui.sh | 4 +- macosx/AppMain.tcl | 29 --------- macosx/Info.plist | 30 --------- macosx/git-gui.icns | Bin 28866 -> 0 bytes meson.build | 79 +++++------------------- 12 files changed, 46 insertions(+), 247 deletions(-) delete mode 100755 generate-macos-app.sh delete mode 100755 generate-macos-wrapper.sh create mode 100755 generate-script.sh rename git-gui--askpass => git-gui--askpass.sh (100%) delete mode 100644 macosx/AppMain.tcl delete mode 100644 macosx/Info.plist delete mode 100644 macosx/git-gui.icns
Changes since v1:
* no more silly Makefile issues
* a simpler implementation of patch 5
Range-diff against v1:
1: 423b945 = 1: 423b945 git-gui: remove uname_O in Makefile
2: e7183ab = 2: e7183ab git-gui: fix dependency of GITGUI_MAIN on generator
3: 1054496 = 3: 1054496 git-gui: retire Git Gui.app
4: 7fdd8b5 ! 4: 5d908e3 git-gui: honor TCLTK_PATH in git-gui--askpass
@@ Makefile: GIT-GUI-BUILD-OPTIONS: FORCE
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
+git-gui--askpass: git-gui--askpass.sh GIT-GUI-BUILD-OPTIONS generate-script.sh
-+ $(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< GIT-GUI-BUILD-OPTIONS
++ $(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< ./GIT-GUI-BUILD-OPTIONS
+
ifdef GITGUI_WINDOWS_WRAPPER
--all:: git-gui
-+all:: git-gui git-gui--askpass
+ all:: git-gui
endif
-all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES)
+all:: $(GITGUI_MAIN) git-gui--askpass lib/tclIndex $(ALL_MSGFILES)5: 1eae516 ! 5: c5ffefc git-gui: ensure own version of git-gui--askpass is used
@@ Metadata
## Commit message ##
git-gui: ensure own version of git-gui--askpass is used
- Propagate the git --exec-path that is defined at build time
- and use it when defining which askpass helper to use by default.
+ 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 <[email protected]>
- ## generate-git-gui.sh ##
-@@ generate-git-gui.sh: 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"+
-
## git-gui.sh ##
-@@ git-gui.sh: set _isbare {}
- set _githtmldir {}
- set _reponame {}
- set _shellpath {@@SHELL_PATH@@}
-+set _gitexecdir {@@GITGUI_GITEXECDIR@@}
-
- set _trace [lsearch -exact $argv --trace]
- if {$_trace >= 0} {
-@@ git-gui.sh: if {[string match @@* $_shellpath]} {
- }
- }
-
-+if {[string match @@* $_gitexecdir]} {
-+ if {[catch {set _gitexecdir [exec git --exec-path]} err]} {
-+ error "Git not installed?\n\n$err"
-+ }
-+ set _gitexecdir [file normalize $_gitexecdir]
-+}
-+
- if {[is_Windows]} {
- set _shellpath [safe_exec [list cygpath -m $_shellpath]]
- }
@@ git-gui.sh: 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]
++ set env(SSH_ASKPASS) \
++ [file join [file dirname [file normalize $::argv0]] \
++ git-gui--askpass]
}
######################################################################
-
- ## lib/about.tcl ##
-@@
- # 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
-
-@@ lib/about.tcl: 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"
- append d "git-gui lib: $oguilib"
-
- paddedlabel $w.vers -text $v
Signature · 1 line
2.50.1.475.ge15fa7359c
PATCH v2 1/5 git-gui: remove uname_O in Makefile
Last used in ae49066 (git gui Makefile - remove Cygwin modifications, 2023-06-26), and unused since.
--- Makefile | 1 - 1 file changed, 1 deletion(-)
Makefile +0 -1
@@ -11,7 +11,6 @@ GIT-VERSION-FILE: FORCE @$(SHELL_PATH) ./GIT-VERSION-GEN . $@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') -uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') SCRIPT_SH = git-gui.sh
Signature · 1 line
2.50.1.475.ge15fa7359c
PATCH v2 2/5 git-gui: fix dependency of GITGUI_MAIN on generator
In reply to Carlo Marcelo Arenas BelónSince 854e883 (git-gui: extract script to generate "git-gui", 2025-03-11), the logic to generate the main script was pulled out of the Makefile, but adding the resulting generator as a dependency was missed.
If the logic changes, the main script should be regenerated, so add it as a dependency.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -168,7 +168,7 @@ git-gui: windows/git-gui.sh cp $< $@ endif -$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS +$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS generate-git-gui.sh $(QUIET_GEN)$(SHELL_PATH) generate-git-gui.sh "$<" "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE XGETTEXT ?= xgettext
Signature · 1 line
2.50.1.475.ge15fa7359c
PATCH v2 3/5 git-gui: retire Git Gui.app
In reply to Carlo Marcelo Arenas BelónIn a recent commit, the minimum version of Tcl/Tk was raised to 8.6, but the "app" relies on the system provided Framework that is based on 8.5.
Remove it, and let git-gui use a third party version of Wish if available.
--- .gitignore | 1 - GIT-GUI-BUILD-OPTIONS.in | 1 - Makefile | 51 ---------------------------------- generate-macos-app.sh | 30 -------------------- generate-macos-wrapper.sh | 35 ----------------------- macosx/AppMain.tcl | 29 ------------------- macosx/Info.plist | 30 -------------------- macosx/git-gui.icns | Bin 28866 -> 0 bytes meson.build | 57 -------------------------------------- 9 files changed, 234 deletions(-) delete mode 100755 generate-macos-app.sh delete mode 100755 generate-macos-wrapper.sh delete mode 100644 macosx/AppMain.tcl delete mode 100644 macosx/Info.plist delete mode 100644 macosx/git-gui.icns
.gitignore +0 -1
@@ -1,6 +1,5 @@ .DS_Store config.mak -Git Gui.app* git-gui.tcl GIT-GUI-BUILD-OPTIONS GIT-VERSION-FILE
GIT-GUI-BUILD-OPTIONS.in +0 -1
@@ -4,4 +4,3 @@ GITGUI_RELATIVE=@GITGUI_RELATIVE@ SHELL_PATH=@SHELL_PATH@ TCLTK_PATH=@TCLTK_PATH@ TCL_PATH=@TCL_PATH@ -TKEXECUTABLE=@TKEXECUTABLE@
Makefile +0 -51
113 lines not on this page · raw message
generate-macos-app.sh deleted +0 -30
@@ -1,30 +0,0 @@ -#!/bin/sh - -set -e - -SOURCE_DIR="$1" -OUTPUT="$2" -BUILD_OPTIONS="$3" -VERSION_FILE="$4" - -. "$BUILD_OPTIONS" -. "$VERSION_FILE" - -rm -rf "$OUTPUT" "$OUTPUT+" - -mkdir -p "$OUTPUT+/Contents/MacOS" -mkdir -p "$OUTPUT+/Contents/Resources/Scripts" - -cp "$TKEXECUTABLE" "$OUTPUT+/Contents/MacOS" -cp "$SOURCE_DIR/macosx/git-gui.icns" "$OUTPUT+/Contents/Resources" -sed \ - -e "s/@@GITGUI_VERSION@@/$GITGUI_VERSION/g" \ - -e "s/@@GITGUI_TKEXECUTABLE@@/$(basename "$TKEXECUTABLE")/g" \ - "$SOURCE_DIR/macosx/Info.plist" \ - >"$OUTPUT+/Contents/Info.plist" -sed \ - -e "s|@@gitexecdir@@|$GITGUI_GITEXECDIR|" \ - -e "s|@@GITGUI_LIBDIR@@|$GITGUI_LIBDIR|" \ - "$SOURCE_DIR/macosx/AppMain.tcl" \ - >"$OUTPUT+/Contents/Resources/Scripts/AppMain.tcl" -mv "$OUTPUT+" "$OUTPUT"
generate-macos-wrapper.sh deleted +0 -35
@@ -1,35 +0,0 @@ -#!/bin/sh - -set -e - -if test "$#" -ne 3 -then - echo >&2 "usage: $0 <OUTPUT> <BUILD_OPTIONS> <VERSION_FILE>" - exit 1 -fi - -OUTPUT="$1" -BUILD_OPTIONS="$2" -VERSION_FILE="$3" - -. "$BUILD_OPTIONS" - -rm -f "$OUTPUT" "$OUTPUT+" - -( - echo "#!$SHELL_PATH" - cat "$BUILD_OPTIONS" "$VERSION_FILE" - cat <<-'EOF' - if test "z$*" = zversion || - test "z$*" = z--version - then - echo "git-gui version $GITGUI_VERSION" - else - libdir="${GIT_GUI_LIB_DIR:-$GITGUI_LIBDIR}" - exec "$libdir/Git Gui.app/Contents/MacOS/$(basename "$TKEXECUTABLE")" "$0" "$@" - fi - EOF -) >"$OUTPUT+" - -chmod +x "$OUTPUT+" -mv "$OUTPUT+" "$OUTPUT"
macosx/AppMain.tcl deleted +0 -29
@@ -1,29 +0,0 @@ -set gitexecdir {@@gitexecdir@@} -if { [info exists ::env(GIT_GUI_LIB_DIR) ] } { - set gitguilib $::env(GIT_GUI_LIB_DIR) -} else { - set gitguilib {@@GITGUI_LIBDIR@@} -} - -set env(PATH) "$gitexecdir:$env(PATH)" - -if {[string first -psn [lindex $argv 0]] == 0} { - lset argv 0 [file join $gitexecdir git-gui] -} - -if {[file tail [lindex $argv 0]] eq {gitk}} { - set argv0 [lindex $argv 0] - set AppMain_source $argv0 -} else { - set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]] - set AppMain_source [file join $gitguilib git-gui.tcl] - if {[info exists env(PWD)]} { - cd $env(PWD) - } elseif {[pwd] eq {/}} { - cd $env(HOME) - } -} - -unset gitexecdir gitguilib -set argv [lrange $argv 1 end] -source $AppMain_source
macosx/Info.plist deleted +0 -30
@@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>@@GITGUI_TKEXECUTABLE@@</string> - <key>CFBundleGetInfoString</key> - <string>Git Gui @@GITGUI_VERSION@@ © 2006-2007 Shawn Pearce, et. al.</string> - <key>CFBundleIconFile</key> - <string>git-gui.icns</string> - <key>CFBundleIdentifier</key> - <string>cz.or.repo.git-gui</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>Git Gui</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>@@GITGUI_VERSION@@</string> - <key>CFBundleSignature</key> - <string>GITg</string> - <key>CFBundleVersion</key> - <string>@@GITGUI_VERSION@@</string> - <key>NSHighResolutionCapable</key> - <true/> -</dict> -</plist>
macosx/git-gui.icns deleted binary +0 -0
meson.build +0 -57
69 lines not on this page · raw message
Signature · 1 line
2.50.1.475.ge15fa7359c
PATCH v2 4/5 git-gui: honor TCLTK_PATH in git-gui--askpass
In reply to Carlo Marcelo Arenas BelónSince its introduction in 8c76212 (git-gui: Add a simple implementation of SSH_ASKPASS., 2008-10-15), git-gui--askpass has been calling whatever wish interpreter is in the path, unlike git-gui.
Correct that by turning it into a script that would be processed at build time.
--- .gitignore | 1 + Makefile | 7 +++++-- generate-script.sh | 22 ++++++++++++++++++++++ git-gui--askpass => git-gui--askpass.sh | 0 meson.build | 22 ++++++++++++++-------- 5 files changed, 42 insertions(+), 10 deletions(-) create mode 100755 generate-script.sh rename git-gui--askpass => git-gui--askpass.sh (100%)
.gitignore +1 -0
@@ -4,4 +4,5 @@ git-gui.tcl GIT-GUI-BUILD-OPTIONS GIT-VERSION-FILE git-gui +git-gui--askpass lib/tclIndex
Makefile +5 -2
@@ -173,10 +173,13 @@ GIT-GUI-BUILD-OPTIONS: FORCE @if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi +git-gui--askpass: git-gui--askpass.sh GIT-GUI-BUILD-OPTIONS generate-script.sh + $(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< ./GIT-GUI-BUILD-OPTIONS + ifdef GITGUI_WINDOWS_WRAPPER all:: git-gui endif -all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES) +all:: $(GITGUI_MAIN) git-gui--askpass lib/tclIndex $(ALL_MSGFILES) install: all $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -215,7 +218,7 @@ dist-version: GIT-VERSION-FILE @sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version clean:: - $(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg $(PO_TEMPLATE) + $(RM_RF) $(GITGUI_MAIN) git-gui--askpass lib/tclIndex po/*.msg $(PO_TEMPLATE) $(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS ifdef GITGUI_WINDOWS_WRAPPER $(RM_RF) git-gui
generate-script.sh new file +22 -0
@@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +if test $# -ne 3 +then + echo >&2 "USAGE: $0 <OUTPUT> <INPUT> <GIT-GUI-BUILD-OPTIONS>" + exit 1 +fi + +OUTPUT="$1" +INPUT="$2" +BUILD_OPTIONS="$3" + +. "$BUILD_OPTIONS" + +sed \ + -e "1s|#!.*/sh|#!$SHELL_PATH|" \ + -e "1,3s|^exec wish|exec '$TCLTK_PATH'|" \ + "$INPUT" >"$OUTPUT" + +chmod a+x "$OUTPUT"
git-gui--askpass.sh renamed from git-gui--askpass +0 -0
meson.build +14 -8
@@ -38,14 +38,6 @@ version_file = custom_target( build_always_stale: true, ) -configure_file( - input: 'git-gui--askpass', - output: 'git-gui--askpass', - copy: true, - install: true, - install_dir: get_option('libexecdir') / 'git-core', -) - gitgui_main = 'git-gui' gitgui_main_install_dir = get_option('libexecdir') / 'git-core'
@@ -61,6 +53,20 @@ if target_machine.system() == 'windows' ) endif +custom_target( + output: 'git-gui--askpass', + input: 'git-gui--askpass.sh', + command: [ + shell, + meson.current_source_dir() / 'generate-script.sh', + '@OUTPUT@', + '@INPUT@', + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', + ], + install: true, + install_dir: get_option('libexecdir') / 'git-core', +) + custom_target( input: 'git-gui.sh', output: gitgui_main,
Signature · 1 line
2.50.1.475.ge15fa7359c
PATCH v2 5/5 git-gui: ensure own version of git-gui--askpass is used
In reply to Carlo Marcelo Arenas BelónWhen 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.
--- git-gui.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
git-gui.sh +3 -1
@@ -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] } ######################################################################
Signature · 1 line
2.50.1.475.ge15fa7359c
Re: [PATCH v2 5/5] git-gui: ensure own version of git-gui--askpass is used
Am 31.07.25 um 10:06 schrieb Carlo Marcelo Arenas Belón:
Quoted 21 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 <[email protected]>Signed-off-by Carlo Marcelo Arenas Belón <[email protected]>--- git-gui.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)git-gui.sh +0
-0
git-gui.sh citool { · line 1122
Quoted 10 lines
git-gui.sh +3
-1@@ -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:
git-gui.sh +3 -3
@@ -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 ###################################################################### ##