Skip to content

Commit

Permalink
gitk: Disable checkout of remote branches
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sitaram Chamarty authored and Paul Mackerras committed Nov 14, 2009
1 parent 51a7e8b commit 70a5fc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 70a5fc4

Please sign in to comment.