Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 1/2] git-gui: fetch/prune all entry only for more than one entry

From: Pat Thoyts <hidden>
Date: 2016-06-15 22:50:38

Heiko Voigt [off-list ref] writes:
quoted hunk
In case there is only one remote a fetch/prune all entry
is redundant.

Signed-off-by: Heiko Voigt <redacted>
---

On Tue, Feb 22, 2011 at 07:36:23PM +0100, Jens Lehmann wrote:
quoted
1) It would be nice if the new menu entry would only appear when there
   is more than one remote to fetch from.
How about this? Disclaimer: Only superficially tested on OSX.

lib/remote.tcl |    4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/remote.tcl b/lib/remote.tcl
index 42d2061..18d3d06 100644
--- a/lib/remote.tcl
+++ b/lib/remote.tcl
@@ -237,13 +237,13 @@ proc update_all_remotes_menu_entry {} {
	set have_remote 0
	foreach r $all_remotes {
-		set have_remote 1
+		incr have_remote
	}

	set remote_m .mbar.remote
	set fetch_m $remote_m.fetch
	set prune_m $remote_m.prune
-	if {$have_remote} {
+	if {$have_remote > 1} {
		make_sure_remote_submenues_exist $remote_m
		set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
		if {[$fetch_m entrycget $index -label] ne "All"} {
This is fine - applied and checked it on Windows.
I'll add a Suggested-by from Jens as this was a response to his request.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help