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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 21, 2009, 23:27 UTC
Message-ID
<7vtz29p3qm.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090622063405.6117@nanako3.lavabit.com>
Nanako Shiraishi <nanako3@lavabit.com> writes:
Show 22 quoted lines
> Quoting Junio C Hamano <gitster@pobox.com>:
>
>> Sitaram Chamarty <sitaramc@gmail.com> 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.
>
> It will be more helpful if it checked out a new local branch that tracks
> the remote branch, instead of refusing what the user asked to do. It may
> need a new dialog that asks to confirm (and allows the user to change)
> the name of the new branch.

Heh, stop, step back and think a bit. I admit that it wasn't just you; we were both blind.

If we unconditionally disable "check out this branch" from the context sensitive menu for the tip of a remote tracking branch, I do not think we lose anything. If one wants to start a new local branch from there, one can use the context sensitive menu for an arbitrary commit (rowmenu) and say "Create new branch".

If we wanted users of gitk to use it to detach HEAD, the current UI is not a good way to do so anyway --- it only allows detaching the tip of remote tracking branches and not an arbitrary commit.

	Side note.  I am not arguing it is a good idea.  I am only saying
	that if it were a good idea, such an action should be in rowmenu
	that applies to any commit, not headmenu that applies only to the
	tips of refs. 

So I retract my earlier objection entirely. I do not think the feature Sitaram is disabling was meant to allow detaching HEAD at all and it can be safely disabled for remote tracking branches to make the GUI experience safer.

Previous: Nanako ShiraishiNext: Sitaram Chamarty
Message 6 of 9 in “Please pull gitk master branch”
  1. Paul MackerrasJun 20, 2009
  2. gitk: disable checkout of remote branchSitaram Chamarty, Jun 21, 2009
  3. Junio C HamanoJun 21, 2009
  4. Sitaram ChamartyJun 21, 2009
  5. Nanako ShiraishiJun 21, 2009
  6. Junio C HamanoJun 21, 2009
  7. Sitaram ChamartyJun 22, 2009
  8. gitk: disable checkout of remote branchSitaram Chamarty, Jun 22, 2009
  9. Junio C HamanoJun 21, 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.