Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yamadashy opened this issue May 10, 2025 · 0 comments
Open

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

yamadashy opened this issue May 10, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@yamadashy
Copy link
Owner

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.

@yamadashy yamadashy self-assigned this May 10, 2025
@yamadashy yamadashy added the enhancement New feature or request label May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant