Theodore Tso <tytso@xxxxxxx> writes: > On Thu, Feb 01, 2007 at 01:08:41AM -0800, Junio C Hamano wrote: >> [git.git]$ git checkout master >> You are not on any branch and switching to branch 'master' >> may lose your changes. At this point, you can do one of two things: >> (1) Decide it is Ok and say 'git checkout -f master'; >> (2) Start a new branch from the current commit, by saying >> 'git checkout -b <branch-name>'. >> Leaving your HEAD detached; not switching to branch 'master'. > > How hard would it be to simply simply set a flag once git has entered > a detached HEAD state, and clear the flag if any git operation has > modified the repository at all. If the flag is still set, then > obviously the repository hasn't changed and so there are no changes > that could be lost. Didn't I already point out that you can have a precious information while on the detached HEAD without making any commit, and that is the reason why we do not use the reachability crud from refs when deciding to issue the message? - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html