Skip to content

Commit

Permalink
newvers: tweak uname to be more useful
Browse files Browse the repository at this point in the history
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 & freebsd#3 had the largest consensus. There was a diversity of
opinion on freebsd#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
  • Loading branch information
bsdimp committed Jan 29, 2021
1 parent 8fee65d commit 8a51f14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/conf/newvers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a51f14

Please sign in to comment.