Skip to main content

Module git_cache

Module git_cache 

Source
Expand description

TTL-based cache for git command results.

Prevents redundant git invocations within the same session by caching results with a configurable time-to-live (default 10s for status/diff, 60s for log).

Functionsยง

git_cached
Run a git command with TTL caching. Returns cached result if available.
git_diff_cached
Short-TTL (10s) for git diff.
git_log_cached
Longer-TTL (60s) for git log (rarely changes within a session).
git_status_cached
Short-TTL (10s) for frequently-changing git data (status, diff).
invalidate
Invalidate all cached entries for a given directory.