Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

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

From: Jeff King <hidden>
Date: 2016-06-15 22:50:34

Possibly related (same subject, not in this thread)

On Tue, Feb 15, 2011 at 07:48:33PM +0000, Pat Thoyts wrote:
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...
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help