News for hackers. Stuff that matters.
Re:Two Years of Squash Merge (2019) by ginja on Friday April 30, 2021 @03:14PM (#26997974)
I do agree that PRs should have a clean history. However:

- Services like GitHub allow you to restore the original branch, so you never actually lose history. So I don't see any major drawbacks of squashing on merge.

- If your PRs are several thousand lines long, they probably should've been broken up into multiple PRs (your reviewer will appreciate it)

Re:Two Years of Squash Merge (2019) by finnh on Friday April 30, 2021 @03:35PM (#26998230)
Spot-on for both counts. Preserving a PR's individual commits in the master branch is insane - many of those commits won't represent a fully working system anyway, so why keep them in master?
Re:Two Years of Squash Merge (2019) by gouggoug on Friday April 30, 2021 @08:13PM (#27001385)
It's entirely not insane _on the premise that the history is clean_. That's the whole argument that is being made here.

If you think that "Preserving a PR's individual commits in the master branch is insane - many of those commits won't represent a fully working system anyway", your issue _is_ "that your commits don't represent a fully working system anyway", _that_ is what you need to fix.

You need to make sure your history _does_ represent multiple small digestible atomic chunk of codes, that are understandable individually.

By squashing, you're not fixing the root cause, you're treating the symptoms.

Re:Two Years of Squash Merge (2019) by sjoruk on Friday April 30, 2021 @03:50PM (#26998417)
> many of those commits won't represent a fully working system anyway

This is entirely within the control of the developer(s) working on the project. Whether it's worth it is up to the people working on it. It's certainly not insane though - it's much easier to fix merge/rebase conflicts when each commit is small and easy to reason about.

Re:Two Years of Squash Merge (2019) by finnh on Friday April 30, 2021 @05:05PM (#26999323)
> it's much easier to fix merge/rebase conflicts when each commit is small and easy to reason about.

I agree, but I'd say it in the context of PRs. It's much easier to fix issues (and avoid them) when _PRs_ are small & easy to reason about.

Re:Two Years of Squash Merge (2019) by pizza234 on Friday April 30, 2021 @03:52PM (#26998438)
> - Services like GitHub allow you to restore the original branch, so you never actually lose history. So I don't see any major drawbacks of squashing on merge.

There's definitely a drawback, and it's bisecting, which is actually a big deal.

Bisecting allows in a semi-automated (depending on the issue) bisecting what otherwise can be a large diff.

But of course, it requires a disciplined history - otherwise, bisecting just won't work.

Re:Two Years of Squash Merge (2019) by marcinzm on Friday April 30, 2021 @05:59PM (#26999928)
Can't you just bisect twice. Once to find the PR and a second time within the PR's branch?
Re:Two Years of Squash Merge (2019) by pizza234 on Sunday May 02, 2021 @06:07AM (#27013827)
AFAIK, if you squash merge, the SCM (intended as the repository, both local and remote) will keep only a single commit; the commits breakdown will be in GitHub's (intended as a service) history.
Re:Two Years of Squash Merge (2019) by gouggoug on Friday April 30, 2021 @08:08PM (#27001342)
So, if your PR has a clean history in the first place (clean as in multiple small digestible, atomic commits, that are easy to review in isolation), why get rid of it with a squash?

Is there a fundamental drawback to keeping that clean history? _It's already here_