Skip to content

Commit b677c66

Browse files
Vitaly _Vi Shukelaspearce
authored andcommitted
git-gui: Add hotkeys for "Unstage from commit" and "Revert changes"
Signed-off-by: Vitaly _Vi Shukela <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 54350a2 commit b677c66

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git-gui.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,12 +2543,14 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
25432543
[list .mbar.commit entryconf [.mbar.commit index last] -state]
25442544
25452545
.mbar.commit add command -label [mc "Unstage From Commit"] \
2546-
-command do_unstage_selection
2546+
-command do_unstage_selection \
2547+
-accelerator $M1T-U
25472548
lappend disable_on_lock \
25482549
[list .mbar.commit entryconf [.mbar.commit index last] -state]
25492550
25502551
.mbar.commit add command -label [mc "Revert Changes"] \
2551-
-command do_revert_selection
2552+
-command do_revert_selection \
2553+
-accelerator $M1T-J
25522554
lappend disable_on_lock \
25532555
[list .mbar.commit entryconf [.mbar.commit index last] -state]
25542556
@@ -3296,6 +3298,10 @@ unset gws
32963298
bind $ui_comm <$M1B-Key-Return> {do_commit;break}
32973299
bind $ui_comm <$M1B-Key-t> {do_add_selection;break}
32983300
bind $ui_comm <$M1B-Key-T> {do_add_selection;break}
3301+
bind $ui_comm <$M1B-Key-u> {do_unstage_selection;break}
3302+
bind $ui_comm <$M1B-Key-U> {do_unstage_selection;break}
3303+
bind $ui_comm <$M1B-Key-j> {do_revert_selection;break}
3304+
bind $ui_comm <$M1B-Key-J> {do_revert_selection;break}
32993305
bind $ui_comm <$M1B-Key-i> {do_add_all;break}
33003306
bind $ui_comm <$M1B-Key-I> {do_add_all;break}
33013307
bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break}

0 commit comments

Comments
 (0)