Skip to content

Commit ec7424e

Browse files
birgerspprati0100
authored andcommitted
git-gui: add hotkey to toggle "Amend Last Commit"
Selecting whether to "Amend Last Commit" or not does not have a hotkey. With this patch, the user may toggle between the two options with CTRL/CMD+e. Signed-off-by: Birger Skogeng Pedersen <[email protected]> Rebased-by: Bert Wesarg <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
1 parent ba41b5b commit ec7424e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

git-gui.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,6 +2664,12 @@ proc focus_widget {widget} {
26642664
}
26652665
}
26662666
2667+
proc toggle_commit_type {} {
2668+
global commit_type_is_amend
2669+
set commit_type_is_amend [expr !$commit_type_is_amend]
2670+
do_select_commit_type
2671+
}
2672+
26672673
######################################################################
26682674
##
26692675
## ui construction
@@ -2854,6 +2860,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
28542860
if {![is_enabled nocommit]} {
28552861
.mbar.commit add checkbutton \
28562862
-label [mc "Amend Last Commit"] \
2863+
-accelerator $M1T-E \
28572864
-variable commit_type_is_amend \
28582865
-command do_select_commit_type
28592866
lappend disable_on_lock \
@@ -3892,6 +3899,8 @@ bind . <$M1B-Key-j> do_revert_selection
38923899
bind . <$M1B-Key-J> do_revert_selection
38933900
bind . <$M1B-Key-i> do_add_all
38943901
bind . <$M1B-Key-I> do_add_all
3902+
bind . <$M1B-Key-e> toggle_commit_type
3903+
bind . <$M1B-Key-E> toggle_commit_type
38953904
bind . <$M1B-Key-minus> {show_less_context;break}
38963905
bind . <$M1B-Key-KP_Subtract> {show_less_context;break}
38973906
bind . <$M1B-Key-equal> {show_more_context;break}

0 commit comments

Comments
 (0)