{"thread":{"id":"51926","subject":"[PATCH 0/4] git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows","startedAt":"2019-09-26T15:29:58Z","lastAt":"2025-11-17T14:03:16Z","messageCount":19,"participants":["Johannes Schindelin via GitGitGadget","Heiko Voigt via GitGitGadget","Pratyush Yadav","Mark Levedahl","Johannes Schindelin","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"382992","messageId":"pull.358.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":null,"subject":"[PATCH 0/4] git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-09-26T15:29:54Z","receivedAt":"2019-09-26T15:29:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This is another set of patches from Git for Windows' fork that have been\nsitting there since 2010, providing cross-platform GUI helpers to ask the\nuser a question or allow typing in a password.\n\nThis patch series was first submitted as \nhttps://github.com/patthoyts/git-gui/pull/5 which was ignored for almost\nthree years, then re-submitted as \nhttps://github.com/prati0100/git-gui/pull/3 which was rejected in favor of a\ncontribution by mail.\n\nThe patches are based on Git GUI's master branch at \nhttps://github.com/prati0100/git-gui/.\n\nHeiko Voigt (1):\n  git-gui: provide question helper for retry fallback on Windows\n\nJohannes Schindelin (3):\n  git gui: set GIT_ASKPASS=git-gui--askpass if not set yet\n  git-gui--askyesno: allow overriding the window title\n  git-gui--askyesno (mingw): use Git for Windows' icon, if available\n\n Makefile          |  2 ++\n git-gui--askyesno | 68 +++++++++++++++++++++++++++++++++++++++++++++++\n git-gui.sh        |  6 +++++\n 3 files changed, 76 insertions(+)\n create mode 100755 git-gui--askyesno\n\n\nbase-commit: 12d29c326551a6570594db525bea42ad9cea8028\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-358%2Fdscho%2Fgit-gui-askpass-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-358/dscho/git-gui-askpass-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/358\n-- \ngitgitgadget\n"},{"id":"382993","messageId":"58972068a230c996951e26d795e26cf66459c497.1569511793.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.git.gitgitgadget@gmail.com","subject":"[PATCH 1/4] git-gui: provide question helper for retry fallback on Windows","fromName":"Heiko Voigt via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-09-26T15:29:56Z","receivedAt":"2019-09-26T15:30:02Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"From: Heiko Voigt <hvoigt@hvoigt.net>\n\nMake use of the new environment variable GIT_ASK_YESNO to support the\nrecently implemented fallback in case unlink, rename or rmdir fail for\nfiles in use on Windows. The added dialog will present a yes/no question\nto the the user which will currently be used by the windows compat layer\nto let the user retry a failed file operation.\n\nSigned-off-by: Heiko Voigt <hvoigt@hvoigt.net>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Makefile          |  2 ++\n git-gui--askyesno | 51 +++++++++++++++++++++++++++++++++++++++++++++++\n git-gui.sh        |  3 +++\n 3 files changed, 56 insertions(+)\n create mode 100755 git-gui--askyesno\n\ndiff --git a/Makefile b/Makefile\nindex fe30be38dc..85633b73df 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -291,6 +291,7 @@ install: all\n \t$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)\n \t$(QUIET)$(INSTALL_X0)git-gui $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n \t$(QUIET)$(INSTALL_X0)git-gui--askpass $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n+\t$(QUIET)$(INSTALL_X0)git-gui--askyesno $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n \t$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(INSTALL_L0)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L1)'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' $(INSTALL_L2)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L3) &&) true\n ifdef GITGUI_WINDOWS_WRAPPER\n \t$(QUIET)$(INSTALL_R0)git-gui.tcl $(INSTALL_R1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n@@ -309,6 +310,7 @@ uninstall:\n \t$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui $(REMOVE_F1)\n \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askpass $(REMOVE_F1)\n+\t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askyesno $(REMOVE_F1)\n \t$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/$p $(REMOVE_F1) &&) true\n ifdef GITGUI_WINDOWS_WRAPPER\n \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui.tcl $(REMOVE_F1)\ndiff --git a/git-gui--askyesno b/git-gui--askyesno\nnew file mode 100755\nindex 0000000000..cf9c990d09\n--- /dev/null\n+++ b/git-gui--askyesno\n@@ -0,0 +1,51 @@\n+#!/bin/sh\n+# Tcl ignores the next line -*- tcl -*- \\\n+exec wish \"$0\" -- \"$@\"\n+\n+# This is an implementation of a simple yes no dialog\n+# which is injected into the git commandline by git gui\n+# in case a yesno question needs to be answered.\n+\n+set NS {}\n+set use_ttk [package vsatisfies [package provide Tk] 8.5]\n+if {$use_ttk} {\n+\tset NS ttk\n+}\n+\n+if {$argc < 1} {\n+\tputs stderr \"Usage: $argv0 <question>\"\n+\texit 1\n+} else {\n+\tset prompt [join $argv \" \"]\n+}\n+\n+${NS}::frame .t\n+${NS}::label .t.m -text $prompt -justify center -width 400px\n+.t.m configure -wraplength 400px\n+pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1\n+pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1\n+\n+${NS}::frame .b\n+${NS}::frame .b.left -width 200\n+${NS}::button .b.yes -text Yes -command yes\n+${NS}::button .b.no  -text No  -command no\n+\n+\n+pack .b.left -side left -expand 1 -fill x\n+pack .b.yes -side left -expand 1\n+pack .b.no -side right -expand 1 -ipadx 5\n+pack .b -side bottom -fill x -ipadx 20 -ipady 15\n+\n+bind . <Key-Return> {exit 0}\n+bind . <Key-Escape> {exit 1}\n+\n+proc no {} {\n+\texit 1\n+}\n+\n+proc yes {} {\n+\texit 0\n+}\n+\n+wm title . \"Question?\"\n+tk::PlaceWindow .\ndiff --git a/git-gui.sh b/git-gui.sh\nindex f9b323abff..76d8139b8d 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1248,6 +1248,9 @@ set have_tk85 [expr {[package vcompare $tk_version \"8.5\"] >= 0}]\n if {![info exists env(SSH_ASKPASS)]} {\n \tset env(SSH_ASKPASS) [gitexec git-gui--askpass]\n }\n+if {![info exists env(GIT_ASK_YESNO)]} {\n+\tset env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]\n+}\n \n ######################################################################\n ##\n-- \ngitgitgadget\n\n"},{"id":"382994","messageId":"cb9f8c8158c5a7b55ed746234624ae69a575f608.1569511793.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.git.gitgitgadget@gmail.com","subject":"[PATCH 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-09-26T15:29:57Z","receivedAt":"2019-09-26T15:30:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-gui.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 76d8139b8d..66f046a0c7 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1248,6 +1248,9 @@ set have_tk85 [expr {[package vcompare $tk_version \"8.5\"] >= 0}]\n if {![info exists env(SSH_ASKPASS)]} {\n \tset env(SSH_ASKPASS) [gitexec git-gui--askpass]\n }\n+if {![info exists env(GIT_ASKPASS)]} {\n+\tset env(GIT_ASKPASS) [gitexec git-gui--askpass]\n+}\n if {![info exists env(GIT_ASK_YESNO)]} {\n \tset env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]\n }\n-- \ngitgitgadget\n\n"},{"id":"382995","messageId":"8cfc935cdba316f513f2408c1f39c5d68d5258fc.1569511793.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.git.gitgitgadget@gmail.com","subject":"[PATCH 3/4] git-gui--askyesno: allow overriding the window title","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-09-26T15:29:58Z","receivedAt":"2019-09-26T15:30:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\n\"Question?\" is maybe not the most informative thing to ask. In the\nabsence of better information, it is the best we can do, of course.\n\nHowever, Git for Windows' auto updater just learned the trick to use\ngit-gui--askyesno to ask the user whether to update now or not. And in\nthis scripted scenario, we can easily pass a command-line option to\nchange the window title.\n\nSo let's support that with the new `--title <title>` option.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-gui--askyesno | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/git-gui--askyesno b/git-gui--askyesno\nindex cf9c990d09..45b0260eff 100755\n--- a/git-gui--askyesno\n+++ b/git-gui--askyesno\n@@ -12,10 +12,15 @@ if {$use_ttk} {\n \tset NS ttk\n }\n \n+set title \"Question?\"\n if {$argc < 1} {\n \tputs stderr \"Usage: $argv0 <question>\"\n \texit 1\n } else {\n+\tif {$argc > 2 && [lindex $argv 0] == \"--title\"} {\n+\t\tset title [lindex $argv 1]\n+\t\tset argv [lreplace $argv 0 1]\n+\t}\n \tset prompt [join $argv \" \"]\n }\n \n@@ -47,5 +52,5 @@ proc yes {} {\n \texit 0\n }\n \n-wm title . \"Question?\"\n+wm title . $title\n tk::PlaceWindow .\n-- \ngitgitgadget\n\n"},{"id":"382996","messageId":"6025b38d2659caa111d2e5e9a1fa48d47de0e827.1569511793.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.git.gitgitgadget@gmail.com","subject":"[PATCH 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-09-26T15:30:00Z","receivedAt":"2019-09-26T15:30:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nFor additional GUI goodness.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-gui--askyesno | 12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/git-gui--askyesno b/git-gui--askyesno\nindex 45b0260eff..c0c82e7cbd 100755\n--- a/git-gui--askyesno\n+++ b/git-gui--askyesno\n@@ -52,5 +52,17 @@ proc yes {} {\n \texit 0\n }\n \n+if {$::tcl_platform(platform) eq {windows}} {\n+\tset icopath [file dirname [file normalize $argv0]]\n+\tif {[file tail $icopath] eq {git-core}} {\n+\t\tset icopath [file dirname $icopath]\n+\t}\n+\tset icopath [file dirname $icopath]\n+\tset icopath [file join $icopath share git git-for-windows.ico]\n+\tif {[file exists $icopath]} {\n+\t\twm iconbitmap . -default $icopath\n+\t}\n+}\n+\n wm title . $title\n tk::PlaceWindow .\n-- \ngitgitgadget\n"},{"id":"383101","messageId":"20190929171129.u5kvx5ggyjxjkzdu@yadavpratyush.com","threadId":"51926","inReplyTo":"58972068a230c996951e26d795e26cf66459c497.1569511793.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/4] git-gui: provide question helper for retry fallback on Windows","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-09-29T17:11:29Z","receivedAt":"2019-09-29T17:11:36Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 26/09/19 08:29AM, Heiko Voigt via GitGitGadget wrote:\n> From: Heiko Voigt <hvoigt@hvoigt.net>\n> \n> Make use of the new environment variable GIT_ASK_YESNO to support the\n> recently implemented fallback in case unlink, rename or rmdir fail for\n> files in use on Windows. The added dialog will present a yes/no question\n> to the the user which will currently be used by the windows compat layer\n> to let the user retry a failed file operation.\n\nI can't find any documentation related to this environment variable. A \nGoogle search does not yield any promising results. I don't see this \nmentioned in the git man page either, though that is to be expected \nbecause it seems to be a Windows-only variable.\n\nMy point is, it would be nice if the commit message pointed to some sort \nof documentation for the environment variable. It would also help me in \nreviewing the patch if I know more about the variable.\n\nEither way, some minor comments down below.\n\n> \n> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  Makefile          |  2 ++\n>  git-gui--askyesno | 51 +++++++++++++++++++++++++++++++++++++++++++++++\n>  git-gui.sh        |  3 +++\n>  3 files changed, 56 insertions(+)\n>  create mode 100755 git-gui--askyesno\n> \n> diff --git a/Makefile b/Makefile\n> index fe30be38dc..85633b73df 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -291,6 +291,7 @@ install: all\n>  \t$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)\n>  \t$(QUIET)$(INSTALL_X0)git-gui $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n>  \t$(QUIET)$(INSTALL_X0)git-gui--askpass $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n> +\t$(QUIET)$(INSTALL_X0)git-gui--askyesno $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n>  \t$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(INSTALL_L0)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L1)'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' $(INSTALL_L2)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L3) &&) true\n>  ifdef GITGUI_WINDOWS_WRAPPER\n>  \t$(QUIET)$(INSTALL_R0)git-gui.tcl $(INSTALL_R1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n> @@ -309,6 +310,7 @@ uninstall:\n>  \t$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n>  \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui $(REMOVE_F1)\n>  \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askpass $(REMOVE_F1)\n> +\t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askyesno $(REMOVE_F1)\n>  \t$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/$p $(REMOVE_F1) &&) true\n>  ifdef GITGUI_WINDOWS_WRAPPER\n>  \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui.tcl $(REMOVE_F1)\n\nI'm not too slick with Makefiles, but these changes look good.\n\n> diff --git a/git-gui--askyesno b/git-gui--askyesno\n> new file mode 100755\n> index 0000000000..cf9c990d09\n> --- /dev/null\n> +++ b/git-gui--askyesno\n> @@ -0,0 +1,51 @@\n> +#!/bin/sh\n> +# Tcl ignores the next line -*- tcl -*- \\\n> +exec wish \"$0\" -- \"$@\"\n> +\n> +# This is an implementation of a simple yes no dialog\n> +# which is injected into the git commandline by git gui\n> +# in case a yesno question needs to be answered.\n> +\n> +set NS {}\n> +set use_ttk [package vsatisfies [package provide Tk] 8.5]\n> +if {$use_ttk} {\n> +\tset NS ttk\n> +}\n> +\n> +if {$argc < 1} {\n> +\tputs stderr \"Usage: $argv0 <question>\"\n> +\texit 1\n> +} else {\n> +\tset prompt [join $argv \" \"]\n> +}\n> +\n> +${NS}::frame .t\n> +${NS}::label .t.m -text $prompt -justify center -width 400px\n> +.t.m configure -wraplength 400px\n> +pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1\n> +pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1\n> +\n> +${NS}::frame .b\n> +${NS}::frame .b.left -width 200\n> +${NS}::button .b.yes -text Yes -command yes\n> +${NS}::button .b.no  -text No  -command no\n\nDo you really need separate functions for yes/no? I think something like\n\n  -command {exit 1}\n\nand\n\n  -command {exit 0}\n\nwould do just fine.\n\nEither way...\n\n> +\n> +\n\nNitpick: Drop one of the two blank lines.\n\n> +pack .b.left -side left -expand 1 -fill x\n> +pack .b.yes -side left -expand 1\n> +pack .b.no -side right -expand 1 -ipadx 5\n> +pack .b -side bottom -fill x -ipadx 20 -ipady 15\n> +\n> +bind . <Key-Return> {exit 0}\n> +bind . <Key-Escape> {exit 1}\n\n... do the same thing here. Call yes and no here too if you are using \nthem above.\n\nI have no preference for either way, but I would like uniformity in \nthese two spots.\n\n> +\n> +proc no {} {\n> +\texit 1\n> +}\n> +\n> +proc yes {} {\n> +\texit 0\n> +}\n> +\n> +wm title . \"Question?\"\n> +tk::PlaceWindow .\n> diff --git a/git-gui.sh b/git-gui.sh\n> index f9b323abff..76d8139b8d 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -1248,6 +1248,9 @@ set have_tk85 [expr {[package vcompare $tk_version \"8.5\"] >= 0}]\n>  if {![info exists env(SSH_ASKPASS)]} {\n>  \tset env(SSH_ASKPASS) [gitexec git-gui--askpass]\n>  }\n> +if {![info exists env(GIT_ASK_YESNO)]} {\n> +\tset env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]\n> +}\n\nSince this seems to be a Windows-only variable, you might want to enable \nit only on Windows. Are there workflows on other platforms that would \nuse this environment variable?\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"383102","messageId":"20190929171537.3t5f5glq2jamkpa5@yadavpratyush.com","threadId":"51926","inReplyTo":"cb9f8c8158c5a7b55ed746234624ae69a575f608.1569511793.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-09-29T17:15:37Z","receivedAt":"2019-09-29T17:15:44Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"What is the difference between SSH_ASKPASS and GIT_ASKPASS? On my first \nread, I assumed SSH_ASKPASS is replaced by GIT_ASKPASS, but I might be \nwrong.\n\nOn 26/09/19 08:29AM, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  git-gui.sh | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/git-gui.sh b/git-gui.sh\n> index 76d8139b8d..66f046a0c7 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -1248,6 +1248,9 @@ set have_tk85 [expr {[package vcompare $tk_version \"8.5\"] >= 0}]\n>  if {![info exists env(SSH_ASKPASS)]} {\n>  \tset env(SSH_ASKPASS) [gitexec git-gui--askpass]\n>  }\n> +if {![info exists env(GIT_ASKPASS)]} {\n> +\tset env(GIT_ASKPASS) [gitexec git-gui--askpass]\n> +}\n>  if {![info exists env(GIT_ASK_YESNO)]} {\n>  \tset env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]\n>  }\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"383103","messageId":"20190929173135.3swz2canehtoxkcf@yadavpratyush.com","threadId":"51926","inReplyTo":"8cfc935cdba316f513f2408c1f39c5d68d5258fc.1569511793.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 3/4] git-gui--askyesno: allow overriding the window title","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-09-29T17:31:35Z","receivedAt":"2019-09-29T17:43:24Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"One minor nitpick: please add a comment at the top of the file \ndocumenting the `--title` option, and the usage of the program in \ngeneral.\n\nOther than that, looks good. Thanks.\n\nOn 26/09/19 08:29AM, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> \"Question?\" is maybe not the most informative thing to ask. In the\n> absence of better information, it is the best we can do, of course.\n> \n> However, Git for Windows' auto updater just learned the trick to use\n> git-gui--askyesno to ask the user whether to update now or not. And in\n> this scripted scenario, we can easily pass a command-line option to\n> change the window title.\n> \n> So let's support that with the new `--title <title>` option.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  git-gui--askyesno | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/git-gui--askyesno b/git-gui--askyesno\n> index cf9c990d09..45b0260eff 100755\n> --- a/git-gui--askyesno\n> +++ b/git-gui--askyesno\n> @@ -12,10 +12,15 @@ if {$use_ttk} {\n>  \tset NS ttk\n>  }\n>  \n> +set title \"Question?\"\n>  if {$argc < 1} {\n>  \tputs stderr \"Usage: $argv0 <question>\"\n>  \texit 1\n>  } else {\n> +\tif {$argc > 2 && [lindex $argv 0] == \"--title\"} {\n\nWhile this is probably not the most robust way of handling command line \narguments, I guess it doesn't really make too much of a difference for \nsomething this simple.\n\n> +\t\tset title [lindex $argv 1]\n> +\t\tset argv [lreplace $argv 0 1]\n> +\t}\n>  \tset prompt [join $argv \" \"]\n>  }\n>  \n> @@ -47,5 +52,5 @@ proc yes {} {\n>  \texit 0\n>  }\n>  \n> -wm title . \"Question?\"\n> +wm title . $title\n>  tk::PlaceWindow .\n> -- \n> gitgitgadget\n> \n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"383104","messageId":"20190929180157.ogwmiaer4pjjduoj@yadavpratyush.com","threadId":"51926","inReplyTo":"6025b38d2659caa111d2e5e9a1fa48d47de0e827.1569511793.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-09-29T18:01:57Z","receivedAt":"2019-09-29T18:02:02Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Since this is a git-gui dialog/prompt, why not use the git-gui icon? \nThis will mean some uniformity between all the platforms (though I'm not \nsure if other platforms even use GIT_ASK_YESNO). It would also probably \nsave you the hacks needed to find out the git-for-windows icon.\n\nWell, there is the problem that the git-gui logo is not in any external \nfile, and is inside git-gui.sh (as a vector image, but I'm not sure). \nBut I'd like to at least start some discussion in this direction.\n\nOn 26/09/19 08:30AM, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> For additional GUI goodness.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  git-gui--askyesno | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n> \n> diff --git a/git-gui--askyesno b/git-gui--askyesno\n> index 45b0260eff..c0c82e7cbd 100755\n> --- a/git-gui--askyesno\n> +++ b/git-gui--askyesno\n> @@ -52,5 +52,17 @@ proc yes {} {\n>  \texit 0\n>  }\n>  \n> +if {$::tcl_platform(platform) eq {windows}} {\n> +\tset icopath [file dirname [file normalize $argv0]]\n> +\tif {[file tail $icopath] eq {git-core}} {\n> +\t\tset icopath [file dirname $icopath]\n> +\t}\n> +\tset icopath [file dirname $icopath]\n> +\tset icopath [file join $icopath share git git-for-windows.ico]\n> +\tif {[file exists $icopath]} {\n> +\t\twm iconbitmap . -default $icopath\n> +\t}\n> +}\n> +\n>  wm title . $title\n>  tk::PlaceWindow .\n> -- \n> gitgitgadget\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"525091","messageId":"pull.358.v2.git.1756371530.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.git.gitgitgadget@gmail.com","subject":"[PATCH v2 0/4] git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-08-28T08:58:46Z","receivedAt":"2025-08-28T08:58:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This is another set of patches from Git for Windows' fork that have been\nsitting there since 2010, providing cross-platform GUI helpers to ask the\nuser a question or allow typing in a password.\n\nThis patch series was first submitted as\nhttps://github.com/patthoyts/git-gui/pull/5 which was ignored for almost\nthree years, then re-submitted as\nhttps://github.com/prati0100/git-gui/pull/3 which was rejected in favor of a\ncontribution by mail.\n\nThe patches are based on Git GUI's master branch at\nhttps://github.com/j6t/git-gui/.\n\nChanges since v1:\n\n * Rebased to current master branch of Git GUI, resolving merge conflicts.\n * Dropped double empty line.\n * Skip yes/no functions in favor of inline exit 0/exit 1.\n * The --title option is now documented in the git-gui--askyesno script.\n\nHeiko Voigt (1):\n  git-gui: provide question helper for retry fallback on Windows\n\nJohannes Schindelin (3):\n  git gui: set GIT_ASKPASS=git-gui--askpass if not set yet\n  git-gui--askyesno: allow overriding the window title\n  git-gui--askyesno (mingw): use Git for Windows' icon, if available\n\n Makefile          |  2 ++\n git-gui--askyesno | 63 +++++++++++++++++++++++++++++++++++++++++++++++\n git-gui.sh        |  6 +++++\n 3 files changed, 71 insertions(+)\n create mode 100755 git-gui--askyesno\n\n\nbase-commit: e3923e3e90da55e12545b5ef5aa34f21e97409d8\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-358%2Fdscho%2Fgit-gui-askpass-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-358/dscho/git-gui-askpass-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/358\n\nRange-diff vs v1:\n\n 1:  58972068a230 ! 1:  08b106ebedb9 git-gui: provide question helper for retry fallback on Windows\n     @@ git-gui--askyesno (new)\n      +}\n      +\n      +${NS}::frame .t\n     -+${NS}::label .t.m -text $prompt -justify center -width 400px\n     -+.t.m configure -wraplength 400px\n     ++${NS}::label .t.m -text $prompt -justify center -width 40\n     ++.t.m configure -wraplength 400\n      +pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1\n      +pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1\n      +\n      +${NS}::frame .b\n      +${NS}::frame .b.left -width 200\n     -+${NS}::button .b.yes -text Yes -command yes\n     -+${NS}::button .b.no  -text No  -command no\n     -+\n     ++${NS}::button .b.yes -text Yes -command {exit 0}\n     ++${NS}::button .b.no  -text No  -command {exit 1}\n      +\n      +pack .b.left -side left -expand 1 -fill x\n      +pack .b.yes -side left -expand 1\n     @@ git-gui--askyesno (new)\n      +bind . <Key-Return> {exit 0}\n      +bind . <Key-Escape> {exit 1}\n      +\n     -+proc no {} {\n     -+\texit 1\n     -+}\n     -+\n     -+proc yes {} {\n     -+\texit 0\n     -+}\n     -+\n      +wm title . \"Question?\"\n      +tk::PlaceWindow .\n      \n       ## git-gui.sh ##\n     -@@ git-gui.sh: set have_tk85 [expr {[package vcompare $tk_version \"8.5\"] >= 0}]\n     +@@ git-gui.sh: set argv0dir [file dirname [file normalize $::argv0]]\n       if {![info exists env(SSH_ASKPASS)]} {\n     - \tset env(SSH_ASKPASS) [gitexec git-gui--askpass]\n     + \tset env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]\n       }\n      +if {![info exists env(GIT_ASK_YESNO)]} {\n     -+\tset env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]\n     ++\tset env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]\n      +}\n     + unset argv0dir\n       \n       ######################################################################\n     - ##\n 2:  cb9f8c8158c5 ! 2:  e1aef533bfe8 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet\n     @@ Commit message\n          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n       ## git-gui.sh ##\n     -@@ git-gui.sh: set have_tk85 [expr {[package vcompare $tk_version \"8.5\"] >= 0}]\n     +@@ git-gui.sh: set argv0dir [file dirname [file normalize $::argv0]]\n       if {![info exists env(SSH_ASKPASS)]} {\n     - \tset env(SSH_ASKPASS) [gitexec git-gui--askpass]\n     + \tset env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]\n       }\n      +if {![info exists env(GIT_ASKPASS)]} {\n      +\tset env(GIT_ASKPASS) [gitexec git-gui--askpass]\n      +}\n       if {![info exists env(GIT_ASK_YESNO)]} {\n     - \tset env(GIT_ASK_YESNO) [gitexec git-gui--askyesno]\n     + \tset env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]\n       }\n 3:  8cfc935cdba3 ! 3:  2e7e2c1524a7 git-gui--askyesno: allow overriding the window title\n     @@ Commit message\n          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n       ## git-gui--askyesno ##\n     +@@ git-gui--askyesno: exec wish \"$0\" -- \"$@\"\n     + # This is an implementation of a simple yes no dialog\n     + # which is injected into the git commandline by git gui\n     + # in case a yesno question needs to be answered.\n     ++#\n     ++# The window title, which defaults to \"Question?\", can be\n     ++# overridden via the optional `--title` command-line\n     ++# option.\n     + \n     + set NS {}\n     + set use_ttk [package vsatisfies [package provide Tk] 8.5]\n      @@ git-gui--askyesno: if {$use_ttk} {\n       \tset NS ttk\n       }\n     @@ git-gui--askyesno: if {$use_ttk} {\n       \tset prompt [join $argv \" \"]\n       }\n       \n     -@@ git-gui--askyesno: proc yes {} {\n     - \texit 0\n     - }\n     +@@ git-gui--askyesno: pack .b -side bottom -fill x -ipadx 20 -ipady 15\n     + bind . <Key-Return> {exit 0}\n     + bind . <Key-Escape> {exit 1}\n       \n      -wm title . \"Question?\"\n      +wm title . $title\n 4:  6025b38d2659 ! 4:  4b04832c0b81 git-gui--askyesno (mingw): use Git for Windows' icon, if available\n     @@ Metadata\n       ## Commit message ##\n          git-gui--askyesno (mingw): use Git for Windows' icon, if available\n      \n     -    For additional GUI goodness.\n     +    This provides a unified look-and-feel in Git for Windows.\n      \n          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n      \n       ## git-gui--askyesno ##\n     -@@ git-gui--askyesno: proc yes {} {\n     - \texit 0\n     - }\n     +@@ git-gui--askyesno: pack .b -side bottom -fill x -ipadx 20 -ipady 15\n     + bind . <Key-Return> {exit 0}\n     + bind . <Key-Escape> {exit 1}\n       \n      +if {$::tcl_platform(platform) eq {windows}} {\n      +\tset icopath [file dirname [file normalize $argv0]]\n\n-- \ngitgitgadget\n"},{"id":"525092","messageId":"08b106ebedb90c0e25b0d6802bf5aa81cc9f2da0.1756371530.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.v2.git.1756371530.gitgitgadget@gmail.com","subject":"[PATCH v2 1/4] git-gui: provide question helper for retry fallback on Windows","fromName":"Heiko Voigt via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-08-28T08:58:47Z","receivedAt":"2025-08-28T08:58:54Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"From: Heiko Voigt <hvoigt@hvoigt.net>\n\nMake use of the new environment variable GIT_ASK_YESNO to support the\nrecently implemented fallback in case unlink, rename or rmdir fail for\nfiles in use on Windows. The added dialog will present a yes/no question\nto the the user which will currently be used by the windows compat layer\nto let the user retry a failed file operation.\n\nSigned-off-by: Heiko Voigt <hvoigt@hvoigt.net>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Makefile          |  2 ++\n git-gui--askyesno | 42 ++++++++++++++++++++++++++++++++++++++++++\n git-gui.sh        |  3 +++\n 3 files changed, 47 insertions(+)\n create mode 100755 git-gui--askyesno\n\ndiff --git a/Makefile b/Makefile\nindex 2cd160b05755..6385db443929 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -185,6 +185,7 @@ install: all\n \t$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)\n \t$(QUIET)$(INSTALL_X0)git-gui $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n \t$(QUIET)$(INSTALL_X0)git-gui--askpass $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n+\t$(QUIET)$(INSTALL_X0)git-gui--askyesno $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n \t$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(INSTALL_L0)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L1)'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' $(INSTALL_L2)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L3) &&) true\n ifdef GITGUI_WINDOWS_WRAPPER\n \t$(QUIET)$(INSTALL_R0)git-gui.tcl $(INSTALL_R1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n@@ -199,6 +200,7 @@ uninstall:\n \t$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(gitexecdir_SQ)'\n \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui $(REMOVE_F1)\n \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askpass $(REMOVE_F1)\n+\t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui--askyesno $(REMOVE_F1)\n \t$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/$p $(REMOVE_F1) &&) true\n ifdef GITGUI_WINDOWS_WRAPPER\n \t$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui.tcl $(REMOVE_F1)\ndiff --git a/git-gui--askyesno b/git-gui--askyesno\nnew file mode 100755\nindex 000000000000..f7312c70c2ca\n--- /dev/null\n+++ b/git-gui--askyesno\n@@ -0,0 +1,42 @@\n+#!/bin/sh\n+# Tcl ignores the next line -*- tcl -*- \\\n+exec wish \"$0\" -- \"$@\"\n+\n+# This is an implementation of a simple yes no dialog\n+# which is injected into the git commandline by git gui\n+# in case a yesno question needs to be answered.\n+\n+set NS {}\n+set use_ttk [package vsatisfies [package provide Tk] 8.5]\n+if {$use_ttk} {\n+\tset NS ttk\n+}\n+\n+if {$argc < 1} {\n+\tputs stderr \"Usage: $argv0 <question>\"\n+\texit 1\n+} else {\n+\tset prompt [join $argv \" \"]\n+}\n+\n+${NS}::frame .t\n+${NS}::label .t.m -text $prompt -justify center -width 40\n+.t.m configure -wraplength 400\n+pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1\n+pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1\n+\n+${NS}::frame .b\n+${NS}::frame .b.left -width 200\n+${NS}::button .b.yes -text Yes -command {exit 0}\n+${NS}::button .b.no  -text No  -command {exit 1}\n+\n+pack .b.left -side left -expand 1 -fill x\n+pack .b.yes -side left -expand 1\n+pack .b.no -side right -expand 1 -ipadx 5\n+pack .b -side bottom -fill x -ipadx 20 -ipady 15\n+\n+bind . <Key-Return> {exit 0}\n+bind . <Key-Escape> {exit 1}\n+\n+wm title . \"Question?\"\n+tk::PlaceWindow .\ndiff --git a/git-gui.sh b/git-gui.sh\nindex a931d7f7c990..1a4b73a3373a 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1130,6 +1130,9 @@ set argv0dir [file dirname [file normalize $::argv0]]\n if {![info exists env(SSH_ASKPASS)]} {\n \tset env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]\n }\n+if {![info exists env(GIT_ASK_YESNO)]} {\n+\tset env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]\n+}\n unset argv0dir\n \n ######################################################################\n-- \ngitgitgadget\n\n"},{"id":"525093","messageId":"e1aef533bfe89bfb87b1a83bf7c7375e6238b06f.1756371530.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.v2.git.1756371530.gitgitgadget@gmail.com","subject":"[PATCH v2 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-08-28T08:58:48Z","receivedAt":"2025-08-28T08:58:56Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-gui.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 1a4b73a3373a..63a6b7408639 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1130,6 +1130,9 @@ set argv0dir [file dirname [file normalize $::argv0]]\n if {![info exists env(SSH_ASKPASS)]} {\n \tset env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]\n }\n+if {![info exists env(GIT_ASKPASS)]} {\n+\tset env(GIT_ASKPASS) [gitexec git-gui--askpass]\n+}\n if {![info exists env(GIT_ASK_YESNO)]} {\n \tset env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]\n }\n-- \ngitgitgadget\n\n"},{"id":"525094","messageId":"2e7e2c1524a73b3c1aaf28baf5689be4093f62ed.1756371530.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.v2.git.1756371530.gitgitgadget@gmail.com","subject":"[PATCH v2 3/4] git-gui--askyesno: allow overriding the window title","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-08-28T08:58:49Z","receivedAt":"2025-08-28T08:58:56Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\n\"Question?\" is maybe not the most informative thing to ask. In the\nabsence of better information, it is the best we can do, of course.\n\nHowever, Git for Windows' auto updater just learned the trick to use\ngit-gui--askyesno to ask the user whether to update now or not. And in\nthis scripted scenario, we can easily pass a command-line option to\nchange the window title.\n\nSo let's support that with the new `--title <title>` option.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-gui--askyesno | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/git-gui--askyesno b/git-gui--askyesno\nindex f7312c70c2ca..d0c801c42c7c 100755\n--- a/git-gui--askyesno\n+++ b/git-gui--askyesno\n@@ -5,6 +5,10 @@ exec wish \"$0\" -- \"$@\"\n # This is an implementation of a simple yes no dialog\n # which is injected into the git commandline by git gui\n # in case a yesno question needs to be answered.\n+#\n+# The window title, which defaults to \"Question?\", can be\n+# overridden via the optional `--title` command-line\n+# option.\n \n set NS {}\n set use_ttk [package vsatisfies [package provide Tk] 8.5]\n@@ -12,10 +16,15 @@ if {$use_ttk} {\n \tset NS ttk\n }\n \n+set title \"Question?\"\n if {$argc < 1} {\n \tputs stderr \"Usage: $argv0 <question>\"\n \texit 1\n } else {\n+\tif {$argc > 2 && [lindex $argv 0] == \"--title\"} {\n+\t\tset title [lindex $argv 1]\n+\t\tset argv [lreplace $argv 0 1]\n+\t}\n \tset prompt [join $argv \" \"]\n }\n \n@@ -38,5 +47,5 @@ pack .b -side bottom -fill x -ipadx 20 -ipady 15\n bind . <Key-Return> {exit 0}\n bind . <Key-Escape> {exit 1}\n \n-wm title . \"Question?\"\n+wm title . $title\n tk::PlaceWindow .\n-- \ngitgitgadget\n\n"},{"id":"525095","messageId":"4b04832c0b8119b784806f54a2354d910965a523.1756371530.git.gitgitgadget@gmail.com","threadId":"51926","inReplyTo":"pull.358.v2.git.1756371530.gitgitgadget@gmail.com","subject":"[PATCH v2 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-08-28T08:58:50Z","receivedAt":"2025-08-28T08:58:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis provides a unified look-and-feel in Git for Windows.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-gui--askyesno | 12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/git-gui--askyesno b/git-gui--askyesno\nindex d0c801c42c7c..142d1bc3de22 100755\n--- a/git-gui--askyesno\n+++ b/git-gui--askyesno\n@@ -47,5 +47,17 @@ pack .b -side bottom -fill x -ipadx 20 -ipady 15\n bind . <Key-Return> {exit 0}\n bind . <Key-Escape> {exit 1}\n \n+if {$::tcl_platform(platform) eq {windows}} {\n+\tset icopath [file dirname [file normalize $argv0]]\n+\tif {[file tail $icopath] eq {git-core}} {\n+\t\tset icopath [file dirname $icopath]\n+\t}\n+\tset icopath [file dirname $icopath]\n+\tset icopath [file join $icopath share git git-for-windows.ico]\n+\tif {[file exists $icopath]} {\n+\t\twm iconbitmap . -default $icopath\n+\t}\n+}\n+\n wm title . $title\n tk::PlaceWindow .\n-- \ngitgitgadget\n"},{"id":"525103","messageId":"20250828133301.74328-1-mlevedahl@gmail.com","threadId":"51926","inReplyTo":"4b04832c0b8119b784806f54a2354d910965a523.1756371530.git.gitgitgadget@gmail.com","subject":"[PATCH] git-gui: use tk_messageBox for ask yes/no","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2025-08-28T13:33:01Z","receivedAt":"2025-08-28T13:33:40Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"git-gui includes git-gui--yesno that relies upon Tk 8.5 constructs, and\nthis dialog box is not supported with Tk 9.0.  Tk provides tk_messagebox\nfor this same purpose, fully supported in Tk 8.5+, so use tk_messagebox\ninstead.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n git-gui--askyesno | 35 +++++++----------------------------\n 1 file changed, 7 insertions(+), 28 deletions(-)\n\ndiff --git a/git-gui--askyesno b/git-gui--askyesno\nindex 142d1bc..cd986f2 100755\n--- a/git-gui--askyesno\n+++ b/git-gui--askyesno\n@@ -10,12 +10,6 @@ exec wish \"$0\" -- \"$@\"\n # overridden via the optional `--title` command-line\n # option.\n \n-set NS {}\n-set use_ttk [package vsatisfies [package provide Tk] 8.5]\n-if {$use_ttk} {\n-\tset NS ttk\n-}\n-\n set title \"Question?\"\n if {$argc < 1} {\n \tputs stderr \"Usage: $argv0 <question>\"\n@@ -28,25 +22,7 @@ if {$argc < 1} {\n \tset prompt [join $argv \" \"]\n }\n \n-${NS}::frame .t\n-${NS}::label .t.m -text $prompt -justify center -width 40\n-.t.m configure -wraplength 400\n-pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1\n-pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1\n-\n-${NS}::frame .b\n-${NS}::frame .b.left -width 200\n-${NS}::button .b.yes -text Yes -command {exit 0}\n-${NS}::button .b.no  -text No  -command {exit 1}\n-\n-pack .b.left -side left -expand 1 -fill x\n-pack .b.yes -side left -expand 1\n-pack .b.no -side right -expand 1 -ipadx 5\n-pack .b -side bottom -fill x -ipadx 20 -ipady 15\n-\n-bind . <Key-Return> {exit 0}\n-bind . <Key-Escape> {exit 1}\n-\n+set dlgicon {question}\n if {$::tcl_platform(platform) eq {windows}} {\n \tset icopath [file dirname [file normalize $argv0]]\n \tif {[file tail $icopath] eq {git-core}} {\n@@ -55,9 +31,12 @@ if {$::tcl_platform(platform) eq {windows}} {\n \tset icopath [file dirname $icopath]\n \tset icopath [file join $icopath share git git-for-windows.ico]\n \tif {[file exists $icopath]} {\n-\t\twm iconbitmap . -default $icopath\n+\t\tset dlgicon $icopath\n \t}\n }\n \n-wm title . $title\n-tk::PlaceWindow .\n+wm withdraw .\n+\n+option add *Dialog.msg.font {Sans 10}\n+set ans [tk_messageBox -icon $dlgicon -message $prompt -title $title -type yesno]\n+exit [expr $ans eq {no}]\n-- \n2.51.0.99.15\n\n"},{"id":"525105","messageId":"33e2ad25-cafa-66a4-7bde-056ebbf6a5d0@gmx.de","threadId":"51926","inReplyTo":"20250828133301.74328-1-mlevedahl@gmail.com","subject":"Re: [PATCH] git-gui: use tk_messageBox for ask yes/no","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2025-08-28T13:49:20Z","receivedAt":"2025-08-28T13:49:23Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Mark,\n\nOn Thu, 28 Aug 2025, Mark Levedahl wrote:\n\n> git-gui includes git-gui--yesno that relies upon Tk 8.5 constructs, and\n> this dialog box is not supported with Tk 9.0.  Tk provides tk_messagebox\n> for this same purpose, fully supported in Tk 8.5+, so use tk_messagebox\n> instead.\n\nThank you very much!\n\nLet's keep your patch separate, to give you full credit, and to keep\nHeiko's patch as close to the original that has survived in Git for\nWindows for so long.\n\nCiao,\nJohannes\n\n> \n> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>\n> ---\n>  git-gui--askyesno | 35 +++++++----------------------------\n>  1 file changed, 7 insertions(+), 28 deletions(-)\n> \n> diff --git a/git-gui--askyesno b/git-gui--askyesno\n> index 142d1bc..cd986f2 100755\n> --- a/git-gui--askyesno\n> +++ b/git-gui--askyesno\n> @@ -10,12 +10,6 @@ exec wish \"$0\" -- \"$@\"\n>  # overridden via the optional `--title` command-line\n>  # option.\n>  \n> -set NS {}\n> -set use_ttk [package vsatisfies [package provide Tk] 8.5]\n> -if {$use_ttk} {\n> -\tset NS ttk\n> -}\n> -\n>  set title \"Question?\"\n>  if {$argc < 1} {\n>  \tputs stderr \"Usage: $argv0 <question>\"\n> @@ -28,25 +22,7 @@ if {$argc < 1} {\n>  \tset prompt [join $argv \" \"]\n>  }\n>  \n> -${NS}::frame .t\n> -${NS}::label .t.m -text $prompt -justify center -width 40\n> -.t.m configure -wraplength 400\n> -pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1\n> -pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1\n> -\n> -${NS}::frame .b\n> -${NS}::frame .b.left -width 200\n> -${NS}::button .b.yes -text Yes -command {exit 0}\n> -${NS}::button .b.no  -text No  -command {exit 1}\n> -\n> -pack .b.left -side left -expand 1 -fill x\n> -pack .b.yes -side left -expand 1\n> -pack .b.no -side right -expand 1 -ipadx 5\n> -pack .b -side bottom -fill x -ipadx 20 -ipady 15\n> -\n> -bind . <Key-Return> {exit 0}\n> -bind . <Key-Escape> {exit 1}\n> -\n> +set dlgicon {question}\n>  if {$::tcl_platform(platform) eq {windows}} {\n>  \tset icopath [file dirname [file normalize $argv0]]\n>  \tif {[file tail $icopath] eq {git-core}} {\n> @@ -55,9 +31,12 @@ if {$::tcl_platform(platform) eq {windows}} {\n>  \tset icopath [file dirname $icopath]\n>  \tset icopath [file join $icopath share git git-for-windows.ico]\n>  \tif {[file exists $icopath]} {\n> -\t\twm iconbitmap . -default $icopath\n> +\t\tset dlgicon $icopath\n>  \t}\n>  }\n>  \n> -wm title . $title\n> -tk::PlaceWindow .\n> +wm withdraw .\n> +\n> +option add *Dialog.msg.font {Sans 10}\n> +set ans [tk_messageBox -icon $dlgicon -message $prompt -title $title -type yesno]\n> +exit [expr $ans eq {no}]\n> -- \n> 2.51.0.99.15\n> \n> \n> \n"},{"id":"525133","messageId":"816cd946-4f25-4ce8-aa06-6babf9e90751@kdbg.org","threadId":"51926","inReplyTo":"e1aef533bfe89bfb87b1a83bf7c7375e6238b06f.1756371530.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-08-28T17:44:44Z","receivedAt":"2025-08-28T17:44:53Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 28.08.25 um 10:58 schrieb Johannes Schindelin via GitGitGadget:\n> @@ -1130,6 +1130,9 @@ set argv0dir [file dirname [file normalize $::argv0]]\n>  if {![info exists env(SSH_ASKPASS)]} {\n>  \tset env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]\n>  }\n> +if {![info exists env(GIT_ASKPASS)]} {\n> +\tset env(GIT_ASKPASS) [gitexec git-gui--askpass]\n\nIs this [gitexec ...] deliberate, or can this be [file join ...] like in\nthe surrounding cases? If it is deliberate, we need an updated commit\nmessage and/or a comment, otherwise, I can amend locally while queuing.\n\n> +}\n>  if {![info exists env(GIT_ASK_YESNO)]} {\n>  \tset env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]\n>  }\n\n"},{"id":"525154","messageId":"d89cf43f-78c7-46df-878e-b12044c4aa5c@kdbg.org","threadId":"51926","inReplyTo":"20250828133301.74328-1-mlevedahl@gmail.com","subject":"Re: [PATCH] git-gui: use tk_messageBox for ask yes/no","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-08-28T21:18:43Z","receivedAt":"2025-08-28T21:18:52Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 28.08.25 um 15:33 schrieb Mark Levedahl:\n> git-gui includes git-gui--yesno that relies upon Tk 8.5 constructs, and\n\n/--yesno/--askyesno/? BTW, I wonder which constructs you mean.\n\n> this dialog box is not supported with Tk 9.0.  Tk provides tk_messagebox\n> for this same purpose, fully supported in Tk 8.5+, so use tk_messagebox\n> instead.\n\nWhich \"this dialog box\" do you mean here? The old code looks like a\nusual Tk main window to me.\n\n> \n> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>\n> ---\n>  git-gui--askyesno | 35 +++++++----------------------------\n>  1 file changed, 7 insertions(+), 28 deletions(-)\n> \n> diff --git a/git-gui--askyesno b/git-gui--askyesno\n> index 142d1bc..cd986f2 100755\n> --- a/git-gui--askyesno\n> +++ b/git-gui--askyesno\n> @@ -10,12 +10,6 @@ exec wish \"$0\" -- \"$@\"\n>  # overridden via the optional `--title` command-line\n>  # option.\n>  \n> -set NS {}\n> -set use_ttk [package vsatisfies [package provide Tk] 8.5]\n> -if {$use_ttk} {\n> -\tset NS ttk\n> -}\n> -\n>  set title \"Question?\"\n>  if {$argc < 1} {\n>  \tputs stderr \"Usage: $argv0 <question>\"\n> @@ -28,25 +22,7 @@ if {$argc < 1} {\n>  \tset prompt [join $argv \" \"]\n>  }\n>  \n> -${NS}::frame .t\n> -${NS}::label .t.m -text $prompt -justify center -width 40\n> -.t.m configure -wraplength 400\n> -pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1\n> -pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1\n> -\n> -${NS}::frame .b\n> -${NS}::frame .b.left -width 200\n> -${NS}::button .b.yes -text Yes -command {exit 0}\n> -${NS}::button .b.no  -text No  -command {exit 1}\n> -\n> -pack .b.left -side left -expand 1 -fill x\n> -pack .b.yes -side left -expand 1\n> -pack .b.no -side right -expand 1 -ipadx 5\n> -pack .b -side bottom -fill x -ipadx 20 -ipady 15\n> -\n> -bind . <Key-Return> {exit 0}\n> -bind . <Key-Escape> {exit 1}\n> -\n> +set dlgicon {question}\n>  if {$::tcl_platform(platform) eq {windows}} {\n>  \tset icopath [file dirname [file normalize $argv0]]\n>  \tif {[file tail $icopath] eq {git-core}} {\n> @@ -55,9 +31,12 @@ if {$::tcl_platform(platform) eq {windows}} {\n>  \tset icopath [file dirname $icopath]\n>  \tset icopath [file join $icopath share git git-for-windows.ico]\n>  \tif {[file exists $icopath]} {\n> -\t\twm iconbitmap . -default $icopath\n> +\t\tset dlgicon $icopath\n>  \t}\n>  }\n\nI think there is a misunderstanding what the purpose of this icon is. It\nis the icon shown on the window frame/decoration, not the icon next to\nthe text.\n\n>  \n> -wm title . $title\n> -tk::PlaceWindow .\n> +wm withdraw .\n> +\n> +option add *Dialog.msg.font {Sans 10}\n\nIs this to replicate the old appearance? I don't think it is necessary.\nLet's assume tk_messageBox does a sensible thing.\n\n> +set ans [tk_messageBox -icon $dlgicon -message $prompt -title $title -type yesno]\n\nThis option -icon can only be one of the words error, info, question or\nwarning. It has nothing to do with the icon above.\n\n> +exit [expr $ans eq {no}]\n\n-- Hannes\n\n"},{"id":"530805","messageId":"1295d263-e60d-0acb-91ef-9de888398840@gmx.de","threadId":"51926","inReplyTo":"816cd946-4f25-4ce8-aa06-6babf9e90751@kdbg.org","subject":"Re: [PATCH v2 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2025-11-17T14:03:09Z","receivedAt":"2025-11-17T14:03:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Hannes,\n\nOn Thu, 28 Aug 2025, Johannes Sixt wrote:\n\n> Am 28.08.25 um 10:58 schrieb Johannes Schindelin via GitGitGadget:\n> > @@ -1130,6 +1130,9 @@ set argv0dir [file dirname [file normalize $::argv0]]\n> >  if {![info exists env(SSH_ASKPASS)]} {\n> >  \tset env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]\n> >  }\n> > +if {![info exists env(GIT_ASKPASS)]} {\n> > +\tset env(GIT_ASKPASS) [gitexec git-gui--askpass]\n> \n> Is this [gitexec ...] deliberate, or can this be [file join ...] like in\n> the surrounding cases? If it is deliberate, we need an updated commit\n> message and/or a comment, otherwise, I can amend locally while queuing.\n\nSorry for the late reply. As you suspected (seeing as you changed it when\nintegrating sthe patch into your tree), it was just an artifact of\nhistory.\n\nThis patch entered Git for Windows back in the msysGit days, in\nhttps://github.com/msysgit/git/commit/1644f8ea0159 (2010-07-23), according\nto my records that corresponds to the v1.7.2.3.msysgit.0 timeframe, when\nthis block was surrounded by similar, `[gitexec]`-using code blocks.\n\nThe patch remained virtually unchanged until\nhttps://github.com/git-for-windows/git/commit/076c4bc42171 (2025-06-16),\nwhich still made it into v2.50.0.\n\nStarting with https://github.com/git-for-windows/git/commit/ab11df9a3899\n(2025-08-05), this block's context changed, and I must have changed the\nblock itself in reaction to it in Git for Windows (but I failed to miss it\nbefore sending the patch you reviewed). The patch made it into v2.51.0-rc0\nin that new shape, using `[file join ...]` instead of `[gitexec]`.\n\nLuckily, you made the very same adjustment before committing it as\nhttps://github.com/git/git/commit/aeaabebc1a10 (2025-08-28), so all is\ngood.\n\nCiao,\nJohannes\n\n> \n> > +}\n> >  if {![info exists env(GIT_ASK_YESNO)]} {\n> >  \tset env(GIT_ASK_YESNO) [file join $argv0dir git-gui--askyesno]\n> >  }\n> \n> \n"}]}