From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5530AC433FE for ; Fri, 10 Sep 2021 02:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CE106113E for ; Fri, 10 Sep 2021 02:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229763AbhIJCPK (ORCPT ); Thu, 9 Sep 2021 22:15:10 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:32783 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhIJCPJ (ORCPT ); Thu, 9 Sep 2021 22:15:09 -0400 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 18A2Djon010955; Fri, 10 Sep 2021 11:13:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 18A2Djon010955 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1631240026; bh=udWjwfq60F1tLUm1m72YBO5+pyGaJaRnnlyiYr4sAfE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=0XX9KQjQjryldcYbWVmumEwcAwLbQvGI71V4r9jNi5tE/NScXniByF9byz7RBE/6X mrRztoQgkQfumszF/YjLIAgZYi3nfaAa0P3aMkefxpjS8Kgn/vFue62f1SUaRD0L74 t2TRt4YcUgyQhRM9zYoZPjqVpvSczO1BxlgPnti3R/U+WLmkEcNj0rIlNE8Vb3XdCJ MeHu48ANoDQYKFm7f1zC6uTO4xcIwOO6n21XiyUgzFytVANcZ7Y2BREo0mPbznHFJS nAl9g2HBZdXJmNpc2O0sdA4LgjO7L/mqGZ1k2CZLjk4E4C0bf44yhzVuIC0u45HBo7 MwdIlhNeBUfsA== X-Nifty-SrcIP: [209.85.216.53] Received: by mail-pj1-f53.google.com with SMTP id k23-20020a17090a591700b001976d2db364so418224pji.2; Thu, 09 Sep 2021 19:13:46 -0700 (PDT) X-Gm-Message-State: AOAM532PF+sYMl7Jo7ZuJoLLKDy1vPs0sOwJ9hjZ7p2gxXo6jj9RTvKh cwH6YoOcIG6OAikS88fAQ78Qtw1Ho9DihX9g4Zs= X-Google-Smtp-Source: ABdhPJzsQEVxfZfrPHtmSoiJqpIaQCbePzktoUaB9fjFhHO8qjDLzEBmXpWaRfbbZkOqp2DwuT5bFmnqZJO2BlsLKL0= X-Received: by 2002:a17:902:e04d:b0:13a:70c9:11b8 with SMTP id x13-20020a170902e04d00b0013a70c911b8mr5250710plx.82.1631240025345; Thu, 09 Sep 2021 19:13:45 -0700 (PDT) MIME-Version: 1.0 References: <20210901145212.478066-1-arielmarcovitch@gmail.com> In-Reply-To: <20210901145212.478066-1-arielmarcovitch@gmail.com> From: Masahiro Yamada Date: Fri, 10 Sep 2021 11:13:08 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit To: Ariel Marcovitch Cc: Valentin Rothberg , Linux Kernel Mailing List , Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 1, 2021 at 11:52 PM Ariel Marcovitch wrote: > > As opposed to the --diff option, --commit can get ref names instead of > commit hashes. > > When using the --commit option, the script resets the working directory > to the commit before the given ref, by adding '~' to the end of the ref. > > However, the 'HEAD' ref is relative, and so when the working directory > is reset to 'HEAD~', 'HEAD' points to what was 'HEAD~'. Then when the > script resets to 'HEAD' it actually stays in the same commit. In this > case, the script won't report any cases because there is no diff between > the cases of the two refs. > > Prevent the user from using HEAD refs. > > A better solution might be to resolve the refs before doing the > reset, but for now just disallow such refs. > > Signed-off-by: Ariel Marcovitch > Signed-off-by: Masahiro Yamada > --- > scripts/checkkconfigsymbols.py | 3 +++ > 1 file changed, 3 insertions(+) Applied to linux-kbuild. Thanks. > diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py > index b9b0f15e5880..c57c990c3244 100755 > --- a/scripts/checkkconfigsymbols.py > +++ b/scripts/checkkconfigsymbols.py > @@ -102,6 +102,9 @@ def parse_options(): > "continue.") > > if args.commit: > + if args.commit.startswith('HEAD'): > + sys.exit("The --commit option can't use the HEAD ref") > + > args.find = False > > if args.ignore: > > base-commit: 087e856cfb76e9eef9a3a6e000854794f3c36e24 > -- > 2.25.1 > -- Best Regards Masahiro Yamada