Skip to content

yesno_dialog #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 189 commits into
base: js/ask-yesno
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
6a72d44
git-gui (Windows): use git-bash.exe if it is available
tomyy Sep 26, 2019
45ab460
Merge branch 'js/git-bash-if-available'
prati0100 Oct 2, 2019
c3b57dc
git-gui: use existing interface to query a path's attribute
bertwesarg Sep 30, 2019
b436825
git-gui: support for diff3 conflict style
bertwesarg Oct 2, 2019
69fdb92
Merge branch 'bw/diff3-conflict-style'
prati0100 Oct 3, 2019
1e6880f
git-gui: add a readme
prati0100 Oct 4, 2019
61f4b40
Merge branch 'py/readme'
prati0100 Oct 12, 2019
f6f3824
git-gui: improve Japanese translation
kdnakt Oct 14, 2019
b524f6b
Merge branch 'ka/japanese-translation'
prati0100 Oct 14, 2019
29a9366
git-gui: consolidate naming conventions
logiclrd Dec 1, 2019
d9c6469
git-gui: update status bar to track operations
logiclrd Dec 1, 2019
fa38ab6
git-gui: revert untracked files by deleting them
logiclrd Dec 1, 2019
2763530
Merge branch 'jg/revert-untracked'
prati0100 Dec 5, 2019
39acfa3
git gui: fix branch name encoding error
kkato233 Dec 7, 2019
d32e065
Merge branch 'kk/branch-name-encoding'
prati0100 Dec 11, 2019
1e1ccbf
git-gui: allow closing console window with Escape
prati0100 Dec 6, 2019
23cbe42
Merge branch 'py/console-close-esc'
prati0100 Dec 19, 2019
786f4d2
git-gui: allow opening currently selected file in default app
zoliszabo Dec 30, 2019
0d2116c
Merge branch 'zs/open-current-file'
prati0100 Jan 4, 2020
8b85bb1
git-gui: update pot template and German translation to current source…
cstim Feb 9, 2020
5096e51
git-gui: extend translation glossary template with more terms
cstim Feb 9, 2020
cf85a32
git-gui: update German translation
cstim Feb 9, 2020
5897e5a
Merge branch 'cs/german-translation'
prati0100 Feb 17, 2020
6b9919c
git-gui: add missing close bracket
prati0100 Feb 17, 2020
63a5845
Merge branch 'py/missing-bracket'
prati0100 Feb 18, 2020
5eb9397
git-gui: fix error popup when doing blame -> "Show History Context"
prati0100 Mar 2, 2020
d769dcc
Merge branch 'py/blame-status-error'
prati0100 Mar 14, 2020
850cf9a
git-gui--askpass: coerce answers to UTF-8 on Windows
lbonanomi Mar 12, 2020
a4a2f64
Merge branch 'js/askpass-coerce-utf8'
prati0100 Mar 14, 2020
8a8efbe
git-gui: reduce Tcl version requirement from 8.6 to 8.5
prati0100 Feb 17, 2020
3891a84
git-gui: create a new namespace for chord script evaluation
prati0100 Mar 14, 2020
a572802
Merge branch 'py/remove-tcloo'
prati0100 Mar 19, 2020
19195fb
Subject: git-gui: fix syntax error because of missing semicolon
Isengart Apr 9, 2020
88db24d
Merge branch 'ar/ui-ready-semicolon'
prati0100 May 5, 2020
e589414
git-gui: Handle Ctrl + BS/Del in the commit msg
ismaell May 12, 2020
c195247
Merge branch 'il/ctrl-bs-del'
prati0100 May 21, 2020
a747395
git-gui: allow opening work trees from the startup dialog
termim Jun 6, 2020
469725c
Merge branch 'mt/open-worktree'
prati0100 Jun 22, 2020
5c1b391
git-gui: fix mixed tabs and spaces; prefer tabs
last-partizan Aug 22, 2020
95bfc6c
Merge branch 'st/spaces-tabs-cleanup' into master
prati0100 Sep 22, 2020
c02efc1
git-gui: improve dark mode support
last-partizan Sep 26, 2020
01121d6
Merge branch 'st/dark-mode' into master
prati0100 Oct 8, 2020
b297e03
git-gui: blame: prevent tool tips from sticking around after Command-Tab
stefanhaller Oct 13, 2020
38c2ac2
Merge branch 'sh/blame-tooltip'
prati0100 Oct 17, 2020
ce83ab2
git-gui: Only touch GITGUI_MSG when needed
prati0100 Nov 27, 2020
627c87f
git-gui: use commit message template
LoewensteinMedicalTechnology Jul 2, 2018
1141f83
Merge branch 'ms/commit-template'
prati0100 Dec 1, 2020
3d02fb2
git-gui: update Russian translation
DJm00n Nov 6, 2020
8222c75
Merge branch 'dr/russian-translation'
prati0100 Dec 1, 2020
a4e1bc9
git-gui: ssh-askpass: add a checkbox to show the input text
davvid Nov 7, 2020
3e5c911
Merge branch 'da/askpass-mask-checkbox'
prati0100 Dec 1, 2020
f9481b1
git-gui: fix colored label backgrounds when using themed widgets
stefanhaller Nov 22, 2020
7d6d21f
Merge branch 'sh/macos-labels'
prati0100 Dec 17, 2020
5bc8b5d
Makefile: conditionally include GIT-VERSION-FILE
ramsay-jones Dec 7, 2020
796f652
Merge branch 'rj/clean-speedup'
prati0100 Dec 17, 2020
4d22c05
git-gui: Fix selected text colors
last-partizan Nov 22, 2020
62aed98
Merge branch 'st/selected-text-colors'
prati0100 Dec 17, 2020
da4d86d
git-gui: use gray background for inactive text widgets
stefanhaller Dec 18, 2020
7b0cfe1
Merge branch 'sh/inactive-background'
prati0100 Dec 18, 2020
413e96f
git-gui: fix typo in russian locale
Jan 14, 2021
7da7ef6
Merge branch 'mk/russian-translation'
prati0100 Feb 2, 2021
b9a4386
git-gui: remove lines starting with the comment character
prati0100 Feb 2, 2021
b1056f6
Merge branch 'py/commit-comments'
prati0100 Feb 22, 2021
c0698df
Revert "git-gui: remove lines starting with the comment character"
prati0100 Mar 4, 2021
df4f9e2
Merge branch 'py/revert-commit-comments'
prati0100 Mar 4, 2021
8cf3640
git-gui: Fix a typo in README
etanot Nov 5, 2021
fa28da0
Merge branch 'vk/readme-typo'
prati0100 Nov 5, 2021
8f23432
windows: ignore empty `PATH` elements
dscho Nov 23, 2022
c5766ea
is_Cygwin: avoid `exec`ing anything
dscho Dec 4, 2022
e0539b4
Move is_<platform> functions to the beginning
dscho Dec 16, 2022
fd477a1
Move the `_which` function (almost) to the top
dscho Dec 5, 2022
aae9560
Work around Tcl's default `PATH` lookup
dscho Nov 23, 2022
1e5a89c
Merge branch 'js/windows-rce'
prati0100 Jan 24, 2023
e69547b
Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4
avar Nov 30, 2022
a5005de
Merge branch 'ab/makeflags'
prati0100 Jan 25, 2023
ae49066
git gui Makefile - remove Cygwin modifications
mark987 Jun 26, 2023
7145c65
git-gui - remove obsolete Cygwin specific code
mark987 Jun 26, 2023
4ed23c3
git-gui - use cygstart to browse on Cygwin
mark987 Jun 26, 2023
b85c5a4
git-gui - use mkshortcut on Cygwin
mark987 Jun 26, 2023
e25cbdf
Merge branch 'ml/cygwin-fixes'
prati0100 Aug 24, 2023
3f71c97
git-gui - re-enable use of hook scripts
mark987 Sep 16, 2023
0730a5a
git-gui - use git-hook, honor core.hooksPath
mark987 Sep 17, 2023
fe475c4
git-gui: po: fix typo in French "aperçu"
bk2204 May 3, 2024
f9a3e70
Merge branch 'ml/git-gui-exec-path-fix'
j6t May 5, 2024
f282df1
doc: update links to current pages
jsoref Nov 24, 2023
34a2498
doc: switch links to https
jsoref Nov 24, 2023
1351570
Makefile(s): avoid recipe prefix in conditional statements
ttaylorr Apr 8, 2024
6a8c13e
Makefile(s): do not enforce "all indents must be done with tab"
gitster Apr 8, 2024
83cf284
git-gui: note the new maintainer
j6t May 11, 2024
47d2691
git-gui: sv.po: Update Swedish translation (576t0f0u)
nafmo Oct 26, 2023
1f9693a
Merge branch 'bc/french-translation'
j6t Jun 23, 2024
c1db988
Merge branch 'pk/swedish-translation'
j6t Jun 23, 2024
f402c79
git-gui: fix inability to quit after closing another instance
orgads Feb 7, 2023
2864e85
Merge branch 'os/catch-rename'
j6t Jul 7, 2024
f823de7
git-gui: Remove forced rescan of stat-dirty files.
j6t Aug 3, 2024
1ae85ff
git-gui: strip comments and consecutive empty lines from commit messages
ossilator Aug 13, 2024
9093496
git-gui: strip commit messages less aggressively
ossilator Aug 13, 2024
8ff65c7
git gui: add directly calling merge tool from configuration
ToBoMi Sep 12, 2024
4925501
Merge branch 'tb/mergetool-from-config'
j6t Nov 9, 2024
e503389
Merge branch 'ob/strip-comments-on-commit'
j6t Nov 9, 2024
e5b5eca
git-gui: use system encoding to show console output
nE0sIghT Sep 22, 2023
0668f04
Merge branch 'yk/console-encoding'
j6t Dec 9, 2024
5c95773
Merge branch 'js/no-rescan-on-empty-diff'
j6t Dec 21, 2024
f37c6dd
git-gui i18n: Updated Bulgarian translation (579t)
alshopov Dec 22, 2024
5ff25b8
git-gui: po/README: update repository location and maintainer
j6t Dec 24, 2024
ae6336b
Merge branch 'as/translations-bg'
j6t Jan 5, 2025
6b43a57
git-gui: heed core.commentChar/commentString
ossilator Mar 15, 2025
2a7d4f2
Merge branch 'ob/strip-comments-on-commit'
j6t Apr 20, 2025
295de10
git-gui: treat the message template file as a built file
j6t Dec 24, 2024
309bb87
Merge branch 'js/po-update-workflow'
j6t May 9, 2025
3271d2e
git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS
pks-t May 12, 2025
3ef470f
git-gui: prepare GIT-VERSION-GEN for out-of-tree builds
pks-t Mar 11, 2025
caf5fbe
git-gui: make output of GIT-VERSION-GEN source'able
pks-t May 12, 2025
3e656a4
git-gui: drop no-op GITGUI_SCRIPT replacement
pks-t Mar 11, 2025
854e883
git-gui: extract script to generate "git-gui"
pks-t Mar 11, 2025
2cc5b0f
git-gui: extract script to generate "tclIndex"
pks-t Mar 11, 2025
743e1cb
git-gui: extract script to generate macOS wrapper
pks-t Mar 11, 2025
28a8e5c
git-gui: extract script to generate macOS app
pks-t May 13, 2025
d821fc6
git-gui: stop including GIT-VERSION-FILE file
pks-t Mar 11, 2025
8bf062d
git-gui: wire up support for the Meson build system
pks-t Mar 11, 2025
80983c4
git-gui: do not end the commit message with an empty line
j6t May 14, 2025
37b9230
git-gui: _which, only add .exe suffix if not present
mark987 Apr 3, 2025
c5c3278
git-gui: use [is_Windows], not bad _shellpath
mark987 Apr 2, 2025
dcda716
Merge branch 'ml/git-gui-exec-path-fix'
j6t May 5, 2024
10637fc
git-gui: make _shellpath usable on startup
mark987 Apr 1, 2025
4774c70
git-gui: remove Tcl 8.4 workaround on 2>@1 redirection
mark987 Sep 20, 2023
02dd866
git-gui: use only the configured shell
mark987 Apr 6, 2025
f9a2e8a
git-gui: remove HEAD detachment implementation for git < 1.5.3
mark987 May 2, 2025
4eb9b11
git-gui: remove special treatment of Windows from open_cmd_pipe
j6t May 18, 2025
8255167
git-gui: remove git config --list handling for git < 1.5.3
j6t May 3, 2025
2c66188
git-gui: remove unused proc is_shellscript
mark987 Apr 4, 2025
c2e8904
git-gui: treat file names beginning with "|" as relative paths
j6t Apr 21, 2025
411cd49
git-gui: avoid auto_execok for git-bash menu item
mark987 Apr 2, 2025
4f3e0a4
git-gui: sanitize 'exec' arguments: simple cases
j6t Apr 21, 2025
00c7aa8
git-gui: avoid auto_execok in do_windows_shortcut
mark987 Apr 3, 2025
e883ceb
git-gui: sanitize 'exec' arguments: background
j6t Apr 26, 2025
676c495
git-gui: cleanup git-bash menu item
mark987 Apr 7, 2025
23ba432
git-gui: remove option --stderr from git_read
j6t May 3, 2025
8fe7861
git-gui: assure PATH has only absolute elements.
mark987 Apr 11, 2025
aa42e87
git-gui: break out a separate function git_read_nice
j6t May 3, 2025
384b140
git-gui: sanitize $PATH on all platforms
mark987 Apr 11, 2025
074c2b9
git-gui: use git_read in githook_read
j6t May 3, 2025
a1ccd25
git-gui: override exec and open only on Windows
mark987 Apr 11, 2025
dc9ecb1
git-gui: convert git_read*, git_write to be non-variadic
j6t May 3, 2025
1e0a93c
git-gui: pass redirections as separate argument to _open_stdout_stderr
j6t May 4, 2025
60b0ba0
git-gui: pass redirections as separate argument to git_read
j6t May 4, 2025
99f7bc1
git-gui: introduce function git_redir for git calls with redirections
j6t May 4, 2025
44e3935
git-gui: do not mistake command arguments as redirection operators
j6t May 4, 2025
afca9a4
Merge branch 'ml/replace-auto-execok' into js/fix-open-exec
ttaylorr May 23, 2025
a437f5b
git-gui: sanitize 'exec' arguments: convert new 'cygpath' calls
j6t May 14, 2025
61f8788
Merge branch 'pks-meson-support' of github.com:pks-t/git-gui
j6t May 29, 2025
765f1db
git-gui: don't delete source files when auto_mkindex fails
j6t Jun 6, 2025
2f0f286
git-gui i18n: Updated Bulgarian translation (578t)
alshopov Jun 15, 2025
e8dd723
Merge branch 'ob/strip-comments-on-commit'
j6t Jun 21, 2025
88125ff
Merge branch 'ml/replace-auto-execok'
j6t Jul 8, 2025
3f07230
Merge branch 'js/fix-open-exec-git'
j6t Jul 8, 2025
532a054
git-gui: Replace null_sha1 with nullid
tiwai Jul 16, 2025
dab92fe
git-gui: Add support of SHA256 repo
tiwai Jul 16, 2025
77f648e
git-gui: require git >= 2.36
mark987 Feb 13, 2024
ed73388
git-gui: Make TclTk 8.6 the minimum, allow 8.7
mark987 May 17, 2025
dd7eb2d
git-gui: git ls-files knows --exclude-standard
mark987 Apr 5, 2025
d342dcd
git-gui: git-diff-index always knows submodules
mark987 Apr 5, 2025
f87a36b
git-gui: use git-branch --show-current
mark987 Feb 12, 2024
182e2c4
git-gui: git rev-parse knows show_toplevel
mark987 Feb 13, 2024
e48c822
git-gui: git-blame understands -w and textconv
mark987 Feb 13, 2024
940640d
git-gui: git-diff knows submodules and textconv
mark987 Feb 13, 2024
e42ba88
git-gui: git merge understands --strategy=recursive
mark987 Feb 13, 2024
8b48034
git-gui: git-remote is always available
mark987 Feb 13, 2024
c855570
git-gui: use git_init to create new repository dir
mark987 Feb 9, 2024
c939344
git-gui: remove unused git-version
mark987 Feb 13, 2024
4e3369f
git-gui: remove unreachable Tk 8.4 code
mark987 Feb 16, 2024
13df401
git-gui: remove redundant check for Tk >= 8.5
mark987 Feb 18, 2024
ed7d2af
git-gui: always use themed widgets from ttk
mark987 May 21, 2025
fdc0e3a
git-gui: remove ${NS} indirection for ttk
mark987 Jul 14, 2025
b76a5a8
git-gui: do not add directories to PATH on Windows
mark987 Apr 13, 2025
e80065e
git-gui: let nice work on Windows
mark987 May 20, 2025
3c8e1fe
git-gui: Windows tk_getSaveFile is not useful for shortcuts
mark987 Apr 13, 2025
9b1c537
git-gui: remove non-ttk code
mark987 May 20, 2025
6ff8d68
git-gui: use git-clone
mark987 Feb 9, 2024
3ce650f
git-gui: default to full copy for linked worktrees
mark987 Jul 21, 2025
6dfdf7b
git-gui: use dashless 'git cmd' form for read/write
mark987 Apr 5, 2025
eaca720
git-gui: remove procs gitexec and _git_cmd
mark987 Apr 6, 2025
f4b7ad5
git-gui: eliminate _search_exe
mark987 Apr 5, 2025
158800a
git-gui: use /cmd/git-gui.exe for shortcut
mark987 Apr 13, 2025
594810d
Merge branch 'ml/tcl86'
j6t Jul 22, 2025
436dad0
Merge branch 'ml/abandon-old-versions'
j6t Jul 22, 2025
f91175e
Merge branch 'ml/windows-tie-loose-ends'
j6t Jul 31, 2025
e3de896
git-gui: use tk_dialog for ask yes/no
mark987 Aug 1, 2025
aca6dc9
Merge branch 'j6t:master' into tmp/ask-yesno
mark987 Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
git-gui.sh encoding=UTF-8
/po/*.po encoding=UTF-8
/GIT-VERSION-GEN eol=lf
Makefile whitespace=!indent,trail,space
meson.build whitespace=space
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
config.mak
Git Gui.app*
git-gui.tcl
GIT-GUI-BUILD-OPTIONS
GIT-VERSION-FILE
GIT-GUI-VARS
git-gui
lib/tclIndex
7 changes: 7 additions & 0 deletions GIT-GUI-BUILD-OPTIONS.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GITGUI_GITEXECDIR=@GITGUI_GITEXECDIR@
GITGUI_LIBDIR=@GITGUI_LIBDIR@
GITGUI_RELATIVE=@GITGUI_RELATIVE@
SHELL_PATH=@SHELL_PATH@
TCLTK_PATH=@TCLTK_PATH@
TCL_PATH=@TCL_PATH@
TKEXECUTABLE=@TKEXECUTABLE@
44 changes: 29 additions & 15 deletions GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=0.21.GITGUI

LF='
'

if test "$#" -ne 2
then
echo >&2 "usage: $0 <SOURCE_DIR> <OUTPUT>"
exit 1
fi

SOURCE_DIR="$1"
OUTPUT="$2"

# Protect us from reading Git version information outside of the Git directory
# in case it is not a repository itself, but embedded in an unrelated
# repository.
GIT_CEILING_DIRECTORIES="$SOURCE_DIR/.."
export GIT_CEILING_DIRECTORIES

tree_search ()
{
head=$1
tree=$2
for p in $(git rev-list --parents --max-count=1 $head 2>/dev/null)
for p in $(git -C "$SOURCE_DIR" rev-list --parents --max-count=1 $head 2>/dev/null)
do
test $tree = $(git rev-parse $p^{tree} 2>/dev/null) &&
vn=$(git describe --abbrev=4 $p 2>/dev/null) &&
test $tree = $(git -C "$SOURCE_DIR" rev-parse $p^{tree} 2>/dev/null) &&
vn=$(git -C "$SOURCE_DIR" describe --abbrev=4 $p 2>/dev/null) &&
case "$vn" in
gitgui-[0-9]*) echo $vn; break;;
esac
Expand All @@ -34,22 +48,22 @@ tree_search ()
# If we are at the toplevel or the merge assumption fails
# try looking for a gitgui-* tag.

if test -f version &&
VN=$(cat version)
if test -f "$SOURCE_DIR"/version &&
VN=$(cat "$SOURCE_DIR"/version)
then
: happy
elif prefix="$(git rev-parse --show-prefix 2>/dev/null)"
elif prefix="$(git -C "$SOURCE_DIR" rev-parse --show-prefix 2>/dev/null)"
test -n "$prefix" &&
head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) &&
tree=$(git rev-parse --verify "HEAD:$prefix" 2>/dev/null) &&
head=$(git -C "$SOURCE_DIR" rev-list --max-count=1 HEAD -- . 2>/dev/null) &&
tree=$(git -C "$SOURCE_DIR" rev-parse --verify "HEAD:$prefix" 2>/dev/null) &&
VN=$(tree_search $head $tree)
case "$VN" in
gitgui-[0-9]*) : happy ;;
*) (exit 1) ;;
esac
then
VN=$(echo "$VN" | sed -e 's/^gitgui-//;s/-/./g');
elif VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
elif VN=$(git -C "$SOURCE_DIR" describe --abbrev=4 HEAD 2>/dev/null) &&
case "$VN" in
gitgui-[0-9]*) : happy ;;
*) (exit 1) ;;
Expand All @@ -60,21 +74,21 @@ else
VN="$DEF_VER"
fi

dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty=
dirty=$(git -C "$SOURCE_DIR" diff-index --name-only HEAD 2>/dev/null) || dirty=
case "$dirty" in
'')
;;
*)
VN="$VN-dirty" ;;
esac

if test -r $GVF
if test -r "$OUTPUT"
then
VC=$(sed -e 's/^GITGUI_VERSION = //' <$GVF)
VC=$(sed -e 's/^GITGUI_VERSION=//' <"$OUTPUT")
else
VC=unset
fi
test "$VN" = "$VC" || {
echo >&2 "GITGUI_VERSION = $VN"
echo "GITGUI_VERSION = $VN" >$GVF
echo >&2 "GITGUI_VERSION=$VN"
echo "GITGUI_VERSION=$VN" >"$OUTPUT"
}
152 changes: 41 additions & 111 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ all::
#

GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN
-include GIT-VERSION-FILE
@$(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')
Expand Down Expand Up @@ -73,7 +72,6 @@ ifndef V
QUIET_INDEX = $(QUIET)echo ' ' INDEX $(dir $@) &&
QUIET_MSGFMT0 = $(QUIET)printf ' MSGFMT %12s ' $@ && v=`
QUIET_MSGFMT1 = 2>&1` && echo "$$v" | sed -e 's/fuzzy translations/fuzzy/' | sed -e 's/ messages*//g'
QUIET_2DEVNULL = 2>/dev/null

INSTALL_D0 = dir=
INSTALL_D1 = && echo ' ' DEST $$dir && $(INSTALL) -d -m 755 "$$dir"
Expand Down Expand Up @@ -105,16 +103,17 @@ endif

ifeq ($(uname_S),Darwin)
TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n)
ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n)
TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish.app
ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n)
ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n)
TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
endif
endif
TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app)
endif
endif
TKEXECUTABLE = $(TKFRAMEWORK)/Contents/MacOS/$(shell basename "$(TKFRAMEWORK)" .app)
TKEXECUTABLE_SQ = $(subst ','\'',$(TKEXECUTABLE))
endif

ifeq ($(findstring $(MAKEFLAGS),s),s)
ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s)
QUIET_GEN =
endif

Expand All @@ -125,40 +124,21 @@ gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
TCL_PATH_SQ = $(subst ','\'',$(TCL_PATH))
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
TCLTK_PATH_SED = $(subst ','\'',$(subst \,\\,$(TCLTK_PATH)))

gg_libdir ?= $(sharedir)/git-gui/lib
libdir_SQ = $(subst ','\'',$(gg_libdir))
libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir_sed_in)))
exedir = $(dir $(gitexecdir))share/git-gui/lib

GITGUI_SCRIPT := $$0
GITGUI_RELATIVE :=
GITGUI_MACOSXAPP :=

ifeq ($(uname_O),Cygwin)
GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`

# Is this a Cygwin Tcl/Tk binary? If so it knows how to do
# POSIX path translation just like cygpath does and we must
# keep libdir in POSIX format so Cygwin packages of git-gui
# work no matter where the user installs them.
#
ifeq ($(shell echo 'puts [file normalize /]' | '$(TCL_PATH_SQ)'),$(shell cygpath --mixed --absolute /))
gg_libdir_sed_in := $(gg_libdir)
else
gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)")
endif
else
ifeq ($(exedir),$(gg_libdir))
GITGUI_RELATIVE := 1
endif
gg_libdir_sed_in := $(gg_libdir)
ifeq ($(exedir),$(gg_libdir))
GITGUI_RELATIVE := 1
endif
ifeq ($(uname_S),Darwin)
ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y)
ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y)
GITGUI_MACOSXAPP := YesPlease
endif
endif
endif
ifneq (,$(findstring MINGW,$(uname_S)))
ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
Expand All @@ -171,41 +151,15 @@ endif
ifdef GITGUI_MACOSXAPP
GITGUI_MAIN := git-gui.tcl

git-gui: GIT-VERSION-FILE GIT-GUI-VARS
$(QUIET_GEN)rm -f $@ $@+ && \
echo '#!$(SHELL_PATH_SQ)' >$@+ && \
echo 'if test "z$$*" = zversion ||' >>$@+ && \
echo ' test "z$$*" = z--version' >>$@+ && \
echo then >>$@+ && \
echo ' 'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
echo else >>$@+ && \
echo ' libdir="$${GIT_GUI_LIB_DIR:-$(libdir_SQ)}"' >>$@+ && \
echo ' 'exec \"'$$libdir/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\" \
'"$$0" "$$@"' >>$@+ && \
echo fi >>$@+ && \
chmod +x $@+ && \
mv $@+ $@

Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-VARS \
git-gui: generate-macos-wrapper.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS
$(QUIET_GEN)$(SHELL_PATH) generate-macos-wrapper.sh "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE

Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS \
macosx/Info.plist \
macosx/git-gui.icns \
macosx/AppMain.tcl \
$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)
$(QUIET_GEN)rm -rf '$@' '$@'+ && \
mkdir -p '$@'+/Contents/MacOS && \
mkdir -p '$@'+/Contents/Resources/Scripts && \
cp '$(subst ','\'',$(subst \,,$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)))' \
'$@'+/Contents/MacOS && \
cp macosx/git-gui.icns '$@'+/Contents/Resources && \
sed -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
-e 's/@@GITGUI_TKEXECUTABLE@@/$(TKEXECUTABLE)/g' \
macosx/Info.plist \
>'$@'+/Contents/Info.plist && \
sed -e 's|@@gitexecdir@@|$(gitexecdir_SQ)|' \
-e 's|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \
macosx/AppMain.tcl \
>'$@'+/Contents/Resources/Scripts/AppMain.tcl && \
mv '$@'+ '$@'
$(TKEXECUTABLE)
$(QUIET_GEN)$(SHELL_PATH) generate-macos-app.sh . "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE
endif

ifdef GITGUI_WINDOWS_WRAPPER
Expand All @@ -215,27 +169,17 @@ git-gui: windows/git-gui.sh
cp $< $@
endif

$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS
$(QUIET_GEN)rm -f $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \
-e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \
-e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
-e 's|@@GITGUI_RELATIVE@@|$(GITGUI_RELATIVE)|' \
-e '$(GITGUI_RELATIVE)s|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \
git-gui.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS
$(QUIET_GEN)$(SHELL_PATH) generate-git-gui.sh "$<" "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE

XGETTEXT ?= xgettext
ifdef NO_MSGFMT
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
else
MSGFMT ?= msgfmt
ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
MSGFMT := $(TCL_PATH) po/po2msg.sh
endif
endif
endif

msgsdir = $(gg_libdir)/msgs
Expand All @@ -251,35 +195,21 @@ update-po:: $(PO_TEMPLATE)
$(ALL_MSGFILES): %.msg : %.po
$(QUIET_MSGFMT0)$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $< $(QUIET_MSGFMT1)

lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VARS
$(QUIET_INDEX)if echo \
$(foreach p,$(PRELOAD_FILES),source $p\;) \
auto_mkindex lib $(patsubst lib/%,%,$(sort $(ALL_LIBFILES))) \
| $(TCL_PATH) $(QUIET_2DEVNULL); then : ok; \
else \
echo >&2 " * $(TCL_PATH) failed; using unoptimized loading"; \
rm -f $@ ; \
echo '# Autogenerated by git-gui Makefile' >$@ && \
echo >>$@ && \
$(foreach p,$(PRELOAD_FILES) $(sort $(ALL_LIBFILES)),echo '$(subst lib/,,$p)' >>$@ &&) \
echo >>$@ ; \
fi

TRACK_VARS = \
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
$(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
$(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \
$(subst ','\'',gg_libdir='$(libdir_SQ)') \
GITGUI_MACOSXAPP=$(GITGUI_MACOSXAPP) \
#end TRACK_VARS

GIT-GUI-VARS: FORCE
@VARS='$(TRACK_VARS)'; \
if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
echo >&2 " * new locations or Tcl/Tk interpreter"; \
echo >$@ "$$VARS"; \
fi
lib/tclIndex: $(ALL_LIBFILES) generate-tclindex.sh GIT-GUI-BUILD-OPTIONS
$(QUIET_INDEX)$(SHELL_PATH) generate-tclindex.sh . ./GIT-GUI-BUILD-OPTIONS $(ALL_LIBFILES)

GIT-GUI-BUILD-OPTIONS: FORCE
@sed \
-e 's|@GITGUI_GITEXECDIR@|$(gitexecdir_SQ)|' \
-e 's|@GITGUI_LIBDIR@|$(libdir_SQ)|' \
-e 's|@GITGUI_RELATIVE@|$(GITGUI_RELATIVE)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's|@TCLTK_PATH@|$(TCLTK_PATH_SQ)|' \
-e 's|@TCL_PATH@|$(TCL_PATH_SQ)|' \
-e 's|@TKEXECUTABLE@|$(TKEXECUTABLE_SQ)|' \
[email protected] >$@+
@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

ifdef GITGUI_MACOSXAPP
all:: git-gui Git\ Gui.app
Expand Down Expand Up @@ -331,13 +261,13 @@ endif
$(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1)
$(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1)

dist-version:
dist-version: GIT-VERSION-FILE
@mkdir -p $(TARDIR)
@echo $(GITGUI_VERSION) > $(TARDIR)/version
@sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version

clean::
$(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg
$(RM_RF) GIT-VERSION-FILE GIT-GUI-VARS
$(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg $(PO_TEMPLATE)
$(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS
ifdef GITGUI_MACOSXAPP
$(RM_RF) 'Git Gui.app'* git-gui
endif
Expand Down
Loading