On Fri, Dec 16, 2022 at 11:07:17AM +0200, Lev Stipakov wrote:
> From: Lev Stipakov <l...@openvpn.net>
> Git magic to get branch name
>   git rev-parse --symbolic-full-name HEAD
> doesn't work when we're on tag, which is the case when
> we build releases. In this case, use tag name as branch name
> with another git magic:
>   git describe --tags
> This fixes https://github.com/OpenVPN/openvpn/issues/199.


I would propose to invert the logic:

Do "git describe --exact-match" first.

That matches only annotated tags that point to this commit.
So it will actually use the tag consistently independent of
whether you have the commit checked out with detached HEAD
or via the release branch.

And then fall back to the previous mechanism if that doesn't

  Frank Lichtenheld

Openvpn-devel mailing list

Reply via email to