From: Wesley Schwengle <wesley@opndev.io>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Show patchlevel in version string
Date: Sun, 13 Aug 2023 18:54:49 +0000 [thread overview]
Message-ID: <513c6cff-bb1a-485a-b043-0959f80cd3e6@opndev.io> (raw)
In-Reply-To: <20220410213529.GD27526@tarpaulin.shahaf.local2>
On 4/10/22 17:35, Daniel Shahaf wrote:
> 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?
I want to back track a little from my original answer from last Friday.
How do we progress, this patch in itself could be merged I think without
having to have all kinds of other logic to always show it. I think this
is a nice first step. I'm willing to work on the other solution to
always include a patch level based on some other logic.
However I placed the patch level between the brackets because I wasn't
sure if/how we want to display the version. As stated in the commit body
of the patch:
> Because I'm not aware how downstream deals with a difference in version
> strings I've decided to add it to the vendor/os type bit. Debian for
> example uses `debian/5.8-6+b2' as a patch level. This would probably
> break scripts which expect `zsh x.y.z' if the patch level replaced the
> ZSH_VERSION string.
$ zsh --version
zsh 5.9 (x86_64-debian-linux-gnu)
I would expect (or assume) that Debian wants to keep showing the 5.9
version and not the debian/5.9-4+b4 bit. This would make parsing the ZSH
version tricky, eg, zsh --version | awk '{print $2}' suddenly gives a
different output than scripts would expect.
If you run zsh --version from a bash shell you get the version string,
you don't have access to the $ZSH_VERSION shell variable.
Now, if we use this ZSH_PATCHLEVEL in any build, what logic are we going
to apply?
* Do we remove the CUSTOM_PATCHLEVEL output from the --version call if
the CUSTOM_PATCHLEVEL equals the ZSH_VERSION string?
* Do we replace the ZSH_VERSION with the CUSTOM_PATCHLEVEL if the
ZSH_VERSION includes -dev, eg 5.9.0.1-dev becomes 5.9-240-g51ae2a5ff
To reiterate. I'm open to add improvements to always displaying the
patch level, but I would love to see this patch merged before we agree
on more things. I think adding it to the OS/Vendor bit has very little
impact on scripts but it aids us in seeing what is being used (for
example when build from source).
Cheers,
Wesley
--
Wesley Schwengle
E: wesley@opndev.io
prev parent reply other threads:[~2023-08-13 18:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-03 17:38 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
2023-08-09 13:05 ` Wesley
2023-08-13 18:54 ` Wesley Schwengle [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=513c6cff-bb1a-485a-b043-0959f80cd3e6@opndev.io \
--to=wesley@opndev.io \
--cc=d.s@daniel.shahaf.name \
--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).