Subject: Re: [PATCH] GIT-VERSION-GEN: Use standard versioning suffix

From: Junio C Hamano <[email-masked]>
Date: Fri, 05 Sep 2025 08:19:00 -0700

"brian m. carlson" <[email-masked]> writes:

> On 2025-09-05 at 12:14:38, Jonas Rebmann wrote:
>> In snapshot builds of git, git-version uses a modified variant of the
>> git-describe output, e.g. 2.51.0.178.g2462961280 instead of
>> 2.51.0-178-g2462961280 for seemingly historical reasons.
>> 
>> This is not semver compliant which makes the output harder to parse in
>> tooling such as b4, which currently errors out when using a snapshot
>> build of git.
>
> Git doesn't follow SemVer.  We make breaking and incompatible changes
> without bumping the major version all the time, so it doesn't make sense
> to say that we should follow SemVer for version numbers.
>
> I would say that since Git has had this version number format for a long
> time, b4, which is much newer and should be designed to work with Git,
> should gracefully handle the Git version number rather than have Git
> conform to b4.

Well said.

If somebody cares about the format deeply enough to patch it, it is
likely that somebody else cares equally deeply about the current
format and depends on it, as Git these days are used by more than a
few thousands of people, and "semvar syntax" is too weak a reason to
change it for everybody.

If somebody wants to have their own versioning scheme, there is an
escape hatch to drop the "version" file in their source material,
which does not have to change versioning schemes used by other
builders with a patch like this one.

Thanks.