Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1305400pxb; Sun, 22 Aug 2021 12:28:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4S7X2AuRI17B3wwtL02ge2XFLrioIvq4YcZSb4KBOglmq4DnhX558bgYzGgf6mb9j0RsQ X-Received: by 2002:a6b:5911:: with SMTP id n17mr22001305iob.180.1629660482593; Sun, 22 Aug 2021 12:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629660482; cv=none; d=google.com; s=arc-20160816; b=NltLqeuqsywBRkSniiZb82EPtpfExqKALyFRxVEwJji24gsH/krEpwJxYXkr0t4efX rPw0dJShnP4yvN0IQMDQj81wh+KcWrghoUS3NA4A3qLhN5Idcs68JAO3XNOBg/GCalQB 6u0xt3TfvH/S+X6vFDnCdMzLqOjdoAwFyFA35nbVh3qif9Ke1x4kkE72ZevGD3PhdaAv g7mf9NENrVKN2zIzu8fr3Fzrgvfu43SAmSDYLGc4eVIWCBf3Wc23i+dLSlZSbE5OlvH/ OBWmBZesmG2vfTacok50MEQpCxPaJuXEToBNyFqOtsBM6v4x/Xio4GoEjHGwfvvBC+Rp gtEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=jdnBbcis2LRjQudu7rmiYqSfk0ZwyRk00EIcmbT2dtw=; b=LGCCWax5nesHoVLKT9VR2ZLLUW/dhnOfRmkYRICfeWLbDni6MMqUppeWYD/TreIScR CtHXEiDnuCvS2761ERKr8Yx0QwksUFlCKQXskHSVP5CvrKTq53sOm4zPxCNX+DZkKoZo RkNK9Tmi6UXQhKOlKyH4LpkuUo0bkCQQpenRaZ2L/XWwIY+3SRgVbmlTz0bUQjdHml8C Eq6eyk6c1hWVUqghuVSWTCvWaka+ZQWWA0+hYDj22z3SFXs0o1p7c1OzFkNNhH+1aaev laodpHfXiSyKklGiu8xJ4wuhfa5+sgiG0nJahhmh8bMVacYZ5M1p9mnov/e5cr4udrlL 1exQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LvvZ9fpl; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si12519966iog.99.2021.08.22.12.27.51; Sun, 22 Aug 2021 12:28:02 -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=fail header.i=@gmail.com header.s=20161025 header.b=LvvZ9fpl; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232734AbhHVTXo (ORCPT + 99 others); Sun, 22 Aug 2021 15:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232845AbhHVTXn (ORCPT ); Sun, 22 Aug 2021 15:23:43 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7ADC06175F; Sun, 22 Aug 2021 12:23:01 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id q3so22757822edt.5; Sun, 22 Aug 2021 12:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jdnBbcis2LRjQudu7rmiYqSfk0ZwyRk00EIcmbT2dtw=; b=LvvZ9fplj5UTmUNevRsgsFYSQfT5JNWjExroXKrez2z3oolTtazTk8vXwzWzn2CGAg hzO02jn0PQePSvej1UvWpItrJgNDulApXtGRL90xbGqVZb5aw2HstzxlHCDeS/wDTaxg 6ZAsN2+isQ9K56gtD8u8ZidJ5DsjyTts15b0vb6BMX09TBvbG6k1SJgsbofD7A0LgLXr 5qrBDBb566gYjoFJYmGI2ADEWclmH5aaJUXCwX0Y5+BBT5d12rTzSe3OVNEhOUwrs2cO +dQuhOl594T2ssWJuNaMT2gZ7cjtl1W8OBmbe1N8jdjS4b9+WSgMSdzQPVH12JV9OV9m f0+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jdnBbcis2LRjQudu7rmiYqSfk0ZwyRk00EIcmbT2dtw=; b=CQdZPH0x4W6nzTpFKwGvYAWGUiBaCK+Y2R0A/iQtNtGn2BROkEfGVHOCTXopm72+cj Ku8eUGmmW/oCDVU8/UztUGSV/vdQB1VU14ZbEYSA+DstZ6mhRH0qZmP70qEEyg3IUxP0 6EXm0lswxSTqGpqNhrJa6WGnhCZKdE8khXsimZJkvl3ZmtZXi/+7fuKwJaSZHUYwDd0t WB+MSBBsU4H5Gw/PegUnsEfJL5tBaBDpNs2Pwj7ui8/ztpJNL/+I5SDqEx8mdyJWtqjk 427GRxbCv9PdSLjOBuh8sVUNLfwhJ0607f/5msLTu5rzfZV2bm/6Gv1I2C63yNBi4NNQ 9z9g== X-Gm-Message-State: AOAM533EhooNZait4UD2n9B+RXDIM1f7ndtpBblJw8X7FQ7kq1286+yu QW87FoWwYA+VovbAiVsU34M= X-Received: by 2002:a05:6402:1c8a:: with SMTP id cy10mr4945814edb.112.1629660180229; Sun, 22 Aug 2021 12:23:00 -0700 (PDT) Received: from localhost.localdomain ([147.235.73.50]) by smtp.googlemail.com with ESMTPSA id o6sm1577950eje.6.2021.08.22.12.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Aug 2021 12:23:00 -0700 (PDT) From: Ariel Marcovitch Cc: Ariel Marcovitch , Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit Date: Sun, 22 Aug 2021 22:22:03 +0300 Message-Id: <20210822192205.43210-4-arielmarcovitch@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210822192205.43210-1-arielmarcovitch@gmail.com> References: <20210822192205.43210-1-arielmarcovitch@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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