diff --git a/documentation/content/en/books/handbook/cutting-edge/_index.adoc b/documentation/content/en/books/handbook/cutting-edge/_index.adoc --- a/documentation/content/en/books/handbook/cutting-edge/_index.adoc +++ b/documentation/content/en/books/handbook/cutting-edge/_index.adoc @@ -596,6 +596,41 @@ Branch names, such as `stable/9`, are listed at link:https://www.FreeBSD.org/releng/[www.freebsd.org/releng]. . Before compiling or upgrading to FreeBSD-STABLE , read [.filename]#/usr/src/Makefile# carefully and follow the instructions in <>. Read the {freebsd-stable} and [.filename]#/usr/src/UPDATING# to keep up-to-date on other bootstrapping procedures that sometimes become necessary on the road to the next release. +[[translate-n-number]] +=== The N-number +Regardless of which system on is running, version information is compiled into the kernel and can be retrieved with man:uname[1]. +For example: +[source,shell] +.... +% uname +FreeBSD 14.0-CURRENT #112 main-n247514-031260d64c18: Tue Jun 22 20:43:19 MDT 2021 fred@machine:/usr/home/fred/obj/usr/home/fred/git/head/amd64.amd64/sys/FRED +.... +Looking at the 4th field, it is made up of several parts: +[source,shell] +.... +main-n247514-031260d64c18 + +main <.> +n247514 <.> +031260d64c18 <.> +.... +<.> Branch name +<.> The N-number is a linear count of commits back to the start of the Git repository starting with the git hash included in the line. +<.> Git hash + +The `git rev-list` command is used to find the n-number corresponding to a Git hash. +For example: +[source,shell] +.... +% git rev-list --first-parent --count 031260d64c18 <.> +247514 <.> +.... +<.> git hash to translate (the hash from the above example is reused) +<.> The n-number. + +Usually this number is not all that important. +However, sometimes fixes are committed to the tree and this can help determine if the hash of the commit is before or after the version reported using the two n-numbers. + [[makeworld]] == Updating FreeBSD from Source