Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Preferred git strategy #358

awvwgk started this conversation in General
Mar 22, 2021 · 1 comments · 1 reply
Discussion options

We currently don't have a clear guideline on the preferred git strategy. I noticed @milancurcic recently switched from merge commits to squash on merge to add patches to the default branch. I'm personally a big fan of linear repository histories and a regular user of the git rebase feature, but I know of developers and long-term git users not sharing this preference. So far I didn't see any opposition against squashing commits on merge here, still I think it could use some discussion or at least some documentation.

Should we have a clear recommendation on the git strategy? Even if we don't agree on a preferred strategy, should we document general recommendations for working with git? What do you think?


For reference some development guides that are explicitly discussing git strategies:

The DFTB+ developer guide has an explicit section on merging patches, with a strong preference for merge commits
https://dftbplus-develguide.readthedocs.io/en/latest/maintainerflow.html#merging-strategy

And explicit recommendations when to use or avoid git rebase
https://dftbplus-develguide.readthedocs.io/en/latest/gitworkflow.html#merge-the-changes-back-into-the-upstream-repository

Meson's development guide discusses merging of patches as well, with a strong preference for rebasing
https://mesonbuild.com/Contributing.html#strategy-for-merging-pull-requests-to-trunk

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Yes, I think so. We've had issues with contributors working on a branch in fortran-lang/stdlib instead of their own fork, or contributors opening a PR from their main branch instead of a feature branch, and thus complicating their flow when they open another PR in parallel. We don't document these but we should.

I don't have a preference for squash over merge-commit. I simply hit the green button and let GitHub figure it out. I noticed that the default merge strategy on GH has changed recently, and having no preference, I went with the default.

I see merits to both strategies and am fine with either. We can discuss on the call tomorrow to quickly converge on what people prefer.

You must be logged in to vote
1 reply
Comment options

awvwgk Mar 23, 2021
Maintainer Author

Ha, I see, now the commit history makes much more sense. GH keeps the last strategy as default for the next merge, after you merged #271 with squash and merge this was locked as default choice for all later PRs.

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

AltStyle によって変換されたページ (->オリジナル) /