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

Re: [PATCH 3/4] git-gui--askyesno: allow overriding the window title

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Sep 29, 2019, 17:31 UTC
Message-ID
<20190929173135.3swz2canehtoxkcf@yadavpratyush.com>
In-Reply-To
<8cfc935cdba316f513f2408c1f39c5d68d5258fc.1569511793.git.gitgitgadget@gmail.com>

One minor nitpick: please add a comment at the top of the file documenting the `--title` option, and the usage of the program in general.

Other than that, looks good. Thanks.
On 26/09/19 08:29AM, Johannes Schindelin via GitGitGadget wrote:
Show 31 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> "Question?" is maybe not the most informative thing to ask. In the
> absence of better information, it is the best we can do, of course.
> 
> However, Git for Windows' auto updater just learned the trick to use
> git-gui--askyesno to ask the user whether to update now or not. And in
> this scripted scenario, we can easily pass a command-line option to
> change the window title.
> 
> So let's support that with the new `--title <title>` option.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  git-gui--askyesno | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/git-gui--askyesno b/git-gui--askyesno
> index cf9c990d09..45b0260eff 100755
> --- a/git-gui--askyesno
> +++ b/git-gui--askyesno
> @@ -12,10 +12,15 @@ if {$use_ttk} {
>  	set NS ttk
>  }
>  
> +set title "Question?"
>  if {$argc < 1} {
>  	puts stderr "Usage: $argv0 <question>"
>  	exit 1
>  } else {
> +	if {$argc > 2 && [lindex $argv 0] == "--title"} {

While this is probably not the most robust way of handling command line arguments, I guess it doesn't really make too much of a difference for something this simple.

Show 16 quoted lines
> +		set title [lindex $argv 1]
> +		set argv [lreplace $argv 0 1]
> +	}
>  	set prompt [join $argv " "]
>  }
>  
> @@ -47,5 +52,5 @@ proc yes {} {
>  	exit 0
>  }
>  
> -wm title . "Question?"
> +wm title . $title
>  tk::PlaceWindow .
> -- 
> gitgitgadget
> 
-- 
Regards,
Pratyush Yadav
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 7 of 19 in “git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows”
  1. 0/4 git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for WindowsJohannes Schindelin via GitGitGadget, Sep 26, 2019
  2. 1/4 git-gui: provide question helper for retry fallback on WindowsHeiko Voigt via GitGitGadget, Sep 26, 2019
  3. Pratyush YadavSep 29, 2019
  4. 2/4 git gui: set GIT_ASKPASS=git-gui--askpass if not set yetJohannes Schindelin via GitGitGadget, Sep 26, 2019
  5. Pratyush YadavSep 29, 2019
  6. 3/4 git-gui--askyesno: allow overriding the window titleJohannes Schindelin via GitGitGadget, Sep 26, 2019
  7. Pratyush YadavSep 29, 2019
  8. 4/4 git-gui--askyesno (mingw): use Git for Windows' icon, if availableJohannes Schindelin via GitGitGadget, Sep 26, 2019
  9. Pratyush YadavSep 29, 2019
  10. 0/4 git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for WindowsJohannes Schindelin via GitGitGadget, Aug 28, 2025
  11. 1/4 git-gui: provide question helper for retry fallback on WindowsHeiko Voigt via GitGitGadget, Aug 28, 2025
  12. 2/4 git gui: set GIT_ASKPASS=git-gui--askpass if not set yetJohannes Schindelin via GitGitGadget, Aug 28, 2025
  13. Johannes SixtAug 28, 2025
  14. Johannes SchindelinNov 17, 2025
  15. 3/4 git-gui--askyesno: allow overriding the window titleJohannes Schindelin via GitGitGadget, Aug 28, 2025
  16. 4/4 git-gui--askyesno (mingw): use Git for Windows' icon, if availableJohannes Schindelin via GitGitGadget, Aug 28, 2025
  17. git-gui: use tk_messageBox for ask yes/noMark Levedahl, Aug 28, 2025
  18. Johannes SchindelinAug 28, 2025
  19. Johannes SixtAug 28, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.