Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use squash-merging method for merging PRs #119

Closed
sisp opened this issue Nov 6, 2022 · 5 comments
Closed

Use squash-merging method for merging PRs #119

sisp opened this issue Nov 6, 2022 · 5 comments

Comments

@sisp
Copy link
Contributor

sisp commented Nov 6, 2022

Just a simple suggestion towards a cleaner Git history:

I think many projects these days have adopted the squash-merging method for merging PRs. Typically, a PR consists of a single logical change of the target branch. This means, when a PR is merged, the Git history of the target branch receives one additional commit, even though the PR might have several commits due to code review and/or iterative development. Currently, it seems PRs are merged with an additional merge commit which clutters the Git history and makes it harder to read. If squash-merging was used, the Git history would become cleaner.

What do you think?

@danielleroux
Copy link
Collaborator

We use squash merging, but not in general if the PR have a clean history we do a classic merge.

@sisp
Copy link
Contributor Author

sisp commented Nov 7, 2022

Clean history as in multiple commits each with a logical unit of change in one PR? My point is that the merge commit clutters the history and seems unnecessary with squash-merge (in case the result of the PR is just one logical unit of change). If you want to merge several commits in one PR, which I find less common, a rebase and merge without squashing should also get rid of the extra commit.

@danielleroux
Copy link
Collaborator

Thats a good point! I discussed this with @nuke-ellington.

PR merge methods looks like the following
image

@sisp
Copy link
Contributor Author

sisp commented Nov 7, 2022

The two enabled options look like what I mentioned. The one at the top should be the only one that leads to a merge commit. The recently merged PRs today don't show a merge commit anymore, so I assume you're using those two methods now. 🎉

@danielleroux
Copy link
Collaborator

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants