Re: [PATCH] Docs: SubmittingPatches: Clarify convention for git commit references

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux