Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3414945ybx; Sun, 3 Nov 2019 18:29:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyU8gBHOmKY/XK05/jBcnjbqKRtncnICyWGTJjwEwE4QVDc16xodArkcNg1KuLfJfvE1GvZ X-Received: by 2002:aa7:dbd4:: with SMTP id v20mr24615384edt.58.1572834571139; Sun, 03 Nov 2019 18:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572834571; cv=none; d=google.com; s=arc-20160816; b=jepIflGo3yFlED4SqjrSHYm0PHVb2txBilBNbyI1LW2x7xZhLiOx34DSUdl+I9melH nfzK9Hwwv/x+vi7GQts3TBMocXjKtHOLQzw1ueJUDXxjIDfmMalUJU5rY0Kb9asB7f/e 9l+BHp8jbRUleqHZ44ovHhzR75P2A7T09bh/lK8PU/fv5iiQRupipRfzF+7dpP1h6QRY 0wBv7VWidwez+le6Bf2HA8wXtPLucpU8tW7L+fdOwcsnttC4r/jd8r7CU47ZKafGtKJl UnjpWsfJSlASTqsVmrEdgBIumvl+QFuQsT1ZuZnYD1G0wSxO2MJy83A/GACwjnURLXe0 tqTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=j+mZ/2Df8MTt5deljVkGt6WTpnQCG1IlQLMoVu61sPs=; b=DKSrbD87Gf2LzIJcx/kxrbXeBZw1VMzqXMgZyOzMxVIqqoGc+lyep09TPbzfuwrOcD ZooR4V2cfTqVwEzqY2Xhy3En5olmrtA2sHLvzrfcyj4r4fMo1WWxC8ukQXjjT1FNiR68 R7D6zATALzYs5Usm4QwGz/ZVO/aVhuiznib3xhBCNPTmo6BjN8KGdw25/YjlV6IIZyUp KfTnH+w42pcUtf/GsWZSmBzVRiM1axX7s4grYRBPDhKscHJAYuK7L7zsoHLl6KseMLlY 3gG6vbhg2qhHIuj0j0Em7luAYOws0gHSMg/HhYw1SLbOx9t9gqXM+go3TJxQIHigM0qX xLQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=iyuhkS6h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si6446516ede.12.2019.11.03.18.29.06; Sun, 03 Nov 2019 18:29:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=iyuhkS6h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728444AbfKDCVJ (ORCPT + 99 others); Sun, 3 Nov 2019 21:21:09 -0500 Received: from conssluserg-04.nifty.com ([210.131.2.83]:45856 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728227AbfKDCVJ (ORCPT ); Sun, 3 Nov 2019 21:21:09 -0500 Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (authenticated) by conssluserg-04.nifty.com with ESMTP id xA42L1Vw007485; Mon, 4 Nov 2019 11:21:02 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com xA42L1Vw007485 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1572834062; bh=j+mZ/2Df8MTt5deljVkGt6WTpnQCG1IlQLMoVu61sPs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iyuhkS6hlSft7fxqpCAn2MbmI6jhdk8ER7qctwxGTsAgRYixbwtXytfehndELRqOI txAsFhsRpcbn1z2hT9/lIY+F5oSMgT+YzdrsufAgu+MALJ//QIg7Mo9fzE2fTSqUjG m5YsNPvbn+j+uyRih4igoyBxEyCbjjOF2NDW0/fMk2NfwnR0jjsR2uN6XXSyyq63OT FG1W+VNr1oKTBDUUjXracxv5lKXlR8EcJIVnU7t7/3VnBcS0H74wZPK9HxN32xyXc6 FBOy3nfadENQBdTW+gqO2NiZ1MKqpZzxioHDQSDqllJ+hEowzw/ICa7b5IUN1uuiEc hAgCJfBY4gFAw== X-Nifty-SrcIP: [209.85.217.48] Received: by mail-vs1-f48.google.com with SMTP id y23so3537335vso.1; Sun, 03 Nov 2019 18:21:02 -0800 (PST) X-Gm-Message-State: APjAAAVLbnV65N1qMffL+kFDcw2aZ9heLxIFvtcV06MeVks4Jr2Fo5oe 90fKyWBgm8j6BCUySMzLNbkGf8xy1PpKwkPQU38= X-Received: by 2002:a67:d31b:: with SMTP id a27mr5139817vsj.215.1572834061187; Sun, 03 Nov 2019 18:21:01 -0800 (PST) MIME-Version: 1.0 References: <20191029181702.21460-1-labbott@redhat.com> In-Reply-To: <20191029181702.21460-1-labbott@redhat.com> From: Masahiro Yamada Date: Mon, 4 Nov 2019 11:20:25 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] kconfig: Add option to get the full help text with listnewconfig To: Laura Abbott Cc: Linux Kbuild mailing list , Linux Kernel Mailing List , Jeremy Cline , Don Zickus Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 30, 2019 at 3:17 AM Laura Abbott wrote: > > make listnewconfig will list the individual options that need to be set. > This is useful but there's no easy way to get the help text associated > with the options at the same time. Introduce a new targe > 'make extendedlistnewconfig' which lists the full help text of all the > new options as well. This makes it easier to automatically generate > changes that are easy for humans to review. This command also adds > markers between each option for easier parsing. > > Signed-off-by: Laura Abbott > --- > Red Hat has been relying on some external libraries that have a tendency > to break to get the help text for all new config options. I'd really > like an in tree way to get the help text so we can automatically > generate patches for people to reveiw new config options. I'm open to > other approaches that let us script getting the help text as well. I am not familiar with the workflow in Red Hat. I cannot propose another approach. I am not a big fan of the target name. 'extendedlistnewconfig' is so long that it breaks the alignment of 'make help'. Maybe 'helpnewconfig' is understandable although I am open to discussion for a better name. BTW, did you check how the newly-added 'choice' was displayed? Its help message is displayed, but the choice has no name. So, people might be confused what the help message is talking about. > --- > scripts/kconfig/Makefile | 5 ++++- > scripts/kconfig/conf.c | 13 ++++++++++++- > 2 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile > index ef2f2336c469..aaaf1f62300c 100644 > --- a/scripts/kconfig/Makefile > +++ b/scripts/kconfig/Makefile > @@ -66,7 +66,9 @@ localyesconfig localmodconfig: $(obj)/conf > # syncconfig has become an internal implementation detail and is now > # deprecated for external use > simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ > - alldefconfig randconfig listnewconfig olddefconfig syncconfig > + alldefconfig randconfig listnewconfig olddefconfig syncconfig \ > + extendedlistnewconfig > + > PHONY += $(simple-targets) > > $(simple-targets): $(obj)/conf > @@ -134,6 +136,7 @@ help: > @echo ' alldefconfig - New config with all symbols set to default' > @echo ' randconfig - New config with random answer to all options' > @echo ' listnewconfig - List new options' > + @echo ' extendedlistnewconfig - List new options' > @echo ' olddefconfig - Same as oldconfig but sets new symbols to their' > @echo ' default value without prompting' > @echo ' kvmconfig - Enable additional options for kvm guest kernel support' > diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c > index 40e16e871ae2..7aeb77374d9a 100644 > --- a/scripts/kconfig/conf.c > +++ b/scripts/kconfig/conf.c > @@ -32,6 +32,7 @@ enum input_mode { > defconfig, > savedefconfig, > listnewconfig, > + extendedlistnewconfig, > olddefconfig, > }; > static enum input_mode input_mode = oldaskconfig; > @@ -434,6 +435,11 @@ static void check_conf(struct menu *menu) > printf("%s%s=%s\n", CONFIG_, sym->name, str); > } > } > + } else if (input_mode == extendedlistnewconfig) { > + printf("-----\n"); > + print_help(menu); > + printf("-----\n"); > + > } else { > if (!conf_cnt++) > printf("*\n* Restart config...\n*\n"); > @@ -459,6 +465,7 @@ static struct option long_opts[] = { > {"alldefconfig", no_argument, NULL, alldefconfig}, > {"randconfig", no_argument, NULL, randconfig}, > {"listnewconfig", no_argument, NULL, listnewconfig}, > + {"extendedlistnewconfig", no_argument, NULL, extendedlistnewconfig}, > {"olddefconfig", no_argument, NULL, olddefconfig}, > {NULL, 0, NULL, 0} > }; > @@ -469,6 +476,7 @@ static void conf_usage(const char *progname) > printf("Usage: %s [-s] [option] \n", progname); > printf("[option] is _one_ of the following:\n"); > printf(" --listnewconfig List new options\n"); > + printf(" --extendedlistnewconfig List new options and help text\n"); > printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); > printf(" --oldconfig Update a configuration using a provided .config as base\n"); > printf(" --syncconfig Similar to oldconfig but generates configuration in\n" > @@ -543,6 +551,7 @@ int main(int ac, char **av) > case allmodconfig: > case alldefconfig: > case listnewconfig: > + case extendedlistnewconfig: > case olddefconfig: > break; > case '?': > @@ -576,6 +585,7 @@ int main(int ac, char **av) > case oldaskconfig: > case oldconfig: > case listnewconfig: > + case extendedlistnewconfig: > case olddefconfig: > conf_read(NULL); > break; > @@ -657,6 +667,7 @@ int main(int ac, char **av) > /* fall through */ > case oldconfig: > case listnewconfig: > + case extendedlistnewconfig: > case syncconfig: > /* Update until a loop caused no more changes */ > do { > @@ -675,7 +686,7 @@ int main(int ac, char **av) > defconfig_file); > return 1; > } > - } else if (input_mode != listnewconfig) { > + } else if (input_mode != listnewconfig && input_mode != extendedlistnewconfig) { > if (!no_conf_write && conf_write(NULL)) { > fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); > exit(1); > -- > 2.21.0 > -- Best Regards Masahiro Yamada