From owner-freebsd-ports@freebsd.org Tue Oct 17 05:00:57 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B934E2C3B5 for ; Tue, 17 Oct 2017 05:00:57 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6BABA821C9; Tue, 17 Oct 2017 05:00:57 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yv.noip.me (c-24-6-186-56.hsd1.ca.comcast.net [24.6.186.56]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id v9H50nSn059258 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 16 Oct 2017 22:00:51 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-24-6-186-56.hsd1.ca.comcast.net [24.6.186.56] claimed to be yv.noip.me Subject: Re: [ports]: GH_TAGNAME: how to figure out this tagname on downloadable archives? To: Mathieu Arnold , "O. Hartmann" Cc: FreeBSD Ports References: <20171015211940.44065925@thor.intern.walstatt.dynvpn.de> <19aa7f0a-3b52-5d34-cf80-136ef3fe489b@rawbw.com> <20171015214725.68e32dd9@thor.intern.walstatt.dynvpn.de> From: Yuri Message-ID: Date: Mon, 16 Oct 2017 22:00:48 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 05:00:57 -0000 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