Page MenuHomeFreeBSD

Fix to no longer print an outdated SVN rev

Authored by uqs on Dec 23 2020, 9:37 PM.



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 255126).

Also turn the format more into what git-describe produces, with a name
first, then potentially a number of commits on top of that 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

Diff Detail

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

uqs requested review of this revision.Dec 23 2020, 9:37 PM

what will this look like on stable (eventually)?

what will this look like on stable (eventually)?

FreeBSD 13.0-CURRENT #6 main-c255126-gb81783dc98e6-dirty
FreeBSD 12.2-STABLE #0 stable/12-c243035-gd16dac42b641-dirty

are you worried about the slash in there? It seems that neither svn or hg actually put the branch name in there. I think we should have it though, although it's a bit redundant with the -CURRENT or 12.2-STABLE, but it more closely resembles git describe and we shouldn't be overly gratuitously different for no good reason, IMHO.

Add sample output and MFC reminder to commit message

(does this even update in arc? I have no idea ...)

This may have a slight improvement when compiling from a non-branch point - a detached state. Now

if [ -n "$git_b" ] ; then

will just produce 'HEAD", which is useless.

We can either just cut away the branch name, so result will be "c255126-gb81783dc98e6-dirty", or add word "detached" (maybe). Suggested patch:

if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then

update to skip HEAD as suggested by glebius

This looks good. If it is checked out of subversion on -stable, then we'll get the right uname, so it can likely be MFC'd... We're not writing new svn revs to git, but there may be something I'm missing.

an SVN checkout of stable/12 will produce this, after the MFC (i.e. nothing changes for that)

VERINFO='FreeBSD 12.2-STABLE #0 r368820M: Fri Dec 25 17:21:30 CET 2020'

uqs edited subscribers, added: gjb, lwhsu; removed: imp.
This revision was not accepted when it landed; it landed in state Needs Review.Dec 26 2020, 3:54 PM
This revision was automatically updated to reflect the committed changes.