newvers: append commit count to uname version string

In a git world this provides a facsimile of a monotonically increasing
version number.  This might be refined further, but this provides a
starting point for investigation.

Reviewed by:	cem
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20462
This commit is contained in:
emaste 2019-08-01 14:13:04 +00:00
parent f7de72081f
commit 1214ed36dc

View File

@ -291,6 +291,10 @@ if [ -n "$git_cmd" ] ; then
git=" ${git}"
fi
fi
git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null)
if [ -n "$git_cnt" ] ; then
git="${git}-c${git_cnt}"
fi
git_b=$($git_cmd rev-parse --abbrev-ref HEAD)
if [ -n "$git_b" ] ; then
git="${git}(${git_b})"