Merge PRs using --no-ff instead of --squash #4415
Replies: 3 comments 14 replies
-
I think what happened here is:
We want a linear history on main, so no merge commits. Our options are rebase and squash. We even disabled the "merge commit" button from the UI. This means that the history in the PR needs to be written with that in mind. The best way would have been for you, @mkleczek, to amend the changelog to the right commit - and always rewrite the history of your PR when you make changes, to keep it in a state that can be merged onto main in a linear fashion, where each commit is atomic on its own. Edit: But to be clear, I agree that squash was wrong here, because the refactor should have been kept separate! |
Beta Was this translation helpful? Give feedback.
-
The above is exactly what happened. 9765f0e looked off, so I chose to squash, and I thought 5c844c8 was related to the same perf commit. @mkleczek Sorry about that. As an improvement, I think we can allow auto-merge on Github. Then we can be more picky on the commits before giving approval (I approved thinking about doing a squash later). |
Beta Was this translation helpful? Give feedback.
-
|
Another thing we can do is to enforce changelog entries based on PR or commit pattern via some github action maybe like https://github.com/dangoslen/changelog-enforcer based on a certain prefix like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@steve-chavez
I noticed you squash PRs into a single commit.
On the other hand @wolfgangwalther in his reviews suggests to isolate unrelated refactors into separate commits in the same PR.
Squashing PRs looses those commits (that happened with #4396 - see https://github.com/PostgREST/postgrest/pull/4396/files#r2425469503).
OTOH creating separate PRs for small refactors done during work on larger PRs is problematic since it would require stacked PRs etc.
In my experience the best of both worlds is to
git merge --no-ffPRs. It retains linear history inmain(ie.maincontains only merge commits) but also smaller commits "inside" PRs to make fine granular change history visible.WDYT?
Beta Was this translation helpful? Give feedback.
All reactions