This is intended to be a tree-wide revision identifier, like a commit
hash or similar. This way, in builds from non-CVS trees where
per-file $NetBSD$ revision ids aren't incremented, we can still track
some version provenance of files with ident(1).
If defined, bsd.own.mk adds a macro _NETBSD_REVISIONID to CPPFLAGS
with the stringified text of NETBSD_REVISIONID.
In turn, if _NETBSD_REVISIONID is defined in sys/cdefs.h, then
__RCSID will put the concatenation of:
- `$NetBSD: '
- the file name
- ` '
- _NETBSD_REVISIONID
- ` $'
alongside the per-file revision id passed as an argument to __RCSID.
Since this is passed through command-line arguments, it doesn't cause
make to consider any dependencies to change when the revision id
changes -- so incremental builds remain incremental. And if you
don't set it, nothing changes from the __RCSID we had before.
Currently nothing sets NETBSD_REVISIONID automatically yet -- subject
to experimentation. Could just be verbatim commit hash, or could be
longer `hg identify' output -- or, in git, with the help of tags,
could be `git describe --dirty' output like
10.99.10-2924-gd01834fb75de
(or `10.99.10-2924-gd01834fb75de-dirty' if the working tree is dirty)
for the commit at
https://mail-index.netbsd.org/source-changes/2024/05/24/msg151526.html
which is 2924 linear commits after the commit bumping sys/param.h to
10.99.10 and (in the current git conversion) had commit hash starting
with d01834fb75. This may require some discipline around branching
and tagging but it's worth a shot -- we'll see.
Based on a patch from joerg@ a while ago.