Re: [PATCH] git-gui: give more advice when detaching HEAD
- From
Jeff King <peff@peff.net>
- Date
- Feb 16, 2011, 03:50 UTC
- Message-ID
- <20110216035032.GB2414@sigill.intra.peff.net>
- In-Reply-To
- <87pqqtaxke.fsf@fox.patthoyts.tk>
On Tue, Feb 15, 2011 at 07:48:33PM +0000, Pat Thoyts wrote:
Show 5 quoted lines
> My feeling is that the user should be making a branch to hold his > commits. So I suggest adding some text to suggest that a branch be > created and keep annoying the user every time they commit to a detached > head. This errs on the side of not dropping commits into the reflog > which seems the most useful strategy to me.
I like Heiko's suggestion of a check-box to turn off gui.warndetachedcommit, though I personally don't care much as a non-gui user. I also think if you are going to suggest making a branch that there should be an "OK, make the branch now" button, or at least a button to take you to the right dialog to create it. But again, I know nothing about gui design and as a non-user I don't have a strong feeling.
But...
Show 6 quoted lines
> + if {$is_detached && $repo_config(gui.warndetachedcommit)} {
> + set msg [mc "You are about to commit on a detached head.\
> +This is a potentially dangerous thing to do because if you switch\
> +to another branch you will loose your changes and it can be difficult\
> +to retrieve them later from the reflog. You should probably cancel this\
> +commit and create a new branch to continue.\n\I do have a strong feeling about English grammar, and this should be s/loose/lose/. :)
-Peff