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

[PATCH] git-gui: ssh-askpass: add a checkbox to show the input text

From
David Aguilar <davvid@gmail.com>
Date
Nov 7, 2020, 22:20 UTC
Message-ID
<20201107222039.13900-1-davvid@gmail.com>

Hide the input text by default since the field is commonly used for sensative informations such as passwords.

Add a "Show input" checkbox to conditionally show the input.
Helped-by: Miguel Boekhold <miguel.boekhold@osudio.com>
Signed-off-by: Efimov Vasily <laer.18@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-gui--askpass | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
This patch gathers the submissions from the following sources:

https://github.com/patthoyts/git-gui/issues/22 https://github.com/prati0100/git-gui/pull/38 https://github.com/git-cola/git-cola/issues/1004 https://github.com/git-cola/git-cola/pull/1069

diff --git a/git-gui--askpass b/git-gui--askpass
index 1c99ee8..71a536d 100755
--- a/git-gui--askpass
+++ b/git-gui--askpass
@@ -26,8 +26,21 @@ pack .m -side top -fill x -padx 20 -pady 20 -expand 1
 entry .e -textvariable answer -width 50
 pack .e -side top -fill x -padx 10 -pady 10
 
+proc on_show_input_changed {args} {
+	global show_input
+	if {$show_input} {
+		.e configure -show ""
+	} else {
+		.e configure -show "*"
+	}
+}
+trace add variable show_input write "on_show_input_changed"
+
+set show_input 0
+
 if {!$yesno} {
-	.e configure -show "*"
+	checkbutton .cb_show -text "Show input" -variable show_input
+	pack .cb_show -side top -anchor nw
 }
 
 frame .b
-- 
2.29.2.154.g7f7ebe054a
Next: Pratyush Yadav
Message 1 of 2 in “git-gui: ssh-askpass: add a checkbox to show the input text”
  1. git-gui: ssh-askpass: add a checkbox to show the input textDavid Aguilar, Nov 7, 2020
  2. Pratyush YadavDec 1, 2020

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.