Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3958929rdb; Mon, 11 Dec 2023 05:14:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpX9GHNqmdQ3nf2hNab1yQjixWTI+KTfuWihcY2lPP7k44TyGo5u4yqLcIXGv+7T4zbyj8 X-Received: by 2002:a05:6a00:1956:b0:6cd:fe6e:ac9b with SMTP id s22-20020a056a00195600b006cdfe6eac9bmr5285691pfk.0.1702300464904; Mon, 11 Dec 2023 05:14:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702300464; cv=none; d=google.com; s=arc-20160816; b=XCy2iTe9mW0FfBtchFd42WCq9GoyqNWguSuIA3V54Dm1t/wJvprB87de8I/skv4JKs sDma/HZN+HLyBQ0cPkVO1SwbBceNOrwHN+2WGrzsEGuy4X5+dKXPZxV+2xVYN4Oe142H lhtUYCsg447t1jmWK79Q5AiseBEztig7C0E38e4a8/MutbDk5N2IiVbgr4EGrRUDVPr+ cYKK4PbiV4qPb8DCou1HpJCcUTdcKzQ51eZfchGJYHwAVKPxUv37ZWpQmkeYTfKf9pA3 3iEsLea2RzhEv0NIpfz3cR1ckqkVsjTHrAycYC4OGYYUOdtK1SUQA5OyLVultr9wQ0Fp 4ITg== 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=TGpqgCQoHA7gfzhcNnMoEqvxE+usWH3FO302tA/0S5M=; fh=07g6XDst2jxWrBqkR27ttYl++OB/LFtouVQJfHCUkn8=; b=CdXsLDAB0zhnqYlN0FSPvPGHX/5cC2lbeBkjUqE5h3B8Ggz7G+tQt6O3LmXMu2iKCG 2LhbfXL15wbdmSvEuVLLgVbR/v8GIouPybiiFgC4AoQF3BUZ2DlCFJoSnQLAO1C1RDV+ d+AGlR/mJNWs4UAMes4TTr4eE6gfOO8M90p9pwN1t534PmU4mR8Qf254JjVec2jGaKX4 WyCeWoyyc9uXWi6s5bX4fRbfPU/9ZS8c8IxqDGITbLhYHZZ/yHuRDegCLauX96h2XKER 0y67I5lhH61SCaXN+/X0ga5nqewRZtlU6u6HcUjYkZopBV5J9j9OgPvMRSlNo3YLWKiv HqQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hrqiR4jJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id s14-20020a62e70e000000b006ce7ce0e746si5976533pfh.245.2023.12.11.05.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:14:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hrqiR4jJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id EE8238068865; Mon, 11 Dec 2023 05:14:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343541AbjLKNOE (ORCPT + 99 others); Mon, 11 Dec 2023 08:14:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234350AbjLKNOD (ORCPT ); Mon, 11 Dec 2023 08:14:03 -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 500E4C4 for ; Mon, 11 Dec 2023 05:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702300449; 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=TGpqgCQoHA7gfzhcNnMoEqvxE+usWH3FO302tA/0S5M=; b=hrqiR4jJTa8jkcQsfpBiQD8Wf+Y+ibxpkIzKCgYgnaasUWHFNWoX9P7BMK5ijck4DYm6p9 2KtBIUVZJDsIZJtMom0PhEK+mzSS6IfjW6tXpmhwtj6pPVx01/lNwhyxhuRfSXZnIxGa3q slNoAAnXxIkum7xNo0SHELJKKCA4V7w= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-639-t1hT2rKKMtSAMxaSpC0q1Q-1; Mon, 11 Dec 2023 08:14:07 -0500 X-MC-Unique: t1hT2rKKMtSAMxaSpC0q1Q-1 Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-5c641d55e27so2762190a12.1 for ; Mon, 11 Dec 2023 05:14:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702300446; x=1702905246; 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=TGpqgCQoHA7gfzhcNnMoEqvxE+usWH3FO302tA/0S5M=; b=WGVjPoLHsGI1KksOxHBonon7SxApfIXFysvVVQr5tC8uv3Nbd51LmyqOAFxqmQLTKA mFKvIgAmWwu+5RCdcmWHLhYJfORIs9tqWrwtw5zOquI6TrlJD/UvEcIxGrtlMbAAd9T9 ELswGjpTPP+Vt9RnEspv21D7Vks0RJiBjgHhn4i4UZ6JI+B0jDUXqHpWD294VLiVZhXv QWkrQd0Cyl/LwQZ96g/ZZLwKaXxkeQ3MvLqQQiHYZ6PM0xr2CfeQ+GjhCqPX8M7cZiY3 rP4eTDS20ttb5z0UNkjTiKqQt/Wse7uClBgMhJgP7jYxu8UVb4DKrTllhnd08bab/v1r u3qA== X-Gm-Message-State: AOJu0Yz6Vea8OV2TwvuJxaG3HDGwAM2dbdnZNTPVm7Y2ujJxIfE9I170 HjEPI3D40nj6PfcHOAtAvL7gLM554ZlmnpNjRB8Apm7yo2miL4kPutxVA1RiFD1uvzGlyAspvT0 dMgwCr6HcRqnR6C1xpQNisgoT X-Received: by 2002:a05:6a20:da8b:b0:18f:cbdd:3244 with SMTP id iy11-20020a056a20da8b00b0018fcbdd3244mr5741495pzb.47.1702300446351; Mon, 11 Dec 2023 05:14:06 -0800 (PST) X-Received: by 2002:a05:6a20:da8b:b0:18f:cbdd:3244 with SMTP id iy11-20020a056a20da8b00b0018fcbdd3244mr5741484pzb.47.1702300445976; Mon, 11 Dec 2023 05:14:05 -0800 (PST) Received: from LeoBras.redhat.com ([2804:1b3:a802:3102:945e:6f76:fb73:6512]) by smtp.gmail.com with ESMTPSA id s16-20020a62e710000000b006ce3bf7acc7sm6177155pfh.113.2023.12.11.05.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:14:05 -0800 (PST) From: lsoaresp@redhat.com X-Google-Original-From: masahiroy@kernel.org To: Masahiro Yamada Cc: Leonardo Bras , 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 10:13:52 -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.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 05:14:22 -0800 (PST) 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. 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