Use git core.abbrev
We hard code SHA1 abbreviations to 7 characters. This is fine for small repositories, but if larger repositories begin to use Radicle, then we will run into the birthday problem (see [0]).
To allow this to be configurable, we should respect the locally set
core.abbrev Git configuration, if any, and default to 7 if it’s missing.
From the git-config docs (or [0]):
core.abbrev
Set the length object names are abbreviated to. If unspecified or set to “auto”, an appropriate value is computed based on the approximate number of packed objects in your repository, which hopefully is enough for abbreviated object names to stay unique for some time. If set to “no”, no abbreviation is made and the object names are shown in their full length. The minimum length is 4.
What I’m interested in are the cases where core.abbrev can be legally set to “auto” or “no”. I’m assuming that if we want to respect core.abbrev, should we also respect these special cases and their behaviors?