You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think at least allowing squash & merge would be good, especially indeed for reducing the contribution barrier. Good to keep the option not to for complicated PRs with multiple, well-considered commit (or commits from different people).
That's OK -- I just wanted a maintainer to still have the choice (and perhaps set expectations for what to do; e.g., that anything that includes pre-commit commits or "fix..." or "adjusted for review comments" should be squashed).
We should most certainly not make the "Squash and Merge" option the default, but I think it should be made available as an option because it makes things more convenient for both contributors and maintainers in the common enough case where all commits should be squashed to one.
Perhaps we should go even further and decide it is always the responsibility of a maintainer to squash commits, but that discussion might be beyond the scope if this issue.
Perhaps we should go even further and decide it is always the responsibility of a maintainer to squash commits, but that discussion might be beyond the scope if this issue.
Indeed, beyond the discussion here, but I think it is a good idea. Would be especially nice if just a partial squashing wouldn't trigger full CI again - I guess an advantage of "squash and merge" is that that does not add extra CI.
Separately, I've wondered whether we could make some use of the commit message one can add to the merge commit. As is, the commits give very little insight in why choices are made - it is all in the github discussion (which I suspect/hope will be around less long than astropy).
@nstarman's #14952 reminded us all of this - I think we should go ahead and allow squash & merge. Personally, I'm happy for it to be the default (but it should be possible to not squash).
The one worry I have is for the (very few) people who actually write useful commit messages; it would be up to the maintainer to check that that is not lost, and ideally add to the squashed commit message as needed.
p.s. Unlike for anything in the fit history, one cannot safely assume that the github content is going to stay around (and/or be freely available). Indeed, we seem somewhat overdue for a new best platform to develop code; certainly, more involved code review and discussion on github remains rather painful, so there is room for a better alternative.
set the Squash & Merge settings to give the most verbose possible commit message (see attached image). The reviewer merging the PR is responsible for tidying up the commit message.
disable Merge and Rebase & Merge except for admins. This one is the juicy one. Why this suggestion? I don't think there is a way to set default merge types, so it would be very easy to have a PR with dozens of commits and to accidentally merge it without squashing. Currently we don't squash, so it's front-of-mind. With Squash & Merge it won't be and accidents will happen. How do I know? I use Squash & Merge for all my repos and I constantly have to remind myself Astropy does not when I review PRs. If a PR really needs many distinct commits (and IMO this is pretty rare) the reviewer just pings an admin to merge w/out squashing.
If we cannot have squash & merge as the default, then I guess we indeed may have to make it admin-only. Really, this is useful for new features only, which has become relatively rare. Plus, the multiple commits are usually more for development (at least I often branch a lot while trying out different approaches), and probably less relevant for possible reverts, etc. (one can also think about large refactoring efforts, but those can be done in multiple PRs).
I'm in favour of the maximum default commit message (which will generally just be commit titles anyway) and it being up to the maintainer to edit.
I think having the option to squash and merge has such obvious benefits that it should be enabled as soon as possible. We can afford to discuss the more controversial suggestions afterwards.
We cannot make this feature the default. However, it becomes the default based on previous use anyway on the browser, and there isn't anything we can do about that...
It does not affect contributor attributions. William and Stuart checked their own repos that already use this feature.
Great summary -- all makes sense. I guess the TODO is to include the above in the development and maintenance guides and then send an e-mail to astropy-dev summarizing it?
Attendees decide that the benefits outweigh the costs. Accidental squash-merge of carefully crafted commits is very rare. Much more common to have new contributors being asked to squash.
If it becomes a problem we can use merge queues to help alleviate any issues with PRs accidentally being squash merged.
Activity
mhvk commentedon Feb 28, 2023
I think at least allowing squash & merge would be good, especially indeed for reducing the contribution barrier. Good to keep the option not to for complicated PRs with multiple, well-considered commit (or commits from different people).
pllim commentedon Feb 28, 2023
I don't think you can choose. You either enable it for the whole repo or not at all. It is up to whoever is merging the PR to decide.
mhvk commentedon Feb 28, 2023
That's OK -- I just wanted a maintainer to still have the choice (and perhaps set expectations for what to do; e.g., that anything that includes pre-commit commits or "fix..." or "adjusted for review comments" should be squashed).
eerovaher commentedon Mar 6, 2023
We should most certainly not make the "Squash and Merge" option the default, but I think it should be made available as an option because it makes things more convenient for both contributors and maintainers in the common enough case where all commits should be squashed to one.
Perhaps we should go even further and decide it is always the responsibility of a maintainer to squash commits, but that discussion might be beyond the scope if this issue.
mhvk commentedon Mar 6, 2023
Indeed, beyond the discussion here, but I think it is a good idea. Would be especially nice if just a partial squashing wouldn't trigger full CI again - I guess an advantage of "squash and merge" is that that does not add extra CI.
Separately, I've wondered whether we could make some use of the commit message one can add to the merge commit. As is, the commits give very little insight in why choices are made - it is all in the github discussion (which I suspect/hope will be around less long than astropy).
mhvk commentedon Jun 16, 2023
@nstarman's #14952 reminded us all of this - I think we should go ahead and allow squash & merge. Personally, I'm happy for it to be the default (but it should be possible to not squash).
The one worry I have is for the (very few) people who actually write useful commit messages; it would be up to the maintainer to check that that is not lost, and ideally add to the squashed commit message as needed.
p.s. Unlike for anything in the fit history, one cannot safely assume that the github content is going to stay around (and/or be freely available). Indeed, we seem somewhat overdue for a new best platform to develop code; certainly, more involved code review and discussion on github remains rather painful, so there is room for a better alternative.
nstarman commentedon Jun 16, 2023
A proposal to discuss:
mhvk commentedon Jun 16, 2023
If we cannot have squash & merge as the default, then I guess we indeed may have to make it admin-only. Really, this is useful for new features only, which has become relatively rare. Plus, the multiple commits are usually more for development (at least I often branch a lot while trying out different approaches), and probably less relevant for possible reverts, etc. (one can also think about large refactoring efforts, but those can be done in multiple PRs).
I'm in favour of the maximum default commit message (which will generally just be commit titles anyway) and it being up to the maintainer to edit.
eerovaher commentedon Jun 16, 2023
I think having the option to squash and merge has such obvious benefits that it should be enabled as soon as possible. We can afford to discuss the more controversial suggestions afterwards.
pllim commentedon Jun 16, 2023
I put this on the dev telecon agenda for 2023-07-07. 🤞
pllim commentedon Jun 27, 2023
Notes from 2023-06-27 infrastructure tag-up:
mhvk commentedon Jun 27, 2023
Great summary -- all makes sense. I guess the TODO is to include the above in the development and maintenance guides and then send an e-mail to astropy-dev summarizing it?
pllim commentedon Jun 27, 2023
Thanks, @mhvk ! I added your TODO to #14473 (comment) under the "educating" bullet point. Does that look ok?
pllim commentedon Jul 7, 2023
Notes from 2023-07-07 dev telecon:
pllim commentedon Jul 28, 2023
For those passionate about this topic, please see #15100 . Thanks, @taldcroft !
pllim commentedon Aug 10, 2023
Squash merge button is enabled. Policy is in dev docs now.