Skip to content

History backfill command #16

@LeeSinLiang

Description

@LeeSinLiang

History backfill command

Summary
Add commitlm backfill to generate documentation for existing commits (e.g., to seed a new project knowledge base).

Motivation
Creates historical docs for onboarding and auditing.

CLI proposal

commitlm backfill [--since <rev> | --last N] [--until <rev>] [--reverse] [--dry-run] [--provider ... --model ...]

Scope

  • Writes to docs/history/<short-hash>_<slug>.md (same content structure as post-commit docs).
  • Rate-limit aware (configurable delay).
  • Respects Include/Exclude patterns (see related issue).

Tasks

  • Implement using Git plumbing (git rev-list) or GitPython.
  • Respect include/exclude patterns.
  • Add --dry-run to print planned work only.
  • Docs + examples.

Acceptance criteria

  • Backfills N commits deterministically with or without --reverse.
  • Idempotent: re-running doesn’t duplicate.
  • Works with local and cloud providers.

Test plan
Create a repo with 5 commits; run commitlm backfill --last 3; verify 3 files created; re-run is a no-op.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions