3 ms·
They should have just called detached HEAD for branchless mode. That's all that it is: HEAD is directly on a commit instead of pointing to a branch. Clearer and
by avgcorrection 3y ago
They should have just called detached HEAD for branchless mode. That's all that it is: HEAD is directly on a commit instead of pointing to a branch. Clearer and less caps lock.
But people also complain about the “branch” term so maybe they would like the more internal “head” term? In which case we're back to square one.
- nerdponx 3y agoI suspect that the name "detached HEAD" is just a pun. Cute if you already know what all this stuff means, confusing otherwise.
- avgcorrection 3y agoInside joke for a handful of people which confuses thousands of people would truly be in the tradition of open source.
- kibibu 3y agoI think I found it extra confusing because this action (check out previous commit, do some work, merge with main) was completely supported in my previous dvcs of choice, Mercurial.
- deleted 3y ago[deleted]
- nerdponx 3y agoThe Git idiom in general is to make a branch for any work you intend to keep. But I'm also curious what you mean by doing work on a previous commit and then merging with main. Maybe it's a way to solve a problem I hadn't considered before.
- kibibu 3y agoBeen a long time since I used Hg, and I've mostly trained myself out of these ideas, but I'll try to recall the use cases. 1. Consider doing a bisect to find when a bug was introduced (which may now be in multiple branches) and being able to fix it immediately then merge and/or rebase over the current versions. 2. Working on a branch, you realize that you'd like to try an alternative approach to a problem. You check out a previous commit, leaving the branch in its non-working state, and try your alternative approach. If it works, you keep going on this version, otherwise you can just switch back. The temporary unnamed branch continues to exist until you choose to delete it (ideally before pushing!) . This unlocks a much lower inertia way to do small experimental work without having to formally label new branches, which carries enough weight to make me hesitate. I would do this all the time in Hg and almost never in git. In git I would probably reach for stash to achieve something similar.