
Hi Marcel,
On 18 August 2015 at 02:11, Marcel Ziswiler marcel@ziswiler.com wrote:
On Mon, 2015-08-17 at 16:14 -0600, Simon Glass wrote:
The nice thing about sorting things in groups is that you can see at a glance what is missing. It doesn't make sense to have:
<asm/aaa.h> <bbb.c> <asm/ccc.h>
since the asm/ includes are quite a different category.
But that's not at all what I proposed. What I was talking about looks as follows:
<common.h> <asm/aaa.h> <asm/ccc.h> <bbb.c> <linux/aaa.h> "local.h"
Which is exactly what I actually did in the patch we are talking about.
OK, I agree that there seems to be one nitty-gritty detail concerning the sort order of - aka dash vs. / aka slash going back to GNU sort (which is what I used) not seeming to enforce the same but I actually see that as a minor detail.
No I think you misunderstand. Another way of explaining this is sorting fruit and animals:
apple grapefruit orange elephant lion zebra
We don't want to mix up the fruit and animals, so each has its own position in the table.We can then easily see what animals are in the table.
This is not a case of running 'sort' on the includes. The 'asm' files are arch-specific includes and should go after all the 'generic' includes, like <bbb.c>, etc.
So to repeat, the ordering should be:
<common.h> <- most general <others.h> <asm/...> <arch/arm/...> <linux/...> "local.h" <- least general
Regards, Simon