News for hackers. Stuff that matters.
Re:Mergers ruin everything by good-idea on Friday February 04, 2022 @01:11PM (#30210652)
Should they be squashing instead?
Re:Mergers ruin everything by zentiggr on Friday February 04, 2022 @01:49PM (#30211197)
This looks entirely offtopic. Commenting on wrong post?
Re:Mergers ruin everything by oplav on Friday February 04, 2022 @01:50PM (#30211210)
It sounds like a git joke about squashing vs merging.
Re:Mergers ruin everything by blendergeek on Friday February 04, 2022 @01:51PM (#30211219)
It looks to me like GP may have commented without reading the article. "Mergers ruin everything" could be misread as "Merges ruin everything". Just reading the title could lead someone to think this was a discussion about git best-practices.
Re:Mergers ruin everything by brimstedt on Friday February 04, 2022 @01:14PM (#30210698)
I was actually hoping for a nuanced view on code branch/merge tactics.

Got any suggestions on the topic?

Re:Mergers ruin everything by good-idea on Friday February 04, 2022 @01:22PM (#30210801)
I don't have any good resources off-hand (other than what shows up in a quick search), but my "best practices" are to always squash and keep PRs as small as possible.

When a working branch falls behind main, I prefer to rebase it instead of merging from main to keep it up to date. However, if you've already pushed your working branch to a repo, after rebasing you need to `git push --force` - which is a problem if there are others who have previously cloned the working branch.

Re:Mergers ruin everything by vincentmarle on Friday February 04, 2022 @01:28PM (#30210884)
Squashing also introduces problems when you are resolving merge conflicts in your branch: squashing doesn’t preserve merge conflict resolution so you end up having to resolve those conflicts again after merging.
Re:Mergers ruin everything by codyb on Friday February 04, 2022 @01:34PM (#30210978)
Great comment and spot on. You can avoid the issue with force by using `—force-with-lease` which won’t push the force if there’ve been changes upstream.

That’s a bunch to type so I alias it to `fwl` In `~/.git config` and use it after rebases.