Skip to main content

Module cache

Module cache 

Source
Expand description

On-disk cache that makes re-runs fast. Everything lives under one tool-specific directory in the XDG cache location ($XDG_CACHE_HOME/contributor-graphs, else ~/.cache/contributor-graphs):

  • clones/<key>/ bare partial clones (see crate::repo).
  • commits/<key>.json parsed git log output, keyed by the branch tip SHA so it is reused only while the history is unchanged.
  • github/authors.json commit SHA -> resolved GitHub login + avatar URL (immutable, so never expires).
  • github/profiles.json login -> display name + company (time-limited).
  • github/avatars.json avatar URL -> embedded data URI (time-limited).

The git-history and clone caches alone turn a multi-minute whole-org run into a few seconds when nothing has changed; the GitHub caches remove the thousands of API calls and avatar downloads on top of that.

Structs§

Author
CachedCommit
A commit as stored in the git-history cache (no source index; that is re-assigned per run when the pool is rebuilt).
Caches
In-memory view of the GitHub caches for one run. Loaded once, queried before any network call, and written back at the end. Reads are skipped (treated as misses) when refresh is set, but existing entries are still preserved on save so unrelated repositories keep their cache.
CommitsCache
One repository’s cached git log, valid only while tip and the filters still match the live repository.

Functions§

root
The tool’s cache directory, or None if no home/XDG dir can be found.