From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: wesley@opndev.io
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Show patchlevel in version string
Date: Sun, 10 Apr 2022 21:35:29 +0000 [thread overview]
Message-ID: <20220410213529.GD27526@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <20210903173803.4005670-1-wesley@opperschaap.net>
Wesley Schwengle wrote on Fri, Sep 03, 2021 at 13:38:03 -0400:
> After this patch is applied, you get to see the following version string
> after you configured zsh with `--enable-custom-patchlevel=$(git describe)':
>
> $ ./Src/zsh --version
> zsh 5.8.0.2-dev (x86_64-pc-linux-gnu/zsh-5.8-481-g64befeb4c)
Adding the git revision there makes sense, I suppose, but why should
this only be done when that configure option is used? The git revision
is added to ZSH_PATCHLEVEL (which is a shell variable, not an
environment variable) by default, without needing any configure flags.
Or another perspective: CUSTOM_PATCHLEVEL is used to cause
$ZSH_PATCHLEVEL to be set to something other than its default. So,
why shouldn't the #else branch emit the default value of $ZSH_PATCHLEVEL?
tl;dr: Why not include the (build's default) value of $ZSH_PATCHLEVEL in
the output?
Cheers,
Daniel
> Signed-off-by: Wesley Schwengle <wesley@opperschaap.net>
> ---
> Src/init.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Src/init.c b/Src/init.c
> index 878a53a37..a04d599c3 100644
> --- a/Src/init.c
> +++ b/Src/init.c
> @@ -421,8 +421,14 @@ parseopts(char *nam, char ***argvp, char *new_opts, char **cmdp,
> /* GNU-style long options */
> ++*argv;
> if (!strcmp(*argv, "version")) {
> +#ifdef CUSTOM_PATCHLEVEL
> + printf("zsh %s (%s-%s-%s/%s)\n",
> + ZSH_VERSION, MACHTYPE, VENDOR, OSTYPE, CUSTOM_PATCHLEVEL);
> +#else
> printf("zsh %s (%s-%s-%s)\n",
> ZSH_VERSION, MACHTYPE, VENDOR, OSTYPE);
> +#endif
> +
> LAST_OPTION(0);
> }
> if (!strcmp(*argv, "help")) {
> --
> 2.33.0.113.g6c40894d24
>
>
next prev parent reply other threads:[~2022-04-10 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-03 17:38 [PATCH] Show patchlevel in version string Wesley Schwengle
2022-03-31 5:43 ` Lawrence Velázquez
2022-03-31 7:55 ` Axel Beckert
2023-08-13 18:25 ` Wesley Schwengle
2022-04-10 21:35 ` Daniel Shahaf [this message]
2023-08-09 13:05 ` Wesley
2023-08-13 18:54 ` Wesley Schwengle
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=20220410213529.GD27526@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=wesley@opndev.io \
--cc=zsh-workers@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).