Re: history damage in linux.git
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Apr 21, 2016, 16:36 UTC
- Message-ID
- <vpqy486udfp.fsf@anie.imag.fr>
- In-Reply-To
- <20160421155408.GE3186@aepfle.de>
Olaf Hering <olaf@aepfle.de> writes:
Show 8 quoted lines
> On Thu, Apr 21, John Keeping wrote: > >> $ git tag --contains aed06b9cfcabf8644ac5f6f108c0b3d01522f88b > > Thanks for that, I did not know this variant. > > Unless git does not do it for me, I may hackup my script like that to > find the earlierst tag:
"git tag" has a --sort key, so you can sort on dates, and "| head -n 1". See also "git for-each-ref" which is essentially a superset of what "git tag" does, and for-each-ref is plumbing, so safer to use in scripts (we have a strong tradition of backward compatibility for plumbing).
This relies on the dates recorded in the commits, which may be wrong (typically if someone commited on a machine with an incorrect clock). But hopefully not.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/