Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp687147pxb; Wed, 1 Sep 2021 07:58:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk50pZw2jXd4cMwcEPVhq3U256fHakjm7sd8g62LumhFbBqWjxDzI7iNgbiLrJzDj15qhl X-Received: by 2002:a50:c94d:: with SMTP id p13mr35393edh.246.1630508283295; Wed, 01 Sep 2021 07:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630508283; cv=none; d=google.com; s=arc-20160816; b=UYGinbwSGKjGyCSTxFv2txDRQ0LCst+WcEH/D/aC+3M9hpHt1vY35XbOUW3R3hXWO9 U+5P1lUiOm6HCxqSZ4gs6RwOdhacGs6d1hUiL65Y9S+ovdAUu6zqs3/QFbv/oiQD97Yi 9jh/mIZ3yarNfNSHwGyajSKH+3avVTTq1F1GAX3DQEsJJ6+hLk0ZWwczzDD9lX4vrYtj A+QXFB2+O+iE8pCrvFFtmq2IlC3tfzM94NM421zmO/SLRhHvRM+kBNbIGbiMw18g+RGY MI4j8Yuma9K3GUcAK5XjXHlLEVOo0eQtcTEtQgtRZHTmSrD9d31aHXtpD7SpjbVxpkc5 Jlag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YKUsiLrEjEckeebWqhS6BfbDvc5bYqy4ztmYo/I0y4s=; b=eo6E+3bs/ErNd5oTsfus7jTSJE/BTS4Hpy4CxXal5yunpb1mCjERxY0UEJpbcMKgAX gJm1l7GROj4UT0yHNtA3bPGbsaAK5tcvu2FRxH1Pr2y6LQyQHXRI8Ik/I0cjI1pROy7N pUlLQXtAhPXoW1bfhDclj8j0mB2wbauVU0uOL/uFzILepH0d7VODveRhUm2dMVxb6K/c 7+WbO8ti4kP0AYzm517EFBttMTTY9XPEqlNct3t+A4CfhKhX8wVGLgQxsKBt9Qt2gAOW 0piFKxNWWC8ZwDtME5U8c1/Lbg45lFaVC9NJHumv3r4bElnSk11Y2JsHGAVsCqvLanUy otKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZHPsjZfd; 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=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 yd28si80594ejb.350.2021.09.01.07.57.15; Wed, 01 Sep 2021 07:58:03 -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=@gmail.com header.s=20210112 header.b=ZHPsjZfd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244846AbhIAOx3 (ORCPT + 99 others); Wed, 1 Sep 2021 10:53:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244176AbhIAOx2 (ORCPT ); Wed, 1 Sep 2021 10:53:28 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BA05C061575; Wed, 1 Sep 2021 07:52:31 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id m9so5006688wrb.1; Wed, 01 Sep 2021 07:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YKUsiLrEjEckeebWqhS6BfbDvc5bYqy4ztmYo/I0y4s=; b=ZHPsjZfdOqIyKtqI6ty2vp38b46NTXU9YBc/yTjmUuNJPDZNIR+uzQU5DJ0YsPaHlY HNYoWx72+MTf03F80iHwxIKopLTNeU90/QZRL0S2ux9qEDkU2WNpbsrEtRghMxe/KDyH 2DvM9ERjPwv5CYWqoNL+aHtdzLZ0Vawnnq061MuiStqehqudg9G7P/wK3dFx1DEwMnci Nbx8VoXlAtWlS2RvUa+K+VSxsbDbWlQ6NtHzD0ES2wVT2q5NtYDU4kFa/q0RVTpgXk5J 4yyz6UUMe/kbpYax2bQ4IESJMYSzQYwz8lyZLK6gR/CV755mP7ez5y6K8zm6XgVRBC0u 64qQ== 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:mime-version :content-transfer-encoding; bh=YKUsiLrEjEckeebWqhS6BfbDvc5bYqy4ztmYo/I0y4s=; b=qjDOb9bOIJcRGzh+krxyQsQFh+epfC2Hycoi+FoqtHY7Y/mvbLmsdyhIW9ss5ZHaqQ rHWHDVvKxOpMxR9erEHj9ZrhDB33W8ZeDgjFUN3BrNchKW4BnQYhyqorZLbpja8wcZKJ hGeMCwPnvvZvzJVNGwwIhOwWWi0DM7Z8oGsyYn320jlN6eMrHc7/rcxdvmkGftYc97zP nR2qNtjBglPwddKibGU0TNvg/gFEcGJtPQMBW/hCc7RfqOnKlB1ZXGLQkL+503zgECUt h6rq1HIev6hsihnPbXV/LNDttMyQlOqbMLGAgB6zJFytX1d13pUcYYhEXOoG4qyAHakX 9zfA== X-Gm-Message-State: AOAM530qeb0Vu+WZyffcRlh02dIz0i/ol7pCzau5JL9UAHpP2TFhsqdH 7+P/KmBWYTj8pzKYHk7a/2rx0gQvx1DKMw== X-Received: by 2002:adf:c184:: with SMTP id x4mr23410302wre.266.1630507950168; Wed, 01 Sep 2021 07:52:30 -0700 (PDT) Received: from localhost.localdomain ([147.235.73.50]) by smtp.googlemail.com with ESMTPSA id o12sm5573131wmr.2.2021.09.01.07.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 07:52:29 -0700 (PDT) From: Ariel Marcovitch To: masahiroy@kernel.org, valentinrothberg@gmail.com Cc: arielmarcovitch@gmail.com, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH v2] checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit Date: Wed, 1 Sep 2021 17:52:12 +0300 Message-Id: <20210901145212.478066-1-arielmarcovitch@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Masahiro Yamada --- scripts/checkkconfigsymbols.py | 3 +++ 1 file changed, 3 insertions(+) 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