From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Sixt <j6t@kdbg.org>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Pratyush Yadav <me@yadavpratyush.com>
Subject: [PATCH v2 0/4] git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows
Date: Thu, 28 Aug 2025 08:58:46 +0000 [thread overview]
Message-ID: <pull.358.v2.git.1756371530.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.358.git.gitgitgadget@gmail.com>
This is another set of patches from Git for Windows' fork that have been
sitting there since 2010, providing cross-platform GUI helpers to ask the
user a question or allow typing in a password.
This patch series was first submitted as
https://github.com/patthoyts/git-gui/pull/5 which was ignored for almost
three years, then re-submitted as
https://github.com/prati0100/git-gui/pull/3 which was rejected in favor of a
contribution by mail.
The patches are based on Git GUI's master branch at
https://github.com/j6t/git-gui/.
Changes since v1:
* Rebased to current master branch of Git GUI, resolving merge conflicts.
* Dropped double empty line.
* Skip yes/no functions in favor of inline exit 0/exit 1.
* The --title option is now documented in the git-gui--askyesno script.
Heiko Voigt (1):
git-gui: provide question helper for retry fallback on Windows
Johannes Schindelin (3):
git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
git-gui--askyesno: allow overriding the window title
git-gui--askyesno (mingw): use Git for Windows' icon, if available
Makefile | 2 ++
git-gui--askyesno | 63 +++++++++++++++++++++++++++++++++++++++++++++++
git-gui.sh | 6 +++++
3 files changed, 71 insertions(+)
create mode 100755 git-gui--askyesno
base-commit: e3923e3e90da55e12545b5ef5aa34f21e97409d8
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-358%2Fdscho%2Fgit-gui-askpass-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-358/dscho/git-gui-askpass-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/358
Range-diff vs v1:
1: 58972068a230 ! 1: 08b106ebedb9 git-gui: provide question helper for retry fallback on Windows
@@ git-gui--askyesno (new)
+}
+
+${NS}::frame .t
-+${NS}::label .t.m -text $prompt -justify center -width 400px
-+.t.m configure -wraplength 400px
++${NS}::label .t.m -text $prompt -justify center -width 40
++.t.m configure -wraplength 400
+pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1
+pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1
+
+${NS}::frame .b
+${NS}::frame .b.left -width 200
-+${NS}::button .b.yes -text Yes -command yes
-+${NS}::button .b.no -text No -command no
-+
++${NS}::button .b.yes -text Yes -command {exit 0}
++${NS}::button .b.no -text No -command {exit 1}
+
+pack .b.left -side left -expand 1 -fill x
+pack .b.yes -side left -expand 1
@@ git-gui--askyesno (new)
+bind . <Key-Return> {exit 0}
+bind . <Key-Escape> {exit 1}
+
-+proc no {} {
-+ exit 1
-+}
-+
-+proc yes {} {
-+ exit 0
-+}
-+
+wm title . "Question?"
+tk::PlaceWindow .
## git-gui.sh ##
-@@ git-gui.sh: set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
+@@ git-gui.sh: set argv0dir [file dirname [file normalize $::argv0]]
if {![info exists env(SSH_ASKPASS)]} {
- set env(SSH_ASKPASS) [gitexec git-gui--askpass]
+ set env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]
}
+if {![info exists env(GIT_ASK_YESNO)]} {
-+ set env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]
++ set env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]
+}
+ unset argv0dir
######################################################################
- ##
2: cb9f8c8158c5 ! 2: e1aef533bfe8 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
@@ Commit message
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
## git-gui.sh ##
-@@ git-gui.sh: set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
+@@ git-gui.sh: set argv0dir [file dirname [file normalize $::argv0]]
if {![info exists env(SSH_ASKPASS)]} {
- set env(SSH_ASKPASS) [gitexec git-gui--askpass]
+ set env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]
}
+if {![info exists env(GIT_ASKPASS)]} {
+ set env(GIT_ASKPASS) [gitexec git-gui--askpass]
+}
if {![info exists env(GIT_ASK_YESNO)]} {
- set env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]
+ set env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]
}
3: 8cfc935cdba3 ! 3: 2e7e2c1524a7 git-gui--askyesno: allow overriding the window title
@@ Commit message
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
## git-gui--askyesno ##
+@@ git-gui--askyesno: exec wish "$0" -- "$@"
+ # This is an implementation of a simple yes no dialog
+ # which is injected into the git commandline by git gui
+ # in case a yesno question needs to be answered.
++#
++# The window title, which defaults to "Question?", can be
++# overridden via the optional `--title` command-line
++# option.
+
+ set NS {}
+ set use_ttk [package vsatisfies [package provide Tk] 8.5]
@@ git-gui--askyesno: if {$use_ttk} {
set NS ttk
}
@@ git-gui--askyesno: if {$use_ttk} {
set prompt [join $argv " "]
}
-@@ git-gui--askyesno: proc yes {} {
- exit 0
- }
+@@ git-gui--askyesno: pack .b -side bottom -fill x -ipadx 20 -ipady 15
+ bind . <Key-Return> {exit 0}
+ bind . <Key-Escape> {exit 1}
-wm title . "Question?"
+wm title . $title
4: 6025b38d2659 ! 4: 4b04832c0b81 git-gui--askyesno (mingw): use Git for Windows' icon, if available
@@ Metadata
## Commit message ##
git-gui--askyesno (mingw): use Git for Windows' icon, if available
- For additional GUI goodness.
+ This provides a unified look-and-feel in Git for Windows.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
## git-gui--askyesno ##
-@@ git-gui--askyesno: proc yes {} {
- exit 0
- }
+@@ git-gui--askyesno: pack .b -side bottom -fill x -ipadx 20 -ipady 15
+ bind . <Key-Return> {exit 0}
+ bind . <Key-Escape> {exit 1}
+if {$::tcl_platform(platform) eq {windows}} {
+ set icopath [file dirname [file normalize $argv0]]
--
gitgitgadget
next prev parent reply other threads:[~2025-08-28 8:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 15:29 [PATCH 0/4] git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows Johannes Schindelin via GitGitGadget
2019-09-26 15:29 ` [PATCH 1/4] git-gui: provide question helper for retry fallback on Windows Heiko Voigt via GitGitGadget
2019-09-29 17:11 ` Pratyush Yadav
2019-09-26 15:29 ` [PATCH 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet Johannes Schindelin via GitGitGadget
2019-09-29 17:15 ` Pratyush Yadav
2019-09-26 15:29 ` [PATCH 3/4] git-gui--askyesno: allow overriding the window title Johannes Schindelin via GitGitGadget
2019-09-29 17:31 ` Pratyush Yadav
2019-09-26 15:30 ` [PATCH 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available Johannes Schindelin via GitGitGadget
2019-09-29 18:01 ` Pratyush Yadav
2025-08-28 8:58 ` Johannes Schindelin via GitGitGadget [this message]
2025-08-28 8:58 ` [PATCH v2 1/4] git-gui: provide question helper for retry fallback on Windows Heiko Voigt via GitGitGadget
2025-08-28 8:58 ` [PATCH v2 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet Johannes Schindelin via GitGitGadget
2025-08-28 17:44 ` Johannes Sixt
2025-11-17 14:03 ` Johannes Schindelin
2025-08-28 8:58 ` [PATCH v2 3/4] git-gui--askyesno: allow overriding the window title Johannes Schindelin via GitGitGadget
2025-08-28 8:58 ` [PATCH v2 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available Johannes Schindelin via GitGitGadget
2025-08-28 13:33 ` [PATCH] git-gui: use tk_messageBox for ask yes/no Mark Levedahl
2025-08-28 13:49 ` Johannes Schindelin
2025-08-28 21:18 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.358.v2.git.1756371530.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=johannes.schindelin@gmx.de \
--cc=me@yadavpratyush.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.