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

[PATCH v2 git-gui] git-gui--askpass: Do not hang on exit

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 4, 2010, 21:24 UTC
Message-ID
<20100704212439.GA1765@burratino>
In-Reply-To
<20100704212125.GA1613@burratino>
Anders Kaseorg wrote:
> When git-gui--askpass is manually copied from the source into
> /usr/lib/git-core, though, it doesn’t particularly work; its window
> just freezes after the password is typed.
The problem seems to be the
  bind . <Destroy>    {exit $::rc}

line; apparently each exit causes the window to be destroyed again, resulting in git gui hanging.

Reported-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 I wrote:
 > @@ -52,7 +52,9 @@ proc finish {} {
 >  
 >  	set ::rc 0
 >  	puts $::answer
 > +	bind . <Destroy> {}
 >  	destroy .
 but that does nothing to help the case when the destroy event
 comes from the window manager.  Here’s a saner patch (sorry for
 the noise).
diff --git a/git-gui--askpass b/git-gui--askpass
index 12e117e..20b8799 100755
--- a/git-gui--askpass
+++ b/git-gui--askpass
@@ -39,7 +39,10 @@ pack .b -side bottom -fill x -padx 10 -pady 10
 bind . <Visibility> {focus -force .e}
 bind . <Key-Return> finish
 bind . <Key-Escape> {destroy .}
-bind . <Destroy>    {exit $rc}
+bind . <Destroy>    {
+	bind . <Destroy> {}
+	exit $::rc
+}
 
 proc finish {} {
 	if {$::yesno} {
Previous: Jonathan NiederNext: Pat Thoyts
Message 2 of 6 in “git-gui--askpass: Do not hang on exit”
  1. git-gui--askpass: Do not hang on exitJonathan Nieder, Jul 4, 2010
  2. git-gui--askpass: Do not hang on exitJonathan Nieder, Jul 4, 2010
  3. git-gui: change the termination checks to avoid potential hang.Pat Thoyts, Aug 14, 2010
  4. Jonathan NiederAug 18, 2010
  5. Pat ThoytsAug 18, 2010
  6. Pat ThoytsAug 15, 2010

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.