top | item 40759299

(no title)

peter_l_downs | 1 year ago

Enforce squash merging to main and move on with your life. Linear history on main, individual contributors can rebase and merge or format-patch or do whatever they want on their PR branches and it doesn’t matter. There are zero downsides to this approach.

discuss

order

Snild|1 year ago

There are some downsides.

https://github.com/libexpat/libexpat/pull/789/commits is a PR of 16 related commits. Many of them make sense individually, but are depended on by subsequent commits.

Reviewing them separately makes sense. It's easier on the reviewer (and future readers) to handle multiple smaller changes, especially since each is more tightly coupled to a rationale in the commit message. Unfortunately, github's PR-focused UI doesn't really make this per-commit review as convenient as Gerrit does.

Additionally, the last two commits are authored by another contributor. This metadata would be lost in a squash.

Of course, each intermediate commit must build and pass tests. WIP and cleanup commits are squashed locally before final review/merge.

You could argue that all of these could be separate PRs, but I think there's value in grouping them up with that final merge commit, showing what one was trying to do at a larger scale.

rednafi|1 year ago

Yep. Neither the rebase nor merge workflow negates the benefits of squash-merging to main.

000ooo000|1 year ago

>There are zero downsides to this approach.

Squash merge.. zero downsides.. hard to take you seriously.

peter_l_downs|1 year ago

What are the downsides of enforcing squash-merge to main?