mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: Joe Perches <joe@perches.com>, Bjorn Helgaas <bhelgaas@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH] Docs: SubmittingPatches: Clarify convention for git commit references
Date: Thu, 21 May 2015 12:03:55 -0700	[thread overview]
Message-ID: <555E2C1B.7080307@redhat.com> (raw)
In-Reply-To: <1432227843.20840.64.camel@perches.com>

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...

  reply	other threads:[~2015-05-21 19:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 15:59 Bjorn Helgaas
2015-05-21 16:19 ` Joe Perches
2015-05-21 16:44   ` Bjorn Helgaas
2015-05-21 17:04     ` Joe Perches
2015-05-21 19:03       ` Josh Stone [this message]
2015-05-22 15:36 ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=555E2C1B.7080307@redhat.com \
    --to=jistone@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=joe@perches.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome