git inhumanity: detaching your head

mike-the-headless-chicken1One of my favorite examples of git’s inhumane tool design is the warning

You are in ‘detached HEAD’ state.

WTF does that even mean? I do something as simple as wanting to look at a version of the code three revisions back and suddenly I’m decapitated? It’s an alarming bit of language, not to mention completely opaque.

Really the concept is pretty simple. The message could read “you checked out a version of the repo that doesn’t match the head of any named branch”. That would explain the state you’re in and be much less alarming. “Detached HEAD” is a shorter way of saying that, but is a bit of jargon that only makes sense to experts. The experts who don’t need that warning anyway.

The problem is git is designed by people who don’t see opacity as a problem. It’s like the Unix philosophy where “cat” mean “show file” and “rm” means “delete” and “grep” means “search”. I’ve internalized all those words 20+ years ago, but I’ve never forgotten how they are barriers to learning.