Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2021 08:25:48 GMT
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: bd89fbd27c6b - stable/12 - newvers: append commit count to uname version string
Message-ID:  <202101120825.10C8PmhK036570@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/src/commit/?id=bd89fbd27c6b582df4bba750df652bb36402fc7e

commit bd89fbd27c6b582df4bba750df652bb36402fc7e
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2019-08-01 14:13:04 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2021-01-12 08:19:43 +0000

    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
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D20462
    
    The "Relnotes" flag in the commit message is removed in cherry-pick as
    git repo doesn't affect the stable/11 and stable/12 release.
    
    (cherry picked from commit ecb2bbc081ae906956f4718ec946b9e4fcea241f)
---
 sys/conf/newvers.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index e047f1e68d39..4b5651fdd4bf 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -231,6 +231,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})"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101120825.10C8PmhK036570>