Re: [PATCH] scripts: kconfig: implement a sort method

From: Yann E. MORIN
Date: Wed Apr 12 2017 - 12:07:07 EST


Felipe, All,

On 2017-04-12 10:49 +0300, Felipe Balbi spake thusly:
>
> Randy Dunlap <rdunlap@xxxxxxxxxxxxx> writes:
> > On 04/11/17 04:12, Felipe Balbi wrote:
> >> With a growing amount of Kernel configuration, it's
> >> getting ever more difficult to find anything on
> >> menuconfig. Because of that, implement mergesort for
> >> kconfig to make it a little easier for anybody
> >> building kernels.
> >
> > Search works for me, but I don't mind Sort either.
>
> yes, it works. It does a different thing, though. Here's what happens
> when I want to find DWC3:
>
> / DWC3 RET
>
> | Symbol: USB_DWC3 [=m] â
> â Type : tristate â
> â Prompt: DesignWare USB3 DRD Core Support â
> â Location: â
> â -> Device Drivers â
> â (1) -> USB support (USB_SUPPORT [=y]) â
> â Defined at drivers/usb/dwc3/Kconfig:1 â
> â Depends on: USB_SUPPORT [=y] && (USB [=y] || USB_GADGET [=y]) && HAS_DMA â
> â Selects: USB_XHCI_PLATFORM [=m] â
> â â
> â â
> â Symbol: USB_DWC3_DUAL_ROLE [=n] â
> â Type : boolean â
> â Prompt: Dual Role mode â
> â Location: â
> â -> Device Drivers â
> â -> USB support (USB_SUPPORT [=y]) â
> â -> DesignWare USB3 DRD Core Support (USB_DWC3 [=m]) â
> â (2) -> DWC3 Mode Selection (<choice> [=y]) â
> â Defined at drivers/usb/dwc3/Kconfig:41 â
> â Depends on: <choice> && (USB [=y]=y || USB [=y]=USB_DWC3 [=m]) && (USB_G â
> â â
> â â
> â Symbol: USB_DWC3_EXYNOS [=n] â
> â Type : tristate â
> â Prompt: Samsung Exynos Platform â
> â Location: â
> â -> Device Drivers â
> â -> USB support (USB_SUPPORT [=y]) â
> â (3) -> DesignWare USB3 DRD Core Support (USB_DWC3 [=m]) â
> â Defined at drivers/usb/dwc3/Kconfig:63 â
> â Depends on: USB_SUPPORT [=y] && USB_DWC3 [=m] && (ARCH_EXYNOS || COMPILE â
> â â
> â â
> â Symbol: USB_DWC3_GADGET [=y] â
> â Type : boolean â
> â Prompt: Gadget only mode â
> â Location: â
> â -> Device Drivers â
> â -> USB support (USB_SUPPORT [=y]) â
> â -> DesignWare USB3 DRD Core Support (USB_DWC3 [=m]) â
> â (4) -> DWC3 Mode Selection (<choice> [=y]) â
> â Defined at drivers/usb/dwc3/Kconfig:34 â
> â Depends on: <choice> && (USB_GADGET [=y]=y || USB_GAD
>
> Now I know where DWC3 is defined, so I navigate to Device Driver, USB
> Support and search for DesignWare USB3 DRD Core Support:

Or you just press '3' (the number between parenthesis), and that will
take you directly there.

When you then exit, you're back top the search results.

> â â <M> USB Test and Measurement Class support â â
[--SNIP unsorted menu--]
> â â < > USB LCD driver support â â
>
> Compare that to the sorted view of this same entry:
>
> â â --- USB support â â
[--SNIP sorted menu--]
> â â < > Support WUSB Cable Based Association (CBA) â â
>
> much easier to find, don't you think?

Arguably, the order may also make sense, for example to "group" related
items. So, <Sort> should be a toggle, so that it is possible to go back
to the unsorted, original order, IMHO...

> > Any Help text for Sort? or is it obvious what it does? (no)
> wait, it's not obvious what "Sort" means?

I guess that what Randy said was that in this context, it is not more
obvious than Load or Save, and they are documented in the help (but it
is not obvious how to get the help).

For example, go on the "General setup" entry, but do not enter the menu.
Now, select Help: you'll get a bit of help on how to use menuconfig.

There, Load and Save are documented, in Alternate Configuration Files.

> > In an 80x25 terminal (window), the < Sort > option wraps around
> > past column 80.
> not what I see here [1]

I see the same as Randy here:

$ stty size
25 80

https://imgur.com/a/ku0sG

> > I haven't looked at the source code (lately), but I think that it
> > would OK to not have the (extra) spaces inside the <...> brackets.
> > I.e., instead of
> > â <Select> < Exit > < Help > < Save > < Load > < Sort
> > >
> > just have
> > â <Select> <Exit> <Help> <Save> <Load> <Sort>
> >
> > Or the <Select> does not need to be indented as much as it is.
> I changed that for this very reason

Or just always left-align the line, rather than center it?

> > And BTW, Yann made kconfig an orphan today. :(

Yes, I did a very bad job at being the maintainer over the past years,
so I could not really keep it any longer...

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'