From: Christian Weisgerber Subject: Re: handle reference arguments that look like short object IDs To: gameoftrees@openbsd.org Date: Wed, 9 Mar 2022 14:51:46 +0100 Stefan Sperling: > This branch name happens to look like a short object ID for these commits: > > $ got log | grep '^commit 11ac' > commit 11acbd79e0b4d889558d2ee5c5773ca249512a41 > commit 11ac5a8e47e16be06760af9552d032a0c79da4e5 > commit 11ac80a095affa347969defb1ccdb14bbdba914f > commit 11aca5de0641899f73ba1613800ee4888b89ef9f > $ BTW, that is expected. I mean exactly expected. There are some $ got log | grep -c ^commit 218733 commits in OpenBSD src.git. That's $ bc -l l(218733)/l(2) 17.73881136901036053062 about 18 bits worth of commits. "11ac" is a 16-bit prefix, and since a cryptographic hash like SHA-1 is expected to produce equally distributed output, we can expect 2e18/2e16 == 4 occurrences of any arbitrary 16-bit prefix in the OpenBSD repository. -- Christian "naddy" Weisgerber naddy@mips.inka.de