Skip to content

DEV: reduce merge conflicts by sorting whatsnew notes by issue number? #51712

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

Closed
MarcoGorelli opened this issue Mar 1, 2023 · 3 comments · Fixed by #51715
Closed

DEV: reduce merge conflicts by sorting whatsnew notes by issue number? #51712

MarcoGorelli opened this issue Mar 1, 2023 · 3 comments · Fixed by #51715

Comments

@MarcoGorelli
Copy link
Member

@jbrockmendel noted here that whatsnew notes are a major source of merge conflicts. @rhshadrach also mentioned it in Slack once.

I have an idea for how to address this - we require that, within each block, the issues be sorted by issue number. Then, the chances of two people modifying the same line of code should be greatly reduced compared with if everyone is appending to the end of the block

It should be pretty straightforward to write a check for this - any objections?

@jbrockmendel
Copy link
Member

Misc pre-coffee thoughts:

  1. I'm a bit wary of adding scripts. Every so often I do a git pull upstream main and see a bunch of new files and get vaguely uneasy. This isn't a real concern, just a "grumpy old man" muttering.
  2. Often we (at least I) want to collect lines within a section e.g. deprecation enforcements so that all of the non-keyword deprecations are together. This would disallow that? I guess we could just do that collection once at release-time.
  3. I think the merge conflicts happen most often in a brand new file, where i don't think this would make a difference
  4. IIRC we've discussed and decided against using towncrier but there might be something along those lines out there?

@MarcoGorelli
Copy link
Member Author

These are good thoughts - to respond:

  1. fair enough, though the script itself isn't user facing - if it no longer serves a purpose, we can always get rid of it. this one would only be a few lines long and pretty simple, see DEV: reduce merge conflicts by sorting whatsnew notes by issue number? #51715
  2. I'd suggest making a separate section for that
  3. right before 2.0 I kept having to solve merge conflicts in the whatsnew note, I think it's fairly common. Regarding brand new files - I don't think there's much we can do other than getting rid of them
  4. would this take PR titles and make release notes out of them? I wouldn't object to this

@rhshadrach
Copy link
Member

fair enough, though the script itself isn't user facing

I'd think the concern is more about over-tooling. I believe we can all agree that 0 tools / scripts for maintenance is too few, 1000 tools / scripts is too many. Exactly how much is too much - I do not know. But this makes me want to feel confident that a tool / script is worth it before adding it to the repo.

I think the merge conflicts happen most often in a brand new file, where i don't think this would make a difference

If you add a line to the end of a section, and someone else has merged to main adding another note to the end of the same section, a conflict will happen. This is how they arise the most for me.

The merge conflicts is a minor annoyance to me that I'd be fine living with, but I'm good trying this out and seeing how it goes.

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

Successfully merging a pull request may close this issue.

3 participants