Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Show patchlevel in version string




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 missed this thread, I thought it went dead after my original
submission. I didn't get the memo ;) Sorry for the delay on my part.

To answer the question: Why not for all builds? I don't think regular
release builds would include this. I borrowed the approach from git,
although they do what you are asking. Git uses GIT-VERSION-GEN[^1] in
their Makefile[^2] to include the options in their build process. I'm
not all the confident with Makefile voodoo. I just thought it was handy
for those who want it and my thought was that most developers have some
kind of custom install zsh where they can add this logic.

If you want it for every build, I would need to get some help from
someone who is sufficient at Makefiles probably. I can look into it
regardless. But my question is than, would the same approach as git
takes be ok with you?

[^1]: https://github.com/git/git/blob/master/GIT-VERSION-GEN
[^2]: https://github.com/git/git/blob/master/Makefile

--
Wesley Schwengle






Messages sorted by: Reverse Date, Date, Thread, Author