Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756027AbbEUTEF (ORCPT ); Thu, 21 May 2015 15:04:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57263 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755382AbbEUTEB (ORCPT ); Thu, 21 May 2015 15:04:01 -0400 Message-ID: <555E2C1B.7080307@redhat.com> Date: Thu, 21 May 2015 12:03:55 -0700 From: Josh Stone User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Joe Perches , Bjorn Helgaas CC: Jonathan Corbet , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" Subject: Re: [PATCH] Docs: SubmittingPatches: Clarify convention for git commit references References: <20150521155954.9522.33952.stgit@bhelgaas-glaptop2.roam.corp.google.com> <1432225162.20840.49.camel@perches.com> <1432227843.20840.64.camel@perches.com> In-Reply-To: <1432227843.20840.64.camel@perches.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1678 Lines: 53 On 05/21/2015 10:04 AM, Joe Perches wrote: > On Thu, 2015-05-21 at 11:44 -0500, Bjorn Helgaas wrote: >> My git-fu isn't awesome > > Yeah, mine either. > >> (git log --oneline --abbrev-commit --abbrev=10 >> | cut -f1 -d" " | grep ...........), but I *think* we have three git >> SHA-1s so far that aren't unique in 10 characters (8b82547e338/e >> 3ee50141858/b a7aa92d1b49/a), and everything is still unique in 11 or >> 12-char SHA1s. > > Josh's seems to be strong though. Thanks. :) > http://blog.cuviper.com/2013/11/10/how-short-can-git-abbreviate/ > > 12 should be safe for a little while longer. Yeah. For a clean checkout of linux.git, my script says: $ git rev-parse HEAD 1113cdfe7d2c1fe08b64caa3affe19260e66dd95 $ git-unique-abbrev 4148865 objects 4: 4148865 / 65536 5: 4069048 / 948597 6: 908685 / 435663 7: 63915 / 31866 8: 4145 / 2072 9: 290 / 145 10: 24 / 12 11: 4 / 2 12: 0 / 0 d597639e2036f04f0226761e2d818b31f2db7820 tree 541 d597639e203a100156501df8a0756fd09573e2de tree 1612 ef91b6e893a00d903400f8e1303efc4d52b710af blob 4826 ef91b6e893afc4c4ca488453ea9f19ced5fa5861 blob 12981 I added "git cat-file --batch-check" on the final list of objects. Anyway, just one new 11-char collision since I wrote that blog post. I also have a bigger linux repo tracking many more remotes -- with 8344399 objects, this collides at 11-chars in 10 objects, 5 prefixes, yet 12 is still clean. Getting closer though... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/