Skip to content

Add --include-logs option to include git log --name-status output #540

@yamadashy

Description

@yamadashy

Repomix already supports pulling in diffs via --include-diffs (see PR #533). This enhancement will let users bundle recent commit history—specifically the output of git log --name-status—into their archive with a simple flag.


Motivation:

  • Change Visibility: Shows which files changed in each commit, helping reviewers and LLMs trace code evolution.
  • Context: Complements low-level diffs with a concise, high-level history.
  • Configurability: Users can limit how many commits to include.

Proposed Changes:

  1. CLI Definition

    // in src/cli/cliRun.ts (and types.ts)
    .option('--include-logs', 'include git log --name-status output in the archive')
    .option(
      '--include-logs-max-commits <number>',
      'maximum number of commits to include in git log (default: 100)',
      { default: 100 }
    )
  2. Config Schema

    interface RepomixConfigCli {
      // ...existing fields
      output?: {
        git?: {
          includeLogs?: boolean;
          includeLogsMaxCommits?: number;
        }
      }
    }
  3. Git Collection Logic

    • In your git collector (e.g. src/core/git/gitCollector.ts), when config.output.git.includeLogs is true, run:

      git log --name-status -n ${config.output.git.includeLogsMaxCommits}
    • Emit the result as a file (e.g. repomix-git-log.txt) inside the output bundle.

  4. Documentation & Tests

    • Update command-line-options.md and README.md to document --include-logs and --include-logs-max-commits.

    • Add tests under tests/ to verify:

      • repomix --include-logs produces repomix-git-log.txt.
      • The --include-logs-max-commits override is respected.
      • Default behavior uses 100 commits.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions