Hacker News new | ask | show | jobs
by CuriousCosmic 1812 days ago
I think that's a consequence of rebasing. If you just merge instead, you can use the branching/merging to get a sense of complete features/changes.
1 comments

Right, I think there's a bit of subtlety lost here. "Squash and merge to trunk" is very different from "rebase on every pull on a feature branch" which is very different from "rebase and fixup/squash before merging to trunk" etc.

On a feature branch, whether you constantly rebase against master or merge from master probably should depend on the nature of the feature branch and what exactly has been happening on master. And it ultimately doesn't matter that much.

In my experience, as long as branches are ultimately merged to master with --no-ff, you can almost always recover a sensible commit history, and you should almost always end up with a sensible, tidy master to base new branches off of. If you rebase with squash/fixup on the feature branch before merging, all the better, because then you get nice "meaningful" commits on the feature branch. But even if that doesn't happen and the feature branch is a mess, at least you could write a meaningful merge commit message.

Maybe things get hairy with huge teams or huge projects that could necessitate a different workflow. But most developers are not working on projects like that.

Yep I agree. I tend to rebase my feature branches into a sensible history and then merge that in as I find that leaves the cleanest history that is still easily navigable.

I wish this workflow was better supported but since it isn't most people just default to squash and merge or rebase and merge.