Closed gvbalaji closed 1 year ago
Yes please!
Multiple commits are super useful during review time ("show changes since your last review" and even better, if people organize the commits logically). But squashing would be best for the final merge.
From @SimonTheLeg
What is possible in prow? Within tide (component in prow), we can set it up to use “squash” as the merge_method (refer to https://docs.prow.k8s.io/docs/components/core/tide/config/) Apart from this, prow does not have any additional capabilities for squash merging. Instead it simply calls the GitHub-API, which then does what is configured in the repo.
How do we handle a PR which has commits from multiple authors?
Github handles this automatically by adding a Co-authored by xyz
line to the commit message. This is then displayed in the UI and persisted in git-history:
(example taken from https://github.com/kubermatic/kubermatic/commit/022ca1e74a2aec8636fb77079433daa97c8b7a25)
We can have both, actually all three options really (merge, squash, rebase). Tide has configuration option to have designated labels make it switch merging type. If you label PR with (label name is configurable) let's say 'tide/merge-method-squash' it will squash commits and and github automatically preserves authors as coauthors and commit message is concatenated from included commits.
After some thinking, let's make squash default method.
Thanks @radoslawc . I assume this is done now. Does it use PR message and description as commit messages?
A PR could potentially contain multiple commts. Squashing all the commits before merging could maintain a cleaner history of code changes.
@SimonTheLeg has shown how this can be done automatically in GitHub and how PR title and description could be used as final commit messages. It also maintains the names of all authors.
Once we get a wider buy in for this , we can implement it for all nephio repos.