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

[PATCH] gitk: disable checkout of remote branch

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Nov 3, 2009, 16:00 UTC
Message-ID
<2e24e5b90911030800j22b00372r99a56c3f847a3644@mail.gmail.com>

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 prevents a lot of detached HEAD commits by new users.
Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
---
 gitk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index db5ec54..95e27d4 100755
--- 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
     }
-- 
1.6.5
Next: Sverre Rabbelier
Message 1 of 14 in “gitk: disable checkout of remote branch”
  1. gitk: disable checkout of remote branchSitaram Chamarty, Nov 3, 2009
  2. Sverre RabbelierNov 3, 2009
  3. Tim MazidNov 4, 2009
  4. Sitaram ChamartyNov 4, 2009
  5. Tim MazidNov 4, 2009
  6. Sverre RabbelierNov 4, 2009
  7. Jeff KingNov 4, 2009
  8. Tim MazidNov 4, 2009
  9. Sitaram ChamartyNov 4, 2009
  10. Junio C HamanoNov 4, 2009
  11. Jeff KingNov 5, 2009
  12. Junio C HamanoNov 6, 2009
  13. Sverre RabbelierNov 6, 2009
  14. Paul MackerrasNov 14, 2009

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.