Code

gitk: Disable checkout of remote branches
authorSitaram Chamarty <sitaramc@gmail.com>
Tue, 3 Nov 2009 16:00:12 +0000 (21:30 +0530)
committerPaul Mackerras <paulus@samba.org>
Sat, 14 Nov 2009 10:19:11 +0000 (21:19 +1100)
At the command line, trying to check out a remote branch gives you a
detailed warning message, but the gitk 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 prevents a lot of detached HEAD commits by new users.

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk

diff --git a/gitk b/gitk
index 61771bd05cdb33f59458a192ff84e59b85a4ef2c..5f065457633b592ab83df192ad4bcdb27c006111 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -8897,6 +8897,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
     }