@matheusbsbs / matheus-bagliano / commits / fba6072ed8
Fork 0

git-gui: Move frequently used commands to the top of the context menu.

"Stage/Unstage Hunk" is probably the most frequently used command of the patch context menu *and* it is not available in some other form than the context menu. Therefore, it should go to the top. "Less Context" and "More Context" entries are also not easily available otherwise, and are therefore, moved second. The other entries are available via key strokes (Copy, Paste, Refresh) or rarly used (Font Size, Options) and can go last. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Johannes Sixt committed Dec 13, 2007 at 15:39 UTC fba6072ed83bfc3c0e1eb56f11476b06a3b0dfb7
1 file changed +21 -21
git-gui.sh
+21 -21
@@ -2541,6 +2541,27 @@ $ui_diff tag raise sel
2541 #
2542 set ctxm .vpane.lower.diff.body.ctxm
2543 menu $ctxm -tearoff 0
2544 +$ctxm add command \
2545 + -label [mc "Apply/Reverse Hunk"] \
2546 + -command {apply_hunk $cursorX $cursorY}
2547 +set ui_diff_applyhunk [$ctxm index last]
2548 +lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
2549 +$ctxm add separator
2550 +$ctxm add command \
2551 + -label [mc "Show Less Context"] \
2552 + -command {if {$repo_config(gui.diffcontext) >= 1} {
2553 + incr repo_config(gui.diffcontext) -1
2554 + reshow_diff
2555 + }}
2556 +lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2557 +$ctxm add command \
2558 + -label [mc "Show More Context"] \
2559 + -command {if {$repo_config(gui.diffcontext) < 99} {
2560 + incr repo_config(gui.diffcontext)
2561 + reshow_diff
2562 + }}
2563 +lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2564 +$ctxm add separator
2565 $ctxm add command \
2566 -label [mc Refresh] \
2567 -command reshow_diff
@@ -2562,12 +2583,6 @@ $ctxm add command \
2583 }
2584 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2585 $ctxm add separator
2565 -$ctxm add command \
2566 - -label [mc "Apply/Reverse Hunk"] \
2567 - -command {apply_hunk $cursorX $cursorY}
2568 -set ui_diff_applyhunk [$ctxm index last]
2569 -lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
2570 -$ctxm add separator
2586 $ctxm add command \
2587 -label [mc "Decrease Font Size"] \
2588 -command {incr_font_size font_diff -1}
@@ -2577,21 +2592,6 @@ $ctxm add command \
2592 -command {incr_font_size font_diff 1}
2593 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2594 $ctxm add separator
2580 -$ctxm add command \
2581 - -label [mc "Show Less Context"] \
2582 - -command {if {$repo_config(gui.diffcontext) >= 1} {
2583 - incr repo_config(gui.diffcontext) -1
2584 - reshow_diff
2585 - }}
2586 -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2587 -$ctxm add command \
2588 - -label [mc "Show More Context"] \
2589 - -command {if {$repo_config(gui.diffcontext) < 99} {
2590 - incr repo_config(gui.diffcontext)
2591 - reshow_diff
2592 - }}
2593 -lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2594 -$ctxm add separator
2595 $ctxm add command -label [mc "Options..."] \
2596 -command do_options
2597 proc popup_diff_menu {ctxm x y X Y} {