I disagree again. Making commits on a detached head is not dangerous.
What is dangerous is moving away from the tip of that detached head
without attaching it somewhere. And that case is well covered already.
Also the warning when moving to a detached head is useful to make the
user aware of what just happened because there is really something
special about such checkout. It is not meant to frighten users and if
it does so then maybe it should be reworked some more. But IMHO it is
important that the user be aware of this special state.
But making a warning at commit time is wrong. It is completely
disconnected from the actual issue and I think it'd create more
confusion because there is in fact nothing to worry about at the moment
the commit is made. The very fact that you think yourself that a
warning should be displayed at commit time indicates to me that you
might be a bit confused yourself and such warning if present at commit
time wouldn't help clearing that confusion at all.
In Carl's case suggesting -f is probably not a good idea. Using -f _is_
dangerous and we better not get people into the habit of using -f
without thinking.
Let's focus on the real issue: the warning message when head gets
detached. This message is not meant to frighten users. It is meant to
make the user aware of a special state (pretty useful but special
nevertheless) and give a suggestion about what to do if that state was
entered by mistake. So if that message scares users away then it is the
message itself which is buggy not its presence.
Nicolas
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html