Skip to content

Commit 1924d64

Browse files
committed
Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui: git-gui: Save geometry before the window layout is damaged git-gui: Give amend precedence to HEAD over MERGE_MSG git-gui: Include 'war on whitespace' fixes from git.git
2 parents 75d8ff1 + 03e1bed commit 1924d64

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

git-gui/git-gui.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ proc rescan {after {honor_trustmtime 1}} {
494494

495495
if {![$ui_comm edit modified]
496496
|| [string trim [$ui_comm get 0.0 end]] eq {}} {
497-
if {[load_message GITGUI_MSG]} {
497+
if {[string match amend* $commit_type]} {
498+
} elseif {[load_message GITGUI_MSG]} {
498499
} elseif {[load_message MERGE_MSG]} {
499500
} elseif {[load_message SQUASH_MSG]} {
500501
}
@@ -1657,7 +1658,7 @@ unset browser doc_path doc_url
16571658

16581659
# -- Standard bindings
16591660
#
1660-
bind . <Destroy> {if {{%W} eq {.}} do_quit}
1661+
wm protocol . WM_DELETE_WINDOW do_quit
16611662
bind all <$M1B-Key-q> do_quit
16621663
bind all <$M1B-Key-Q> do_quit
16631664
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}

git-gui/lib/blame.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ constructor new {i_commit i_path} {
289289

290290
bind $w_cviewer <Button-1> [list focus $w_cviewer]
291291
bind $top <Visibility> [list focus $top]
292-
bind $w_file <Destroy> [list delete_this $this]
293292

294293
grid configure $w.header -sticky ew
295294
grid configure $w.file_pane -sticky nsew

git-gui/lib/branch_rename.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ constructor dialog {} {
6060
$w.rename.newname_t icursor end
6161
focus $w.rename.newname_t
6262
"
63-
bind $w.header <Destroy> [list delete_this $this]
6463
tkwait window $w
6564
}
6665

git-gui/lib/browser.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ constructor new {commit} {
7070
bind $w_list <Right> break
7171

7272
bind $w_list <Visibility> [list focus $w_list]
73-
bind $w_list <Destroy> [list delete_this $this]
7473
set w $w_list
7574
_ls $this $browser_commit
7675
return $this

git-gui/lib/class.tcl

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,21 @@ proc delete_this {{t {}}} {
120120
if {[namespace exists $t]} {namespace delete $t}
121121
}
122122

123-
proc make_toplevel {t w} {
124-
upvar $t top $w pfx
123+
proc make_toplevel {t w args} {
124+
upvar $t top $w pfx this this
125+
126+
if {[llength $args] % 2} {
127+
error "make_toplevel topvar winvar {options}"
128+
}
129+
set autodelete 1
130+
foreach {name value} $args {
131+
switch -exact -- $name {
132+
-autodelete {set autodelete $value}
133+
default {error "unsupported option $name"}
134+
}
135+
}
136+
125137
if {[winfo ismapped .]} {
126-
upvar this this
127138
regsub -all {::} $this {__} w
128139
set top .$w
129140
set pfx $top
@@ -132,6 +143,13 @@ proc make_toplevel {t w} {
132143
set top .
133144
set pfx {}
134145
}
146+
147+
if {$autodelete} {
148+
wm protocol $top WM_DELETE_WINDOW "
149+
[list delete_this $this]
150+
[list destroy $top]
151+
"
152+
}
135153
}
136154

137155

git-gui/lib/console.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ constructor new {short_title long_title} {
1717

1818
method _init {} {
1919
global M1B
20-
make_toplevel top w
20+
make_toplevel top w -autodelete 0
2121
wm title $top "[appname] ([reponame]): $t_short"
2222
set console_cr 1.0
2323

git-gui/lib/merge.tcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ Please select fewer branches. To merge more than 15 branches, merge the branche
125125
set cons [console::new "Merge" $msg]
126126
console::exec $cons $cmd \
127127
[namespace code [list _finish $revcnt $cons]]
128-
bind $w <Destroy> {}
128+
129+
wm protocol $w WM_DELETE_WINDOW {}
129130
destroy $w
130131
}
131132

@@ -250,7 +251,7 @@ proc dialog {} {
250251
bind $w <$M1B-Key-Return> $_start
251252
bind $w <Visibility> "grab $w; focus $w.source.l"
252253
bind $w <Key-Escape> "unlock_index;destroy $w"
253-
bind $w <Destroy> unlock_index
254+
wm protocol $w WM_DELETE_WINDOW "unlock_index;destroy $w"
254255
wm title $w "[appname] ([reponame]): Merge"
255256
tkwait window $w
256257
}

git-gui/lib/remote_branch_delete.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ constructor dialog {} {
131131
bind $w <$M1B-Key-R> [cb _rescan]
132132
bind $w <Key-Return> [cb _delete]
133133
bind $w <Key-Escape> [list destroy $w]
134-
bind $w.header <Destroy> [list delete_this $this]
135134
return $w
136135
}
137136

0 commit comments

Comments
 (0)