Re:Git cherry-pick and revert use 3-way merge
by naasking on Friday November 10, 2023 @05:04PM
(#38225146)
Gotta say, in 20+ years of branching and merging using CVS, SVN and then Mercurial, I've never had an issue tracking down nasty bugs. Maybe git bisect on a linear history would hypothetically be a few minutes faster in some cases, but doesn't make it worth all of the extra work and the dangers of overwriting other people's work.
I think the Fossil devs also make a good case that the problem is really a limitation in the tools like git bisect.
Rewriting history when things land in develop/master I think is a good thing. To use an analogy from the humanities, history is written by the winner.
At work we're collaborating with the merge camp at the moment and it's very difficult to work out what they're doing from reading their history - some of it is their bad practices elsewhere, but the merge commits are confusing.
I'd also be fine with no rebasing but any merges must be fast forward, so if you can't do that fix your problems prior to integration.
Also I've used a few different approaches for a few different projects, and the rebase/squash merge approach is the one that in my experience makes things clearer and easier to understand. I'd be reluctant to return to other approaches (aside from enforcing fast forward merges in public branches).
I believe that squash merges are a good compromise as so long as you don't mess with the reflog and keep the automated parts of the commit messages, then there is no lying about history.