git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* preventing checking out remote branch in gitk
@ 2009-06-05 15:21 Sitaram Chamarty
  2009-06-06  4:06 ` [PATCH] gitk: disable checkout of remote branch Sitaram Chamarty
  0 siblings, 1 reply; 2+ messages in thread
From: Sitaram Chamarty @ 2009-06-05 15:21 UTC (permalink / raw)
  To: git

Hello,

I have a fair number of new users, mostly refugees from VSS
and SVN, and they do use the GUIs a fair bit.

And they keep doing this :-)  I know what you're thinking:
teach them not to do it...

But doing this at the command line gives you a nice warning,
and a GUI is (like it or not) considered more "safe" (aka
less powerful).  So it should go one better and just refuse
:-)

Is there any way we can disable "Checkout this branch" for
branches that are not local in gitk?  I'm willing to play
around with the code and test it if someone can give me a
couple of pointers at least.

Thanks,

Sitaram

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] gitk: disable checkout of remote branch
  2009-06-05 15:21 preventing checking out remote branch in gitk Sitaram Chamarty
@ 2009-06-06  4:06 ` Sitaram Chamarty
  0 siblings, 0 replies; 2+ messages in thread
From: Sitaram Chamarty @ 2009-06-06  4:06 UTC (permalink / raw)
  To: git

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>
---

I have a lot of new users, and I'd really appreciate it if
someone could review (hey it's my first Tcl code in all my
life!) and approve; this will save me a whole boatload of
trouble :-)

If someone disagrees with the logic that the GUI should be
more "safe" than the command line please do let me know.

 gitk-git/gitk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 gitk-git/gitk

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
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-06  4:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-05 15:21 preventing checking out remote branch in gitk Sitaram Chamarty
2009-06-06  4:06 ` [PATCH] gitk: disable checkout of remote branch Sitaram Chamarty

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).