Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2021 08:25:56 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: 98dfc7de6176 - stable/11 - newvers: append commit count to uname version string
Message-ID:  <202101120825.10C8Puli036720@gitrepo.freebsd.org>

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

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

commit 98dfc7de6176972d7b6b7dce9b18439c0c9edabe
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:22:30 +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 661bbc3978e6..593f14ef4145 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -233,6 +233,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.10C8Puli036720>