From owner-dev-commits-src-all@freebsd.org Tue Jan 12 08:25:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 557044CE0D4; Tue, 12 Jan 2021 08:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFNvB3qlDz4Zpc; Tue, 12 Jan 2021 08:25:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6106E297F3; Tue, 12 Jan 2021 08:25:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10C8PvEg036744; Tue, 12 Jan 2021 08:25:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10C8PvOm036743; Tue, 12 Jan 2021 08:25:57 GMT (envelope-from git) Date: Tue, 12 Jan 2021 08:25:57 GMT Message-Id: <202101120825.10C8PvOm036743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 3518e1924536 - stable/11 - Fix newvers.sh to no longer print an outdated SVN rev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 3518e1924536de2facc96030ab2707751ab0f5fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 08:25:59 -0000 The branch stable/11 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=3518e1924536de2facc96030ab2707751ab0f5fc commit 3518e1924536de2facc96030ab2707751ab0f5fc Author: Ulrich Spörlein AuthorDate: 2020-12-23 21:29:34 +0000 Commit: Li-Wen Hsu CommitDate: 2021-01-12 08:24:00 +0000 Fix newvers.sh to no longer print an outdated SVN rev We have stopped using SVN, so the notes containing the old SVN revisions are no longer populated, so fall back to purely counting the number of commits (currently at about 255337). Also turn the format more into what git-describe produces, with a name first, then the number of commits and the hash last. Note that as we don't tag anything on `main`, git describe will never produce something useful there and finds the newest vendor tag that was merged in instead. Sample output: FreeBSD 13.0-CURRENT #6 main-c255126-gb81783dc98e6-dirty FreeBSD 12.2-STABLE #0 stable/12-c243035-gd16dac42b641-dirty MFC after: 3 weeks Reviewed by: imp, glebius Differential Revision: https://reviews.freebsd.org/D27751 (cherry picked from commit 8d405efd73d3991fe1647f91a2b7c9989dd5f18f) --- sys/conf/newvers.sh | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 593f14ef4145..9b7a1c19991a 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -212,40 +212,21 @@ if [ -n "$svnversion" ] ; then fi if [ -n "$git_cmd" ] ; then - git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then - svn=" r${svn}" - git="=${git}" - else - svn=`$git_cmd log --grep '^git-svn-id:' | \ - grep '^ git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -z "$svn" ] ; then - svn=`$git_cmd log --format='format:%N' | \ - grep '^svn ' | head -1 | \ - sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` - fi - if [ -n "$svn" ] ; then - svn=" r${svn}" - git="+${git}" - else - git=" ${git}" - fi - fi + git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="${git}-c${git_cnt}" + git="c${git_cnt}-g${git}" fi - git_b=`$git_cmd rev-parse --abbrev-ref HEAD` - if [ -n "$git_b" ] ; then - git="${git}(${git_b})" + git_b=$($git_cmd rev-parse --abbrev-ref HEAD) + if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then + git="${git_b}-${git}" fi if $git_cmd --work-tree=${VCSDIR}/.. diff-index \ --name-only HEAD | read dummy; then git="${git}-dirty" modified=true fi + git=" ${git}" fi if [ -n "$p4_cmd" ] ; then