Git dependencies are by default cloned bare under $HOME/.cargo/git/db/
and the appropriate commit(s) are checked out under $HOME/.cargo/git/checkouts/
, in subfolders named after the commit (Cargo Home - The Cargo Book).
The top-level folder name under both db
and checkouts
is the package name concatenated with some sort of hash (basically confirmed here) ; for example, I have a git dependency on tokio in one of my projects that is checked out in a folder named tokio-17689456922d6a5f
. The individually checked out commits appear as subfolders of this top-level folder.
Is there any documentation on where this hash comes from or how it is calculated, and why it is useful to have it (probably for package name collisions across registries?)? I understand that it might be an unstable/internal detail. It seems that for git dependencies of the same package the hash is stable, but across packages it might not be.