Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4268540rdb; Mon, 11 Dec 2023 14:04:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJg6F5tfBJyKHP3nNYctvRUFLc/95phgGdn20p2A+u4aoSrMxoOdWqhBhEUQ4sAdV0jPj9 X-Received: by 2002:a17:903:183:b0:1d0:b92d:b165 with SMTP id z3-20020a170903018300b001d0b92db165mr6905508plg.7.1702332279119; Mon, 11 Dec 2023 14:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702332279; cv=none; d=google.com; s=arc-20160816; b=oJi/DboQP0YH6gL0E43UfJyrIViLfaaJUz6c7V3lfEjffPKYyVrdoF9j8hzyPTztdO ygMlwJ25mk9PMI4eFRdiX4fXsEwmCBsLdaIgdoSW+vMEbNkR8S9VWyswxvAWTd4rhC2h R2S4u0tedOoQKdrPY3MOX2tBDLx/qHCsx5Rq/mgPIxuLbhCqHm+T+dh+j10jEZKsPTiF QSaKGNMpCDIxOXGypzoY9gMdxMqq897G+j9bpsMq0i06mIuTb2qVN3cL2Dqh9bxRxmKH DUtqmjR8mrgxqMuI0ORR+ucY6A5Z+TJ5RC8g2ptSUEir7pM0Ce6vFa1XvpGzJztm7DrI JmyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FCxm2ZNk4xG6rdSANJGBUV8Z7ODrKWPtn4AqES4irEA=; fh=NpGwWocY2NFeh9mTCpJvw7DKqwUu+QJNTbBBQRjSdV4=; b=ej7rQuXMILFqcAgTXxMNOKJBUEFmikbk0N6uidpcNHUrgNEx5xRvRwREIORM6e0vXs g4Dk0V+fgOw3GwsylfaaHvJkuNil9x3/lWkg/7tZUWHGTZHsO10YdZpYJ/fciJG29aTy p0QZ+fWGTcWBEVfqQ6Z6twprNfLtXWaIZmecd9t1PXzVm+LXf8Q7voC3RJk+3uPJEFld Oe8zKCDPy/MV3gNS1uVKAPP5ZmJvjlNaqvQPOE9U2cZs5GTLiySgM7kgx8czHTwoN5zx iEjCY57vkMJRMPZynXLQHWZPbh6F9FSFX0oq4SOZawPPYx1ZyLOw5PCEhZexV1twwULP qUuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K5uaWQmv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j18-20020a632312000000b005c676beba09si6448066pgj.74.2023.12.11.14.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 14:04:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K5uaWQmv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AE3FC809C43B; Mon, 11 Dec 2023 14:04:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345496AbjLKWEI (ORCPT + 99 others); Mon, 11 Dec 2023 17:04:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345291AbjLKWEH (ORCPT ); Mon, 11 Dec 2023 17:04:07 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE76CA1 for ; Mon, 11 Dec 2023 14:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702332252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FCxm2ZNk4xG6rdSANJGBUV8Z7ODrKWPtn4AqES4irEA=; b=K5uaWQmvfNDeOfyyS03m06gIuq73TKyC6kwWSJbTSBCZCguXXSk3O2x9SNqlT5sE/W3/wk T61Ki9A0WVxEBnccpUzv15abwGT+0RTfJTFzfjKtSM2qoR0VtXzoPIjKWLIEhOYSbn5uUK xHWt1OZXUqgMd+8hFG5fQPi44fe2wAE= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-255-MEG2z7eMM2CRr9nNwpZJwQ-1; Mon, 11 Dec 2023 17:04:10 -0500 X-MC-Unique: MEG2z7eMM2CRr9nNwpZJwQ-1 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1d03b873765so34613225ad.1 for ; Mon, 11 Dec 2023 14:04:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702332249; x=1702937049; h=content-transfer-encoding:content-disposition:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FCxm2ZNk4xG6rdSANJGBUV8Z7ODrKWPtn4AqES4irEA=; b=OHXHxEbWE6K0g/C1WN+5xZpFDzDqJuWiWGpTbIogoXLb1ednO/bhW4lwbyuQxstQei nZbIel58U7l/+9GvRWJrAY4Rb4BMUDC5F3oJUlv5U3pYW5jizO8tQskccdk+3zvR8R6v w2sVYLPekUQ0MVLZlxP82IIJcrwItI10QGaV48OecfBVHErd0Z3ZkQ77Q+b8eNAtF8c1 qHstEaSl4Cr7WqZCyfauiLkB5iulcuPeb+loKVtgE9LYIAdufnWobIt7C8j/h9RGEdfT 52ln9glBX9xYvqiUsZcqLYDrkRhJlrSJpia5jSzdVuk1bJn9whu2z38+tOWzC7EYZQlJ IL9Q== X-Gm-Message-State: AOJu0YxMI//muEjGoiHflvvARe0YR7Bn7aba3/x6ImUzdhQf5PXhjO2R t8FjtP863pbgt0xp6kKZ/PJ7GII+HuSrBkl66n2Q5XMBf+0h4qbTVucJADENm9x+59eZfFLbmEo FtNFikN5EkWP8zXTXfjzqH6KB X-Received: by 2002:a17:903:22ca:b0:1d0:700b:3f7b with SMTP id y10-20020a17090322ca00b001d0700b3f7bmr7952129plg.53.1702332249188; Mon, 11 Dec 2023 14:04:09 -0800 (PST) X-Received: by 2002:a17:903:22ca:b0:1d0:700b:3f7b with SMTP id y10-20020a17090322ca00b001d0700b3f7bmr7952106plg.53.1702332248841; Mon, 11 Dec 2023 14:04:08 -0800 (PST) Received: from localhost.localdomain ([2804:1b3:a802:3102:945e:6f76:fb73:6512]) by smtp.gmail.com with ESMTPSA id c21-20020a170902b69500b001d1d1ef8be6sm7133768pls.267.2023.12.11.14.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 14:04:08 -0800 (PST) From: lsoaresp@redhat.com X-Google-Original-From: masahiroy@kernel.org To: Masahiro Yamada Cc: Leonardo Bras , lsoaresp@redhat.com, Randy Dunlap , Nicolas Schier , Nathan Chancellor , Nick Desaulniers , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [RFC PATCH v5 1/1] scripts: Introduce a default git.orderFile Date: Mon, 11 Dec 2023 19:03:50 -0300 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20231208181802.88528-3-leobras@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 14:04:33 -0800 (PST) From: Leonardo Bras On Tue, Dec 12, 2023 at 03:05:38AM +0900, Masahiro Yamada wrote: > On Mon, Dec 11, 2023 at 10:14 PM wrote: > > > > From: Leonardo Bras > > > > On Sun, Dec 10, 2023 at 04:13:54AM +0900, Masahiro Yamada wrote: > > > On Sat, Dec 9, 2023 at 3:19 AM Leonardo Bras wrote: > > > > > > > > When reviewing patches, it looks much nicer to have some changes shown > > > > before others, which allow better understanding of the patch before the > > > > the .c files reviewing. > > > > > > > > Introduce a default git.orderFile, in order to help developers getting the > > > > best ordering easier. > > > > > > > > Signed-off-by: Leonardo Bras > > > > Acked-by: Randy Dunlap > > > > > > > > --- > > > > Changes since RFCv4: > > > > - Added scripts/* into "build system" section > > > > - Added "git-specific" section with this script and .gitignore > > > > - Thanks for this feedback Nicolas! > > > > > > > > Changes since RFCv3: > > > > - Added "*types.h" matching so type headers appear before regular headers > > > > - Removed line ends ($) in patterns: they previously provided a > > > > false-positive > > > > - Fixed build patterns to allow matching Kconfig, Kbuild & Makefile > > > > in any subdirectory > > > > > > > > Changes since RFCv2: > > > > - Fixed licence comment to from /**/ to # > > > > - Fixed filename in how-to comment > > > > - Fix build order: Kconfig -> Kbuild -> Makefile > > > > - Add *.mk extension > > > > - Add line-ends ($) to make sure and get the correct extensions > > > > - Thanks Masahiro Yamada for above suggestions! > > > > - 1 Ack, thanks Randy! > > > > > > > > Changes since RFCv1: > > > > - Added Kconfig* (thanks Randy Dunlap!) > > > > - Changed Kbuild to Kbuild* (improve matching) > > > > > > > > > > > > scripts/git.orderFile | 39 +++++++++++++++++++++++++++++++++++++++ > > > > 1 file changed, 39 insertions(+) > > > > create mode 100644 scripts/git.orderFile > > > > > > > > diff --git a/scripts/git.orderFile b/scripts/git.orderFile > > > > new file mode 100644 > > > > index 0000000000000..31649ff53d22c > > > > --- /dev/null > > > > +++ b/scripts/git.orderFile > > > > @@ -0,0 +1,39 @@ > > > > +# SPDX-License-Identifier: GPL-2.0 > > > > + > > > > +# order file for git, to produce patches which are easier to review > > > > +# by diffing the important stuff like header changes first. > > > > +# > > > > +# one-off usage: > > > > +# git diff -O scripts/git.orderFile ... > > > > +# > > > > +# add to git config: > > > > +# git config diff.orderFile scripts/git.orderFile > > > > +# > > > > + > > > > +MAINTAINERS > > > > + > > > > +# Documentation > > > > +Documentation/* > > > > +*.rst > > > > + > > > > +# git-specific > > > > +.gitignore > > > > +scripts/git.orderFile > > > > > > > Hello Masahiro, thanks for the feedback! > > > > > > > > > > > I think scripts/git.orderFile should be part of > > > "scripts/*" below. > > > > > > > > > > > > > > > > > > > > > > + > > > > +# build system > > > > +*Kconfig* > > > > +*Kbuild* > > > > +*Makefile* > > > > > > I do not like this because "foo-Makefile-bar" > > > is not a Makefile, but would match "*Makefile*". > > > > That makes sense. > > > > > > > > > > > If you do not use wildcard at all, 'Makefile' > > > will match to the root-dir and sub-directories. > > > > I tried a quick test here changing an mm/*.c file and mm/Makefile, and the > > above will print the .c file changes first in any situation here, so it > > won't have the desired behavior. > > > > Hmm, you are right. > > > OK, your suggestion below looks good. > > > Thanks. Thank you for this feedback! I will send a v6 shortly. Thank you! Leo > > > > > > > > > > But if we want to achieve the above we can do so with a slight change in > > the suggestion: > > > > > > >> > > > Kconfig > > > */Kconfig* > > > Kbuild > > > Makefile > > */Makefile > > > *.mak > > > *.mk > > > scripts/* > > > > > > > > > may satisfy your needs mostly. > > > > > > > I have tried the following in the Kernel root: > > > > $ find . |grep Makefile |grep -v Makefile$ > > ./arch/arm/mach-s3c/Makefile.s3c64xx > > ./arch/mips/Makefile.postlink > > ./arch/powerpc/Makefile.postlink > > ./arch/um/Makefile-os-Linux > > ./arch/um/Makefile-skas > > ./arch/um/scripts/Makefile.rules > > ./arch/x86/Makefile_32.cpu > > ./arch/x86/Makefile.um > > ./arch/x86/Makefile.postlink > > ./arch/riscv/Makefile.postlink > > ./drivers/firmware/efi/libstub/Makefile.zboot > > ./drivers/usb/serial/Makefile-keyspan_pda_fw > > [...] > > > > $ find . |grep Kbuild |grep -v Kbuild$ > > ./arch/mips/Kbuild.platforms > > ./scripts/Kbuild.include > > > > Which leads to an honest question: > > Don't we want to show changes on those files before C files, for example? > > > > If so, we need something like: > > > > # build system > > Kconfig* > > */Kconfig* > > Kbuild* > > */Kbuild* > > Makefile* > > */Makefile* > > *.mak > > *.mk > > scripts/* > > > > It would get rid of "foo-Makefile-bar" case but still match > > "Makefile-bar" case, which seems to be used around. > > > > Is that ok? > > > > Thanks! > > Leo > > > > > > > -- > Best Regards > Masahiro Yamada >