Re: [RFC] Detached-HEAD reminder on commit?

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC] Detached-HEAD reminder on commit?

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:45:16

Pieter de Bie [off-list ref] writes:
+       if (!strcmp("HEAD", head))
+               printf("You are on a detached head, so this commit "
+                       "has not been recorded in a branch.\n"
+                       "If you don't want to lose this commit, checkout a "
+                       "branch and then run:\n"
+                       "       git merge %s\n", sha1_to_hex(sha1));
I'd say

+                       "If you don't want to lose this commit, run "
+                       "git branch <some-name>\n"
+			"to create a named branch for the commit you just made");

(or whatever better wording you find, but I think suggesting to name
the branch makes more sense that merging it)

-- 
Matthieu

Re: [RFC] Detached-HEAD reminder on commit?

From: Nicolas Pitre <hidden>
Date: 2016-06-15 22:45:17

On Tue, 2 Sep 2008, Matthieu Moy wrote:
Pieter de Bie [off-list ref] writes:
quoted
+       if (!strcmp("HEAD", head))
+               printf("You are on a detached head, so this commit "
+                       "has not been recorded in a branch.\n"
+                       "If you don't want to lose this commit, checkout a "
+                       "branch and then run:\n"
+                       "       git merge %s\n", sha1_to_hex(sha1));
I'd say

+                       "If you don't want to lose this commit, run "
+                       "git branch <some-name>\n"
+			"to create a named branch for the commit you just made");

(or whatever better wording you find, but I think suggesting to name
the branch makes more sense that merging it)
Agreed. Something that repeat more or less the message that was given 
when detaching HEAD in the first place would be best.


Nicolas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help