Date: Mon, 1 Feb 2021 22:31:58 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: f19a4e97d3b0 - stable/13 - newvers: tweak uname to be more useful Message-ID: <202102012231.111MVw2D070278@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f19a4e97d3b0905dfda5aaebba49f68a1e07fa3e commit f19a4e97d3b0905dfda5aaebba49f68a1e07fa3e Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-01-25 19:53:31 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-02-01 22:31:35 +0000 newvers: tweak uname to be more useful The current uname is branch-cXXXX-gHASH Three changes to make uname more useful. 1. Move from using git rev-list --count to git rev-lis --count --first-parent since that gives a better, incrementing number. 2. Report this count as 'nXXXXX' rather than 'cXXXXX' because c is part of a hash and we've changed the sematnics of XXXXX 3. Remove g to make HASH cut and pastable. Durting review, #1 & #3 had the largest consensus. There was a diversity of opinion on #2, but on the whole it was positive so I'll acknowledge the dissent, but move forward with something seems to have support since the dissent was all about what letter to use where I chose 'n'. MFC After: 3 days Reviewed by: rgrimes, emaste (earlier version) Differential Revision: https://reviews.freebsd.org/D28338 (cherry picked from commit 8a51f14a7833fd14e1f125e63a0af9d260dcd287) --- sys/conf/newvers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index a40392d91b9b..12d4daa771be 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -253,9 +253,9 @@ fi if [ -n "$git_cmd" ] ; then git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) if [ "$($git_cmd rev-parse --is-shallow-repository)" = false ] ; then - git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) + git_cnt=$($git_cmd rev-list --first-parent --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="c${git_cnt}-g${git}" + git="n${git_cnt}-${git}" fi fi git_b=$($git_cmd rev-parse --abbrev-ref HEAD)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102012231.111MVw2D070278>