All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	 linux-kernel@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH v2] setlocalversion: work around "git describe" performance
Date: Sun, 17 Nov 2024 13:20:27 +0100	[thread overview]
Message-ID: <877c92m4qc.fsf@prevas.dk> (raw)
In-Reply-To: <CAK7LNAQdxx6yHGc9-+=aQxeOkBs-qGxf_1namqWp-gUwQ-uo-w@mail.gmail.com> (Masahiro Yamada's message of "Sat, 16 Nov 2024 08:17:36 +0900")

On Sat, Nov 16 2024, Masahiro Yamada <masahiroy@kernel.org> wrote:

> This patch was not sent to linux-kbuild ML
> (and it can be one reason when a patch falls into a crack),
> but I guess I am expected to review and pick it.

Sorry, but get_maintainer.pl doesn't tell one to cc linux-kbuild.

>>
>> Reported-by: Josh Poimboeuf <jpoimboe@kernel.org>
>
>
> Maybe, the comprehensive tag list looks like this?
>
> Reported-by: Sean Christopherson <seanjc@google.com>
> Closes: https://lore.kernel.org/lkml/ZPtlxmdIJXOe0sEy@google.com/
> Reported-by: Josh Poimboeuf <jpoimboe@kernel.org>
> Closes: https://lore.kernel.org/lkml/309549cafdcfe50c4fceac3263220cc3d8b109b2.1730337435.git.jpoimboe@kernel.org/

Fine by me.

>>
>> +try_tag() {
>> +       tag="$1"
>> +
>> +       # Is $tag an annotated tag?
>> +       [ "$(git cat-file -t "$tag" 2> /dev/null)" = "tag" ] || return 1
>
> The double-quotes for tag are unneeded.
>
> "tag"  --> tag
>

OK. The current script isn't consistent here, though (--no-local and +
are quoted where they need not be), and I find having the quotes on both
sides of = more visually appealing. Not a hill I'm gonna die on.

> This function returns either 1 or 0, but how is it used?
>

Well, you're right that it's not used currently, but I might as well let
the return value reflect whether it succeeded or not. I played around
with some variation of

  if [ -n "${file_localversion#-}" ] && try_tag "${file_localversion#-}" ; then
    :
  elif [ -n "${file_localversion}" ] && try_tag "${version_tag}${file_localversion}" ; then
    :
  elif try_tag "${version_tag}"
    :
  else
    count=""
  fi

but in the end decided to keep the current logic of testing some shell
variable (previously $desc, not $count). Still, I see no reason to make
the early returns do "return 0".

Rasmus

  reply	other threads:[~2024-11-17 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12 21:05 [PATCH v2] setlocalversion: work around "git describe" performance Rasmus Villemoes
2024-11-13 20:38 ` Josh Poimboeuf
2024-11-15 23:17 ` Masahiro Yamada
2024-11-17 12:20   ` Rasmus Villemoes [this message]
2024-11-17 14:29     ` Masahiro Yamada

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=877c92m4qc.fsf@prevas.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=peff@peff.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.