Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp285559pxb; Thu, 20 Jan 2022 13:31:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxZaS8OQBijpzn56SY+XLH5cjDTK5a9MY6MyZY+CuEXb6l8jgQM3ptB/18WcBi2o7Uf3TV X-Received: by 2002:a17:902:7295:b0:14a:dea9:9387 with SMTP id d21-20020a170902729500b0014adea99387mr621527pll.17.1642714270861; Thu, 20 Jan 2022 13:31:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642714270; cv=none; d=google.com; s=arc-20160816; b=HrjK4xNT2M1fHFrroaaunte1Uw7WFQRBVl/Bu7mzacShr6r+zLuijIICmNSj6+dXYY iFofAREKM2/9ernzkFKCE748TxSyhBMZHiw2lelP4U7geA1nRmuLUiUkyn2cTDVGmEZn OUOed0VOwL1nj663H2JXnrbUYaBzSysXTtTS+4tllB8i+NPNipCOM/PN9xTyJhjefh9/ rsNNEXmFBfl2BPWRSPIKHsNKK3/T53nxPbq5lnIJ9PIXuRPbkHfbDp8lEl5Y+abal89R f6jwx1JT7cX1+oAz6vankwnOqgnCGToP6rPzYlbI1J51w6pjSzcWjMIfoq2/nWqQiQqC VRvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=dHrjvzYeF+kmk6NZ+W9xqKFkk9zOX9Dzya0WrCoKlAc=; b=r7qtEwjplSPzT2eigvfedHMaiyHy+YyeMlvBkPQQEU+6UW6dB4n6G4GmhFsuyr1lle YXFCwAXn1a3rPRn2S+J0qra6LAB5B+/XsAFo5CBZ0MiAT51j/xoK0iJr7Wxmk69iyxev jAsfqgCsaaNPK/6IhbCMP4QXZswLGlm592vIW79n9fvxosWReFAd3jIwV2hIfkVjrA6R 0z9t7XOKOUf96v7d1DIlcsU5qQu1A4SrtUC8s5LBMui7TgGvRnlDeqiXfoFpar6eDT3W ELO8FJoVzvIgLyilk72I3vaGL/OG+Fl0QLFDXDxH1TsnfAF9zJ63lWNSgVYnG2YNx+Zt DWQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oT5cHkFc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oc11si12031481pjb.28.2022.01.20.13.30.58; Thu, 20 Jan 2022 13:31:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oT5cHkFc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348013AbiARS07 (ORCPT + 99 others); Tue, 18 Jan 2022 13:26:59 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:65458 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232090AbiARS07 (ORCPT ); Tue, 18 Jan 2022 13:26:59 -0500 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 20IIQRnB016066; Wed, 19 Jan 2022 03:26:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 20IIQRnB016066 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1642530388; bh=dHrjvzYeF+kmk6NZ+W9xqKFkk9zOX9Dzya0WrCoKlAc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oT5cHkFct229ODIuv4JraSS6f8cTYWv0T5MAWmq/aKl8lEs+wRoinca6wCQVskIyo S223ri9LJqhBOovWHvSD9yCAQxb0u9u5gXPWQEDUJTHQ6YwjPzLWfXNH+g1nRjQOfy zKBLv5mAgZRrptnTlGz+BdGgQEx8aNNobnkBG0ZT97ebr4u3BMqMgiUpbgyPTNNdAo cBicae3TdS8131slFA2TckVDmQf04mmDjhwzGryesNyzZK5gzd7Tuyk9soDUsp5Wkj +hnsfiEgnAkEezVSYur6t8bwrPx7/cxjZ0p7/aQra9bnc7QRlSqCCutOSCthDYoxHs wuThbla2rIoNg== X-Nifty-SrcIP: [209.85.214.181] Received: by mail-pl1-f181.google.com with SMTP id d7so3804177plr.12; Tue, 18 Jan 2022 10:26:28 -0800 (PST) X-Gm-Message-State: AOAM531Nw2xYCG38Mmc5Rq3CaH7jXeZhvozeDDPscEyKj29jENfxrkpU dCs6RBoRRC0vrTGcshIOvADOuEdm5q/19e8XiLg= X-Received: by 2002:a17:902:6a89:b0:149:732e:d335 with SMTP id n9-20020a1709026a8900b00149732ed335mr29134357plk.136.1642530387508; Tue, 18 Jan 2022 10:26:27 -0800 (PST) MIME-Version: 1.0 References: <20211213100043.45645-1-arielmarcovitch@gmail.com> <20211213100043.45645-3-arielmarcovitch@gmail.com> In-Reply-To: <20211213100043.45645-3-arielmarcovitch@gmail.com> From: Masahiro Yamada Date: Wed, 19 Jan 2022 03:25:50 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] kconfig: Make comments look different than menus in .config To: Ariel Marcovitch Cc: Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 13, 2021 at 7:01 PM Ariel Marcovitch wrote: > > Currently, the same code that handles menus in the write to .config > handles comments as well. That's why comments look exactly like menus in > the .config except for the 'end of menu' comments that appear only for > menus. This makes sense because sometimes comments are used as sort of > submenus. However for the other cases, it looks kinda weird because one > might attempt to look for the 'end of menu' for comments as well and be > very confused. > > Make comments look different than menus. For the following: > ```kconfig > menu "Stuff" > > config FOO > def_bool y > > comment "Some comment" > > config BAR > def_bool n > > endmenu > ``` > > The .config will look like this: > ``` > # > # Stuff > # > CONFIG_FOO=y > > ### Some comment > # CONFIG_BAR is not defined > # end of Stuff > > ``` > > Signed-off-by: Ariel Marcovitch > --- > scripts/kconfig/confdata.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c > index 9f2c22f46ee0..d3ec1ad67d92 100644 > --- a/scripts/kconfig/confdata.c > +++ b/scripts/kconfig/confdata.c > @@ -880,10 +880,16 @@ int conf_write(const char *name) > > if (type == P_MENU || type == P_COMMENT) { > str = menu_get_prompt(menu); > - fprintf(out, "\n" > - "#\n" > - "# %s\n" > - "#\n", str); > + > + if (type == P_MENU) > + fprintf(out, "\n" > + "#\n" > + "# %s\n" > + "#\n", str); > + else > + fprintf(out, "\n" > + "### %s\n", str); > + > need_newline = false; > } > } > -- > 2.25.1 > Since "# CONFIG... is not set" looks like a comment, I am not sure if this improves the visibility. I will not pick up this until I find out what a really good format is. -- Best Regards Masahiro Yamada