Re: git: 3a1f5a28f007 - main - proc.h: Order thread_lock*() functions more logically
Date: Tue, 17 Nov 2026 13:52:18 UTC
On Mon, Nov 16, 2026 at 02:08:35PM -0500, John Baldwin wrote: > On 11/16/26 03:14, Olivier Certner wrote: > > > The functions were ordered alphabetically, as it should be. > > > > No, they do not need to. In some places they are, mostly because of history or because nobody bothered to classify them. It is generally much more useful to group them by usage/category. Typically, functions that must be paired should be adjacent. > > Hmm, my understanding of style(9) from bde matches kib@ which is > to sort alphabetically. That said, in practice I tend to do that > within groups, that is if there is a group of related functions, > I sort them alphabetically, but may use separate groups instead of > one giant group if there are comments for the groups. IMO the important thing is that it's entierly clear where to put the next thing. The easiest way to do that is to sort things. (If you see me sorting lists before insertion it's because I can't figure it out so I've given up and sorted them.) If you're going to group them, I highly recommmend blank lines or comments to break the groups up. -- Brooks