LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Ariel Marcovitch <arielmarcovitch@gmail.com>
Cc: Valentin Rothberg <valentinrothberg@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH v2] checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit
Date: Fri, 10 Sep 2021 11:13:08 +0900 [thread overview]
Message-ID: <CAK7LNAQHTL_djSLXVyuvn1mOtvumNAKo8iE7tQiyONxtJ3a4xg@mail.gmail.com> (raw)
In-Reply-To: <20210901145212.478066-1-arielmarcovitch@gmail.com>
On Wed, Sep 1, 2021 at 11:52 PM Ariel Marcovitch
<arielmarcovitch@gmail.com> 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 <arielmarcovitch@gmail.com>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 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
prev parent reply other threads:[~2021-09-10 2:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-01 14:52 Ariel Marcovitch
2021-09-10 2:13 ` Masahiro Yamada [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK7LNAQHTL_djSLXVyuvn1mOtvumNAKo8iE7tQiyONxtJ3a4xg@mail.gmail.com \
--to=masahiroy@kernel.org \
--cc=arielmarcovitch@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=valentinrothberg@gmail.com \
--subject='Re: [PATCH v2] checkkconfigsymbols.py: Forbid passing '\''HEAD'\'' to --commit' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).