Skip to content

v0.5.2

Choose a tag to compare

@shrsv shrsv released this 19 Jun 15:14

Release v0.5.2

Date: 2026-06-19

Summary

This release adds the lrc query command that helps with making sense of
your git repo history from an lrc use perspective.

It ships with some default commands but you can extend it with aliased SQL
queries to modify it in any way you wish.

Thanks to @iconicvenom for leading the change and making his first contribution to the repo!

Default stats query

$ lrc query stats
Action    Commits  AvgIter  AvgCoveragePct
--------  -------  -------  --------------
skipped   225      1.2      4
none      112      0        0
reviewed  89       2.8      30.9
vouched   34       1.4      13.1

Help and Examples

$ lrc query --help
NAME:
   lrc query - Query LiveReview history with SQL or a saved alias (e.g. 'lrc query stats')

USAGE:
   lrc query [command options]

DESCRIPTION:
   Builds an in-memory SQLite table of this repo's review history (parsed
   from the 'LiveReview Pre-Commit Check' commit trailers) and runs SQL — or a
   saved alias — against it. Output as a table or, with --json, machine-readable.

   TABLE: review_log (one row per commit)
      hash         TEXT     full commit hash
      short_hash   TEXT     abbreviated hash
      author       TEXT     commit author name
      email        TEXT     commit author email
      date         TEXT     author date, ISO-8601 (sortable, e.g. 2026-06-17T10:30:00Z)
      branch       TEXT     branch the query ran from
      subject      TEXT     commit subject (first line)
      action       TEXT     'reviewed' | 'vouched' | 'skipped' | 'none'
      iterations   INTEGER  review iterations (0 if none)
      coverage     INTEGER  review coverage percent 0-100 (0 if none)

   ALIASES: built-in (stats, by-author, recent) plus your own. Manage them with
   'lrc query add|list|view|delete'. User aliases are saved in ~/.lrc/queries.toml:

      [queries]
      skipped = "SELECT date, subject FROM review_log WHERE action='skipped'"
      my-cov  = "SELECT ROUND(AVG(coverage),1) FROM review_log WHERE action='reviewed'"

   EXAMPLES
      lrc query stats                        # run a built-in alias
      lrc query stats --json                 # same data, as JSON
      lrc query list                         # show all aliases + a preview
      lrc query view stats                   # show an alias's full SQL

      # Was a specific commit reviewed? (incident forensics)
      lrc query "SELECT short_hash, action, iterations, coverage FROM review_log WHERE hash LIKE 'a1b2c3%'"

      # Per-author review effort
      lrc query "SELECT author, COUNT(*) AS commits, SUM(action='reviewed') AS reviewed FROM review_log GROUP BY author ORDER BY commits DESC"

      # Save and reuse your own query
      lrc query add skipped "SELECT date, subject FROM review_log WHERE action='skipped'"
      lrc query skipped --json

      # Bound the scan on huge repos (Linux kernel = ~1.5M commits)
      lrc query stats --from "2024-01-01" --to "2024-12-31"
      lrc query stats --range main...feature   # just this PR's commits

COMMANDS:
   add      Save a query alias: lrc query add <name> "<sql>"
   list     List saved and built-in query aliases
   view     Print the SQL behind an alias
   delete   Delete a saved alias
   help, h  Shows a list of commands or help for one command

OPTIONS:
   --json         output machine-readable JSON (default: false)
   --from value   only scan commits since this git date (e.g. 2024-01-01, '2 weeks ago') — bounds large repos
   --to value     only scan commits until this git date
   --range value  only scan a ref range, e.g. main...feature (per-PR stats)
   --help, -h     show help

Install and Update

New install:

# Linux/macOS
curl -L https://hexmos.com/ipm-install | bash && ipm i HexmosTech/git-lrc

# Windows
iwr https://hexmos.com/ipm-install-ps | iex; ipm i HexmosTech/git-lrc

Update:

lrc self-update

Changes

  • New command and subcommands under lrc query
  • Introduces ~/.lrc/queries.toml where aliases and SQL queries are stored

Breaking Changes

  • None.

Verification

  • lrc query --help

Known Issues

  • None.