Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] gitk: disable checkout of remote branch

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:58

Sitaram Chamarty [off-list ref] writes:
At the command line, this gives you a detailed warning message, but the
GUI currently allows it without any fuss.

Since the GUI is often used by people much less familiar with git, it
seems reasonable to make the GUI more restrictive than the command line,
not less.
...
This patch helps me a lot.
The patch seems to disable checkout unconditionally, but it at least needs
an "expert mode" switch to bypass the patch's logic, or (better yet) a
"training wheel" switch for you to set in repositories of the people you
manage.
quoted hunk
diff --git a/gitk-git/gitk b/gitk-git/gitk
old mode 100644
new mode 100755
index 8c66d17..411bc52
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
The above should ideally read:
quoted hunk
diff --git a/gitk b/gitk
index 8c66d17..411bc52
--- a/gitk
+++ b/gitk
if the patch goes to Paulus.
quoted hunk
@@ -8770,6 +8770,9 @@ proc headmenu {x y id head} {
     set headmenuid $id
     set headmenuhead $head
     set state normal
+    if {[string match "remotes/*" $head]} {
+	set state disabled
+    }
     if {$head eq $mainhead} {
 	set state disabled
     }
-- 
1.6.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help