Date: Tue, 17 Oct 2017 09:36:57 +0000 From: blubee blubeeme <gurenchan@gmail.com> To: Yuri <yuri@rawbw.com> Cc: Mathieu Arnold <mat@freebsd.org>, "O. Hartmann" <ohartmann@walstatt.org>, FreeBSD Ports <freebsd-ports@freebsd.org> Subject: Re: [ports]: GH_TAGNAME: how to figure out this tagname on downloadable archives? Message-ID: <CALM2mE=mWrf1xQrPE7R7vKRA7aGcoryYbDBMG6zoPc-UXHFuwQ@mail.gmail.com> In-Reply-To: <a7236dbd-84f3-e838-55fe-1b9f58a42543@rawbw.com> References: <20171015211940.44065925@thor.intern.walstatt.dynvpn.de> <19aa7f0a-3b52-5d34-cf80-136ef3fe489b@rawbw.com> <20171015214725.68e32dd9@thor.intern.walstatt.dynvpn.de> <c677889a-41c3-5105-4f87-f0159d0f65d1@FreeBSD.org> <a7236dbd-84f3-e838-55fe-1b9f58a42543@rawbw.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I expanded how to get the most up to date hash that works without going through the hassle of cloning the repo. Best On Tue, Oct 17, 2017, 13:01 Yuri <yuri@rawbw.com> wrote: > On 10/16/17 07:46, Mathieu Arnold wrote: > > The first 7 digits may, or may not be sufficient. 7 is a magic number, > > and should not be used. You should, instead, ask git directly what the > > abbreviation should be with, for instance, `git log --abbrev-commit`. > > It may give you a number that seven digits long, but it may very well > > give you a longer one. I repeat, do not simply truncate a hash to its > > first 7 digits, it may not be enough. > > `git log --abbrev-commit` solution has two shortcomings. It only protects > against preexisting hash collisions and not from future collisions. So, the > port's fetch can still spontaneously fail in the future as a result of a > future commit that introduces a collision. Secondly, it requires the manual > clone of the repository which is inconvenient. IMO, it's more practical to > just use 7 digits, and switch to the full hash in an unlikely event when 7 > digits fail. So far, this method virtually always worked. > > Yuri > > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALM2mE=mWrf1xQrPE7R7vKRA7aGcoryYbDBMG6zoPc-UXHFuwQ>