Skip to content

feat(tools): add follow option to git_log to trace history past renames - #2576

Open
starflowerH wants to merge 1 commit into
Nano-Collective:mainfrom
starflowerH:feat/git-log-follow
Open

starflowerH wants to merge 1 commit into
Nano-Collective:mainfrom
starflowerH:feat/git-log-follow

Conversation

@starflowerH

Copy link
Copy Markdown

Description

Adds an optional boolean follow parameter to the git_log tool so file commit history continues past renames (git log --follow -- <file>).

Closes #2575

Summary of Changes

  • source/tools/git/utils.ts: Extended getCommits() options with follow?: boolean and pass --follow before -- when both follow and file are provided.
  • source/tools/git/git-log.tsx:
    • Added follow?: boolean to GitLogInput and gitLogCoreTool.inputSchema.
    • Return a clear error (Error: The "follow" option requires a "file" parameter.) when follow is enabled without a non-empty file.
    • Include follow: true in both the empty-result filter message and GitLogFormatter.
  • source/tools/git/git-log.spec.tsx & source/tools/git/utils.spec.ts: Added unit and integration tests verifying rename history traversal with and without follow, validation error when file is omitted/blank, formatter rendering, empty-result filter reporting, and input schema definition.

Type of Change

  • New feature

Changeset

  • Added a changeset (.changeset/git-log-follow-option.md) describing this change for the changelog

Testing

Automated Tests

  • pnpm run test:ava source/tools/git/git-log.spec.tsx source/tools/git/utils.spec.ts (67 passed)
  • pnpm run test:format (Biome check passed across all 742 files)
  • Tests cover both success and error scenarios

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No breaking changes (follow defaults to false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add a follow option to git_log so file history continues past renames

1 participant