@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?

Comment From: jbrockmendel

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?

Comment From: MarcoGorelli

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 https://github.com/pandas-dev/pandas/pull/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

Comment From: rhshadrach

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.