Date: Mon, 28 Dec 2020 17:06:26 -0800 From: David Wolfskill <david@catwhisker.org> To: freebsd-current@freebsd.org Subject: Re: git and the loss of revision numbers Message-ID: <X%2BqBEmvOpuUmqAew@albert.catwhisker.org> In-Reply-To: <20201229005639.GS31099@funkthat.com> References: <54116640-E6A1-4C53-9D7E-4384F942628E@ellael.org> <8ABAC674-89AA-47BE-996C-4DF6E7713F21@ellael.org> <53dd689b-2401-8e90-f332-50c60c549c2e@FreeBSD.org> <CAPyFy2DW0YDUK%2Bkir2H_e8LVT-P-kQ0PMmKQO6m%2B016Wb=Hd0A@mail.gmail.com> <1d1e2003-0cc1-6e67-0ceb-f0fcba03f8f7@twcny.rr.com> <20201229005639.GS31099@funkthat.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Mon, Dec 28, 2020 at 04:56:39PM -0800, John-Mark Gurney wrote:
> 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)
> ....
Or save a process:
git rev-list --reverse HEAD | awk 'NR == 255241 {print; exit 0}'
3cc0c0d66a065554459bd2f9b4f80cc07426464a
(And thus:
git checkout $(git rev-list --reverse HEAD | awk 'NR == 255241 {print; exit 0}')
Could also pass the number to awk via the "-v var=value" command-line.)
Peace,
david
--
David H. Wolfskill david@catwhisker.org
While Trump successfully conned a lot of people for a while, in the
end he's just a failure throwing a temper tantrum because he lost.
See https://www.catwhisker.org/~david/publickey.gpg for my public key.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl/qgRJfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy
OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2
Pcn7nAf9FFcmQJqZjD4LBGpmk5Jy+FGIrc5kOpnH+jbo/Lo4z24rUB+jzy2aQQKn
Cpaz+2Tt5B0GeW6u++qsIKZc9SvOm3btr/RnKg9JGHRvyw4erHyLUozzWV+EAAfT
YynXLNfw/RKnq3RPgE1eyLCQi7nMziVYDy6JgUMz1sg0tlzGSrVTA9chmmEGqdl2
bVAxkmGZS15qvLr+bRaRqVqhA4OEDVezKdIXy5RRe8XZwCLP01NDPiRVMpOtq5Va
prWiY0FP5opcCm4yvgTKTs7f1kprUMaBbSH4KpaSDqGRi2b1QGlcF3nJ+eXrCKsr
JryDc/6WlkrFMcnhrGyHzWD/rbPJsw==
=ZAOG
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X%2BqBEmvOpuUmqAew>
