git_log_since: List recent commits in a repository

View source: R/heartbeat.R

git_log_sinceR Documentation

List recent commits in a repository

Description

Returns up to n commit lines from HEAD, newest first. With format = "oneline" each line is git's --oneline (short hash and subject); with format = "iso" each line is tab-separated ISO-local timestamp, short hash, and subject. A NULL since_date means no lower bound. Anything that is not a git working tree returns character(0). The log primitive behind heartbeat, exported for downstream tooling that composes its own activity reports.

Usage

git_log_since(
  repo_dir,
  since_date = NULL,
  n = 5L,
  format = c("oneline", "iso")
)

Arguments

repo_dir

Path to a repository.

since_date

A Date (or string in YYYY-MM-DD form), or NULL for no lower bound. Commits from 00:00 local time on this date are included.

n

Integer. Maximum commits to return.

format

"oneline" (default) or "iso".

Value

Character vector of commit lines (possibly empty).

Examples

# A plain directory is not a repository: empty log
git_log_since(tempdir(), Sys.Date() - 7)

saber documentation built on Nov. 10, 2026, 9:06 a.m.