From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: Version numbers for VCS snapshots Date: Sat, 20 Feb 2016 23:35:15 -0500 Message-ID: <20160221043515.GA17164@jasmine> References: <874mem8mwx.fsf@gnu.org> <8737u344ov.fsf@elephly.net> <87twmjp2qs.fsf_-_@gnu.org> <56A063D1.80608@uq.edu.au> <20160121062251.GA25513@jasmine> <20160121184424.GB12122@jasmine> <87fuxqwsm7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXLjz-0002fn-4T for guix-devel@gnu.org; Sat, 20 Feb 2016 23:35:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXLjx-0000FI-0A for guix-devel@gnu.org; Sat, 20 Feb 2016 23:35:27 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:52322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXLjv-0000CU-O6 for guix-devel@gnu.org; Sat, 20 Feb 2016 23:35:24 -0500 Content-Disposition: inline In-Reply-To: <87fuxqwsm7.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org On Thu, Jan 21, 2016 at 10:05:36PM +0100, Ludovic Courtès wrote: > Leo Famulari skribis: > > > On Thu, Jan 21, 2016 at 10:40:41AM +0100, Ricardo Wurmus wrote: > >> > >> Leo Famulari writes: > >> > >> > That sounds good to me. There was some discussion of how much of the > >> > hash to keep here: > >> > http://lists.gnu.org/archive/html/guix-devel/2015-12/msg00136.html > >> > > >> > I like this method that I've seen in some of the packages, because it > >> > keeps the version tidy while preserving the full hash: > >> > > >> > --8<---------------cut here---------------start------------->8--- > >> > (define-public hello > >> > (let ((commit "e8e46123cfe62170a2f7f79db6b471b66ae36947")) > >> > (package > >> > (name "hello") > >> > (version (string-append "2.10-1" (string-take commit 8))) > >> > (source (origin > >> > (method git-fetch) > >> > (uri (git-reference > >> > (url "git://git.sv.gnu.org/hello.git") > >> > (commit commit))) > >> > (sha256 > >> > [...] > >> > --8<---------------cut here---------------end--------------->8--- > >> > >> I like this approach (though I’ve been taking 9 characters of the commit > >> ;)). > > > > I like 10 but I wanted to match your example upthread ;) > > I prefer 7! This is how Git usually truncates SHA1s, so it can’t be wrong. I stumbled across this email earlier, which reminded me of this discussion about hash lengths: https://lkml.org/lkml/2010/10/28/287 There are currently 13 7-character hash collisions in Guix's git repo: $ git rev-list --objects --all | cut -c1-7 | sort | uniq -dc 2 0d2b24c 2 11e0632 2 1f3ab8d 2 229bd6c 2 7c4a7b7 2 9ff8b63 2 aa27b56 2 c10c562 2 d96cdce 2 dab4329 2 dc27d1c 2 ea119a2 2 f56cc27