-
Notifications
You must be signed in to change notification settings - Fork 874
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
turn github PR squash feature off. #5617
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will never use Github's "squash & merge" again, so it's up to you to decide if you want to set this project-wise or not.
I think it's good to avoid it for future. I think it was also an issue during a RC phase some months ago. Could we have a nice clear alternative on cli in a readme for newbie ? |
we have two wiki pages, one for reviewers and one for someone who is new to git(hub): lets update those if something is missing or could be clearer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane to me. Thank you.
Quick question, do we want to keep |
I have some serious hope, that github does not screw that up. For a rebase you can keep the author and just update the committer. |
I never used rebase-merge for NB. But I use it often in other projects. It removes the merge message basically, the commit shows up on top of of the target branch. Merge messages are useful for finding PRs again so we should use that in 99% of all cases. I don't mind leaving it enabled though. |
@pepness I believe you use the github squash feature during merge, right? Would it be a problem if we turn it off? |
-0 for me. The original issue was that it did not treat the email right. Now the UI offers updating the email on such merges. So that thing is solved. What we are suspecting now, is for PRs with long commit history, it still does a merge commit instead of a squash. It would be good to confirm that, but that is not tat serious issue like using mage-up emails. |
I have no strong feelings here. We should know how to handle merges. All committers were informed multiple times, that the github GUI is a flaky tool, that might or might not skrew your merge and might have less sane defaults than the git CLI tools. I have more trust in my manual merge+force push foo, than on github, but others can see this differently. |
the main reason why I believe turning it off would be a positive change is because this actually changes the workflow and merges exactly what you see in the PR once you press the button. There is no second guessing or "wrong setting by mistake". It leaves less room for mistakes, what you see in the PR is what you get post merge. |
I don't think the problem is committers knowing how to handle merges, nor how to squash stuff. I think the problems are:
Reading the 2020 thread in the mailing list I see that @neilcsmith-net wanted to keep the squash option in github. It eased things during releases, IIRC. One solution that may fit all is to keep the button as is, and let each committer to decide whether contributions are to be squashed using this github three-in-one button or to request a squash for contributtions. I personally will choose the second one from one on. |
Don't use my past opinion as a benchmark! 😄 I'm currently +1 to disabling both squash and rebase options. One of my concerns in the past thread, and still, is losing the relationship between PRs and commits, eg. by squashing and merging to master locally. Now that everyone seems to understand that they can force push to any PR branch (by default) that seems less of an issue. If it wasn't for edge cases, I'd argue to also disable all direct pushes to master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like to see rebase
option also disabled, but +1 either way.
@neilcsmith-net we enabled force push protection via #4785, I am not sure if it is even possible to enable regular pushes, it would be possible to do this indirectly by requiring a green checkmark in CI or by adding a PR approval requirement for example. If we manage to lock us out we still have two options: simulate a green checkmark by hacking a job or an infra ticket as last resort. (without wanting to point fingers you can find tickets like that on jira - it happens :)) |
I am ok with this; then, the recommended procedure from now on is:
Is this correct? |
That's the recommended procedure already - this PR doesn't change that. |
Create a merge commit? If it is already squashed, then it's just one commit. "rebase+merge" on GitHub UI would keep the master branch straight. |
@lkishalmi well, we've always used merge commits. Could be changed, but should be discussed on dev@. If that changed, it would be important to keep the option for merge commits in the UI as well though as they're essential for the release process. |
@neilcsmith-net I'm not questioning the use of merge commits in general. Maybe I just were too liberal when handling merges so far. So I confess my wrong doings here:
|
we could turn off rebase too on github. The advantage of merge commits in projects with many contributors is that it links back to the PR the commit came from (even the branch if it still exists). It is an additional "tag" and tools like git bisect know to ignore it. Some projects don't like merge commits, so they rebase everything for a clean, linear history. But some information will be lost when doing so. Merge commits also clearly separate from the person who integrates and the person who wrote it (all metadata, dates etc are also kept as is). Which is often not the same person here too. I remember when git was new I didn't like merge commits at all and saw them more as a workaround for when your branch diverged from master and you were too lazy to fix it locally, but I got used to it over time and do see their benefit. edit: we also don't have any policy to mention issues or PR numbers in the title or commit msg, merge commits are doing this for us right now. |
FWIW, if we can't use squash at merge time, then we can't, but it is pretty unfortunate IMO. The reasons why I am saying that are:
So, overall, automatic squash at merge time seems like a fairly good option to me: keeps the main history reasonable, preserves the PR history for the future and is easy to do. I wonder if we should look at options to recover a way of doing that. |
@jlahoda but it's also only codifying something that was discussed and (mostly) decided in 2020. I thought it was unfortunate at the time (as was mentioned above), but it's generally working effectively. Whether or not we want to codify makes sense here. Discussing changing the process should probably be a reopened discussion on dev@ so more people are involved / know what is expected / we document it better this time ... Having one way to do this certainly makes it easier to explain to contributors!
The PR UI isn't too bad at tracking that in my opinion. It seems to have improved recently too ... or am I just noticing things I hadn't before?!
Not sure what you mean exactly by breaking the PR history? eg. I always use |
merging, since it just happened again :( |
Note https://cwiki.apache.org/confluence/display/NETBEANS/Submitting+Pull+Requests?focusedCommentId=283118094#comment-283118094 (I no longer seem to have a valid Confluence login). |
see discussion @ dev list
reasons: