by msvalkon · 9y ago · 0 comments
For the most brute force example, you could copy the whole program and make a runtime switch for deciding which to run.
Wouldn't that make merges even worse, not better?
Unless you're working on a topic branch together with another dev, but I find that rarely happens in practice.
Once my refactoring was complete I squashed it into a single commit to prepare to merge (or rebase) into master. I don't really think it's useful to keep the history of how I implemented that refactoring. Squashing it into a single commit is far easier to revert then if I merged multiple commits into master.
I'm also not a big fan of the everyone has their own branch world view, I worked on a big project (a chip design project) where we essentially lost track of what we were building because of this. I'm much more keen on requiring people to stay close to main and eating their own dogfood