git and the loss of revision numbers

Ulrich Spörlein uqs at freebsd.org
Wed Dec 30 16:04:20 UTC 2020


On Mon, 2020-12-28 at 19:38:05 -0500, monochrome wrote:
>what would be the git command for reverting source to a previous version
>using these numbers? for example, with svn and old numbers:
>svnlite update -r367627 /usr/src
>
>this is needed often when it blows up for someone tracking current

You need to fetch the git notes, then you can grep them for the SVN rev 
you're looking for.

$ git fetch origin "refs/notes/*:refs/notes/*" && git fetch
$ git checkout `git log --format=%h --notes --grep='revision=367627$' main`

It's git commit 9aa6d792b549 for reference.


>On 12/28/20 11:27 AM, Ed Maste wrote:
>> On Mon, 28 Dec 2020 at 07:08, Renato Botelho <garga at freebsd.org> wrote:
>>>
>>> FreeBSD bast.garga.net.br 13.0-CURRENT FreeBSD 13.0-CURRENT #19
>>> 3cc0c0d66a0-c255241(main)-dirty:
>>>               ^
>>>               This is an incremental counter of commits
>>
>> Also, uqs@ recently fixed an issue in newvers.sh (including the final,
>> non-updating svn revision) and reordered the information. An example
>> of the new format:
>>
>> main-c255126-gb81783dc98e6-dirty
>>   \     \       \            \
>>    \     \       \             local modifications
>>     \     \        hash
>>      \      commit count
>>        branch

Note, the `g` in there is by design, it's the format that git-describe 
will barf out.

hth
Uli


More information about the freebsd-current mailing list