Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2740835pxb; Tue, 24 Aug 2021 06:35:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/O6KbJlmrJrcuhlEiqUxk7/EiqORyIQdBAdXY5iX1xcimT0oLlrn5iNb5ghjANqhV53F0 X-Received: by 2002:a05:6638:38a:: with SMTP id y10mr35037874jap.110.1629812121981; Tue, 24 Aug 2021 06:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629812121; cv=none; d=google.com; s=arc-20160816; b=TZoQeCntfjUkcTN6D+32ssPXHyMxWWKvJZA8uFiHKtmGkmRkZZYu1SGHdXiVldNUL1 mEsSF7MVa7keXJU7m9t4WromaCttQi1hwZDqxqaUOX4gkyCpOJ2sVXYi6sSMD+hxTb25 hwlyQiet43e4Yavau51/Mdr97fMUpmG4YLfGBeRRZdR9GmuOIeVOB2vpsSbBDRTbHrUJ xfkliyf/qykeIaPMaJxuerrxHge+i2h8iDqTAqwSwPVnArH9CSw728SbanCgAcrw6GSP awNUlx+k6jxihpndHXHgF0yKwxsnWn9Lb5KclA4SysIflIrCU0Yva80YvxnEXlKxvezm J7Ew== 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=j/k7gQQ5rcheWIFS9kTtHhs7q+yMlORMz7nITinR2Ds=; b=Ld1++0j5F3Ju0OlPfC9GPut02H23+4xVN13pfZNQqHLQtD7Wi2MeKIrg1mqTO5PhRI T7tGQfS3rc2CHZd46nTZYRtn6qj+4Otbiu5eYI27YuOQVn0863HTA8mqLivbruLFTz/c zevOzS5jPYMUNkSNbJTo8lp8AEmV49f/syrUHpZJwj5UuIt+vMlvIljSqYDjkVBFjNi1 iuQchORM3jaJaypQ/twEbbnuGhHbhthMtuLcYFma7b8iDx2qbeju0pl5gGMevXKvGKPT 2l4YdZe+TGqWwvRYYuT06v+AbbbHQ1baniWZcYswAFek0ShPviNboz/jTnCqV/xkpSXj 6DbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xDIoXgT6; 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 p4si807418jam.67.2021.08.24.06.35.09; Tue, 24 Aug 2021 06:35:21 -0700 (PDT) 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=xDIoXgT6; 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 S237554AbhHXNdq (ORCPT + 99 others); Tue, 24 Aug 2021 09:33:46 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:39391 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237539AbhHXNdp (ORCPT ); Tue, 24 Aug 2021 09:33:45 -0400 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 17ODWYf6013733; Tue, 24 Aug 2021 22:32:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 17ODWYf6013733 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1629811955; bh=j/k7gQQ5rcheWIFS9kTtHhs7q+yMlORMz7nITinR2Ds=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=xDIoXgT6ovciswl+50kD56ZetG7jkQF3DDXxh7MBR5hvbAEFhZzILigwf1SPQmNrU kVxUuOGrNXjokX4FrHd1kFRhQzpEbg/n0BvIpzJYaMILlGi+Z3nDSGDvJc+8Bzr3mW qs5AoqMk7yiDq+zlivlJJMx8eiaCbyNe9VzhgWAEVPykhSH/75+D35Qm15hWkTFgJQ dfMq5rK1X2mVJjtP/6GneM5mO0r9DOfAI8Z0ndEp0xGm7oZPrV67pRNn82BC/siUTN WVuEuKqxYW3+eiilSl6OTWquRlkKqjbhTqTKzmTxoLKkywXA1O2lf74E5b06H6/0RN u9oWXa/13SL7Q== X-Nifty-SrcIP: [209.85.214.182] Received: by mail-pl1-f182.google.com with SMTP id d17so12217630plr.12; Tue, 24 Aug 2021 06:32:34 -0700 (PDT) X-Gm-Message-State: AOAM531i3USIaDIdt1j9MyMkSUeUmAQfXQVpukZDUHQHJdLqcqoYyzTw 5npXVTHP3bXl3m108v6jANKiiTlUFXnxoLk5VKw= X-Received: by 2002:a17:902:a5c5:b029:12c:a867:a839 with SMTP id t5-20020a170902a5c5b029012ca867a839mr33455408plq.71.1629811953985; Tue, 24 Aug 2021 06:32:33 -0700 (PDT) MIME-Version: 1.0 References: <20210822192205.43210-1-arielmarcovitch@gmail.com> <20210822192205.43210-4-arielmarcovitch@gmail.com> In-Reply-To: <20210822192205.43210-4-arielmarcovitch@gmail.com> From: Masahiro Yamada Date: Tue, 24 Aug 2021 22:31:57 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/3] checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit To: Ariel Marcovitch Cc: Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , Valentin Rothberg Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 23, 2021 at 4:23 AM 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. Better than doing nothing. So, applied to linux-kbuild. > Signed-off-by: Ariel Marcovitch > --- > scripts/checkkconfigsymbols.py | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py > index 875e9a2c14b2..6259698e662d 100755 > --- a/scripts/checkkconfigsymbols.py > +++ b/scripts/checkkconfigsymbols.py > @@ -103,6 +103,9 @@ def parse_options(): > "continue.") > > if args.commit: > + if args.commit.startswith('HEAD'): > + sys.exit("The --commit option can't get use the HEAD ref") > + > args.find = False > > if args.ignore: > -- > 2.25.1 > -- Best Regards Masahiro Yamada