Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754694AbdDLQHF (ORCPT ); Wed, 12 Apr 2017 12:07:05 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34104 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754556AbdDLQHC (ORCPT ); Wed, 12 Apr 2017 12:07:02 -0400 Date: Wed, 12 Apr 2017 18:06:58 +0200 From: "Yann E. MORIN" To: Felipe Balbi Cc: Randy Dunlap , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] scripts: kconfig: implement a sort method Message-ID: <20170412160658.GA3531@scaer> References: <20170411111227.20846-1-felipe.balbi@linux.intel.com> <7d017fc8-9e0b-f8a8-a877-edcc07c91949@infradead.org> <87d1ciawvn.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87d1ciawvn.fsf@linux.intel.com> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3CG79up030058 Content-Length: 7380 Lines: 139 Felipe, All, On 2017-04-12 10:49 +0300, Felipe Balbi spake thusly: > > Randy Dunlap 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 ( [=y]) │ > │ Defined at drivers/usb/dwc3/Kconfig:41 │ > │ Depends on: && (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 ( [=y]) │ > │ Defined at drivers/usb/dwc3/Kconfig:34 │ > │ Depends on: && (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. > │ │ 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, 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 > > │ > > > > Or the