git equivalent of svn r-number
Matthew Seaman
matthew at FreeBSD.org
Sun Jan 3 16:22:47 UTC 2021
On 03/01/2021 12:54, Robert Huff wrote:
>
> (I think this may have already been asnwered, but I can't find
> the thread.)
> What is it?
> Where is it stored?
> How do I get git to report it?
There is no exact equivalent of the repository wide unique and
monotonically increasing SVN revision number in git, simply because of
the difference in the way git works, with a large number of distrubuted
repositories rather than one central one.
Instead, there is a vaguely similar concept which is the SHA-1 hash of a
commit. You can find these by using `git log` or `git reflog` -- so with
this, git can tell you if the branch you are on contains a particular
commit, which is almost, but not quite, usable for the much the same
purposes as the SVN revision number.
There's also `git describe` which gives you some combination of the
latest tag on your timeline, how many commits there have been on that
branch since then and the hash of the latest commit, like so:
```
codling:/usr/src:% git describe HEAD
release/8.1.0-103892-g84eaf2ccc6aa
```
Note: the hash is the hex string at the end -- this is actually the
unambiguous prefix of the SHA-1 hash of the latest commit on your
timeline (preceeded by a 'g' for 'git' -- g obviously isn't a
hexadecimal digit):
```
codling:/usr/src:% git log HEAD^1..HEAD
commit 84eaf2ccc6aa05da7b7389991d3023698b756e3f (HEAD -> main, freebsd/main)
Author: Konstantin Belousov <kib at FreeBSD.org>
Date: Mon Dec 21 19:02:31 2020 +0200
x86: stop punishing VMs with low priority for TSC timecounter
I suspect that virtualization techniques improved from the time when we
have to effectively disable TSC use in VM. For instance, it was
reported
(complained) in https://github.com/JuliaLang/julia/issues/38877 that
FreeBSD is groundlessly slow on AWS with some loads.
Remove the check and start watching for complaints.
Reviewed by: emaste, grehan
Discussed with: cperciva
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27629
```
You can also access the SVN r-numbers from before the cut-over via git
notes -- see Warner's collection of documentation at
https://github.com/bsdimp/freebsd-git-docs/ for a description of how
that works and much more besides --- these docs will be polished up and
added to the handbook eventually.
Cheers,
Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20210103/b46d22dc/attachment.sig>
More information about the freebsd-questions
mailing list