2 ms·
There's three ways to deal with the git index/staging area: - always commit everything, merge/push that (Mercurial style) - always commit everything, then eve
by cryptonector 9y ago
There's three ways to deal with the git index/staging area:
- always commit everything, merge/push that (Mercurial style)
- always commit everything, then eventually do a rebase where you merge/split commits into logical units
- always git add -e then commit logical units
I do mostly the latter, but since I don't usually write code the way I want it in the end before pushing, I almost always have to go back and rebase to reorder, merge, and/or split commits prior to pushing.
Like you, I'm sympathetic to the idea of "save everything", and I emphatically agree that it's fantastic that you get to save just the changes you want because it allows one to produce minimal and logical commits.
I suspect that the author of TFA does not produce nice, clean, logical, and minimal commits. Instead I bet their upstream is full of merge commits and the merged branches are full of huge commits with lots of unrelated changes, and/or full of "fix a typo" commits that should never appear in upstream histories.
Using a VCS effectively to create clean, useful history upstream is hard, and some VCSes make it harder than others. Mercurial (and Fossil, and...) make it supremely difficult. Git makes it easy (though one does have a bit of a learning curve to get there).
Ironically, all the Merkle hash tree VCSes are git-like under the covers: there's a bag of commits, and some sort of branch name resolution. "Heavy-duty branches", like Mercurial's, are extremely confusing -- I never know how to recover from having multiple tips, and I don't even understand why that's at all possible. Whereas "light-weight" branching (like Mercurial's bookmarks, which still aren't reliable, or like git's branches, which are) is much much simpler -- even Mercurial's community gets this, though they still shy away from light-weight branches for some reason that I still don't understand. Fossil is exactly like git under the covers, except far, FAR superior to git in that it's relational -- Fossil is easily the best VCS ever in terms of implementation. But Fossil's dogma is highly opinionated and Mercurial-like: it has light-weight branches, but the UI is merge-happy like Mercurial's, and there's no rebasing (there's basic cherry-picking functionality, which of course is always the basis of rebasing, but that's it).
I really don't want a Merkle hash tree VCS to hide its tree nature from me.
- fulafel 9y agoA goal of producing a "nice, clean, logical, and minimal" history, as opposed to preserving history, is very opinionated, as I'm sure you're aware. I think it's not something most people should attempt voluntarily - If you want "nice, clean" waypoints, just diff between the relevant merge commits, and read their commit messages.
- cryptonector 9y agoYes, but git doesn't force you to do this -- you can be as messy as you like with git, knock yourself out. Git is NOT opinionated. I am opinionated. But Mercurial and others don't make it possible (or easy) to get nice, clean history, therefore they are inferior. And no, "just diff between merges" is NOT nice and clean. It bundles lots of changes together, therefore you can't easily separate them without actually understanding all of it. The cognitive burden of reading diffs is high. The cognitive burden of reading commit subjects and messages is lower -- much much lower. One really does have to be considerate of the people who will be maintaining one's code in the future. Even that will be you yourself, you should still be considerate to your future self. When you work with codebases measured in Mloc or Gloc, you really need the code and its history to be accessible. This is obvious to people who have worked with such codebases. It's less obvious to people who haven't, but it it's still true.