Re: git and the loss of revision numbers

From: John-Mark Gurney <jmg_at_funkthat.com>
Date: Mon, 28 Dec 2020 16:56:39 -0800
monochrome wrote this message on Mon, Dec 28, 2020 at 19:38 -0500:
> 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

Get the hash from a commit number:
$git rev-list --reverse HEAD | tail -n +255241 | head -n 1
3cc0c0d66a065554459bd2f9b4f80cc07426464a

so:
git checkout $(git rev-list --reverse HEAD | tail -n +255240 | head -n 1)

> 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_at_ 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

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."
Received on Mon Dec 28 2020 - 23:56:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:26 UTC