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

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

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Dec 13, 2007, 14:39 UTC
Message-ID
<47614419.3050604@viscovery.net>
In-Reply-To
<Pine.LNX.4.64.0712131417110.27959@racer.site>
From: Johannes Sixt <johannes.sixt@telecom.at>

"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>
---
 Johannes Schindelin schrieb:
 > On Thu, 13 Dec 2007, Johannes Sixt wrote:
 >> It's probably sufficient to have an option "Stage this Line": Once you
 >> have staged enough lines, the hunk will be split automatically by the
 >> current number-of-context-lines setting.
 >
 > And your hand falls off... ;-)
 Not with this patch.
 And, obviously, "Stage this Line" is accompanied by "Unstage this Line".
 So when you want to stage a lot *except* one line, then you better
 stage the lot, then *unstage* one line.
 -- Hannes
 PS: Warning, Shawn: [ab]/git-gui.sh below is forged; you won't have
 blob 95b9537.
 git-gui.sh |   42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 95b9537..8e3751f 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2542,6 +2542,27 @@ $ui_diff tag raise sel
 set ctxm .vpane.lower.diff.body.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
+	-label [mc "Apply/Reverse Hunk"] \
+	-command {apply_hunk $cursorX $cursorY}
+set ui_diff_applyhunk [$ctxm index last]
+lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
+$ctxm add separator
+$ctxm add command \
+	-label [mc "Show Less Context"] \
+	-command {if {$repo_config(gui.diffcontext) >= 1} {
+		incr repo_config(gui.diffcontext) -1
+		reshow_diff
+	}}
+lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
+$ctxm add command \
+	-label [mc "Show More Context"] \
+	-command {if {$repo_config(gui.diffcontext) < 99} {
+		incr repo_config(gui.diffcontext)
+		reshow_diff
+	}}
+lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
+$ctxm add separator
+$ctxm add command \
 	-label [mc Refresh] \
 	-command reshow_diff
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
@@ -2563,12 +2584,6 @@ $ctxm add command \
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
 $ctxm add command \
-	-label [mc "Apply/Reverse Hunk"] \
-	-command {apply_hunk $cursorX $cursorY}
-set ui_diff_applyhunk [$ctxm index last]
-lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
-$ctxm add separator
-$ctxm add command \
 	-label [mc "Decrease Font Size"] \
 	-command {incr_font_size font_diff -1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
@@ -2577,21 +2592,6 @@ $ctxm add command \
 	-command {incr_font_size font_diff 1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
-$ctxm add command \
-	-label [mc "Show Less Context"] \
-	-command {if {$repo_config(gui.diffcontext) >= 1} {
-		incr repo_config(gui.diffcontext) -1
-		reshow_diff
-	}}
-lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
-$ctxm add command \
-	-label [mc "Show More Context"] \
-	-command {if {$repo_config(gui.diffcontext) < 99} {
-		incr repo_config(gui.diffcontext)
-		reshow_diff
-	}}
-lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
-$ctxm add separator
 $ctxm add command -label [mc "Options..."] \
 	-command do_options
 proc popup_diff_menu {ctxm x y X Y} {
-- 
1.5.3.7.1929.gf9f0a
Previous: Johannes SchindelinNext: Shawn O. Pearce
Message 27 of 31 in “[ANNOUNCE] ugit: a pyqt-based git gui // was: Re: If you would write git from scratch now, what would you change?”
  1. DavidDec 11, 2007
  2. Marco CostalbaDec 11, 2007
  3. Jason SewallDec 11, 2007
  4. Marco CostalbaDec 11, 2007
  5. DavidDec 11, 2007
  6. Jason SewallDec 11, 2007
  7. Shawn O. PearceDec 12, 2007
  8. Jason SewallDec 12, 2007
  9. Shawn O. PearceDec 12, 2007
  10. Jason SewallDec 12, 2007
  11. Johannes SchindelinDec 12, 2007
  12. Jason SewallDec 12, 2007
  13. Teach git-gui to split hunksJohannes Schindelin, Dec 12, 2007
  14. Junio C HamanoDec 12, 2007
  15. Johannes SchindelinDec 12, 2007
  16. Jean-François VeilletteDec 12, 2007
  17. Junio C HamanoDec 12, 2007
  18. Wincent ColaiutaDec 12, 2007
  19. Johannes SixtDec 13, 2007
  20. Shawn O. PearceDec 13, 2007
  21. Johannes SchindelinDec 13, 2007
  22. Junio C HamanoDec 13, 2007
  23. Johannes SixtDec 13, 2007
  24. Johannes SchindelinDec 13, 2007
  25. Johannes SixtDec 13, 2007
  26. Johannes SchindelinDec 13, 2007
  27. git-gui: Move frequently used commands to the top of the context menu.Johannes Sixt, Dec 13, 2007
  28. Shawn O. PearceDec 14, 2007
  29. Alex RiesenDec 11, 2007
  30. Steffen ProhaskaDec 11, 2007
  31. Jakub NarebskiDec 12, 2007

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.