Open lagergren opened 1 year ago
GitHub allows you to configure various rules for PR and commits in its branch protection section. For example, PRs have to have passed the CI build, have to be approved, have to be based off the latest. You can also squash a PR to a single commit on merging, etc... We have to have all this sort of stuff turned on at work, so we may as well let GitHub do whatever it can to help keep things clean.
This is something that we can warn about, e.g. when submitting a change with more than X commits. If this is intended, the commits should be verified to all use the correct issue reference (to be decided upon). If not, the developer has to amend or squash. This is likely overkill and gets in the way of crunching code fast, and checking in things that are nearly working, but have broken builds or test, to get a recent stable point to implement remaining functionality from. Local commits, and probably commits in branches != master, should be very permissive or "do what you want - no checks" for this, to not get in the was during Development in flow.
Likely solution: It is relatively common to just let the build pipeline release train automatically squash any merge to exactly one commit, whose message becomes a CRLF separated list of all the commits squashed into this final one. This is a common pattern and requires nothing from the developer.
This is not super urgent, but I wrote it down when I thought about it.