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

Re: Re: [PATCH] git-gui: give more advice when detaching HEAD

From
Jeff King <peff@peff.net>
Date
Feb 16, 2011, 03:46 UTC
Message-ID
<20110216034606.GA2414@sigill.intra.peff.net>
In-Reply-To
<20110215191620.GA56397@book.hvoigt.net>
On Tue, Feb 15, 2011 at 08:16:21PM +0100, Heiko Voigt wrote:
Show 11 quoted lines
> > It seems a little heavy-handed to have a dialog pop up for each commit.
> > It's not actually dangerous to create a commit on a detached HEAD; it's
> > just dangerous to _leave_ without referencing your new commits.
> 
> Hmm, how about adding a checkbox:
> 
>   [ ] Do not ask again
> 
> In my experience anything other than a popup will be overseen so I would
> suggest doing it at least once to prepare the user for the possible
> consequences.

Yeah, that's much better IMHO because at least clueful people can dismiss it after the first time.

Show 5 quoted lines
> IMO such a message is a good thing for the GUI regardless whether we
> implement the leaving detached HEAD state warning. First I think a
> typical GUI user does not commit on a detached head that often since
> there is currently no way to use these commits from the GUI (e.g.
> format-patch, rebase, ...).

Fair enough. I really have no idea what sorts of things gui users do, or how they perceive the system.

Show 6 quoted lines
> Second because a detached head is very practical for testing work on a
> remote branch the message box would remind most users to switch to
> their development branch first. If they only get that message after a
> series of commits it might become a hassle for them to get these
> commits onto another branch (remember no format-patch or rebase
> currently).
Good point.
Show 10 quoted lines
> > I do think a pop-up is appropriate when you try to check something else
> > out, and commits you have made on the detached HEAD are about to become
> > unreferenced. But this is something even the CLI doesn't do, so it would
> > make sense to see how the check is implemented there first before doing
> > anything in git-gui.
> 
> From what I read in this thread it currently seems to be not so easy to
> precisely find out whether some commit is referenced. (If we care about
> stuff outside of remotes, heads and tags). But maybe we do not need
> that for the GUI.

Yeah, I think there is still some question about how it should happen, and any check in the gui should probably be the same as in the cli. But from the rest of what you say, that shouldn't impact whether a per-commit warning is worth doing.

-Peff
Previous: Heiko VoigtNext: Heiko Voigt
Message 17 of 19 in “git-gui: give more advice when detaching HEAD”
  1. git-gui: give more advice when detaching HEADJeff King, Feb 12, 2011
  2. Junio C HamanoFeb 12, 2011
  3. Jeff KingFeb 12, 2011
  4. Junio C HamanoFeb 12, 2011
  5. Jeff KingFeb 12, 2011
  6. Junio C HamanoFeb 17, 2011
  7. Junio C HamanoFeb 12, 2011
  8. Sverre RabbelierFeb 13, 2011
  9. Johannes SixtFeb 13, 2011
  10. Junio C HamanoFeb 13, 2011
  11. Heiko VoigtFeb 13, 2011
  12. Jeff KingFeb 15, 2011
  13. Heiko VoigtFeb 15, 2011
  14. Pat ThoytsFeb 15, 2011
  15. Jeff KingFeb 16, 2011
  16. Heiko VoigtFeb 17, 2011
  17. Jeff KingFeb 16, 2011
  18. Heiko VoigtFeb 17, 2011
  19. Victor EngmarkFeb 16, 2011

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.