Skip to content

Export git_commit_count_since() and git_log_since() - #38

Merged
TroyHernandez merged 4 commits into
mainfrom
git-helpers
Jul 20, 2026
Merged

TroyHernandez merged 4 commits into
mainfrom
git-helpers

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Promotes the git count/log primitives behind heartbeat() to exported API, so downstream tooling (cerebro's briefing sources) can compose custom activity reports without carrying their own git plumbing.

  • git_commit_count_since(repo_dir, since_date): commit count on HEAD since a date; 0 for non-repos (rev-parse guarded, worktree/dubious-ownership safe).
  • git_log_since(repo_dir, since_date = NULL, n = 5, format = c("oneline", "iso")): recent commit lines; NULL since = unbounded; "iso" gives tab-separated ISO-local timestamp, hash, subject. Failed git yields a bare character(0) (no status attribute).

heartbeat() behavior unchanged. Version bumped to 0.7.2.2.

The count and log primitives behind heartbeat(), promoted to API so
downstream tooling (cerebro briefing sources) can compose custom
activity reports without carrying their own git plumbing.
git_log_since() gains since_date = NULL (no lower bound) and a format
argument: "oneline" (default, unchanged) or "iso" (tab-separated
ISO-local timestamp, short hash, subject). heartbeat() behavior is
unchanged.
system2() tags failed-command output with a status attribute; strip it
so non-repos and empty repos yield an attribute-free empty log.
@TroyHernandez
TroyHernandez merged commit 72522c3 into main Jul 20, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the git-helpers branch July 20, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant