When running git rev-parse --short HEAD
on repository A I get a hash output of length 7 as that is the default length for the --short
option in the git documentation.
When running the same command within repository B I get a hash output of length 9. What could override the default length of the --short
option probably on a per-repository basis?
Looks like the documentation is out of date. This could happen due to one of two things:
git rev-parse --short
will try to return a unique hash string. This seems unlikely but theoretically possible.OR
git rev-parse --short
will actually give a number no smaller than 7 but that might be higher due to the number of packed objects in the repo.https://git-scm.com/docs/git-config#git-config-coreabbrev
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.
So the official docs are out of date and the --short
option doesn't force the length to 7, even if I haven't overriden the length (which I hadn't.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With