Repository navigation
feat(tools): add follow option to git_log to trace history past renames - #2576
Open
starflowerH wants to merge 1 commit into
Open
starflowerH wants to merge 1 commit into
starflowerH wants to merge 1 commit into
Conversation
starflowerH
requested review from
addyCooks,
akramcodez and
will-lamerton
as code owners
December 4, 2026 09:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an optional boolean
followparameter to thegit_logtool so file commit history continues past renames (git log --follow -- <file>).Closes #2575
Summary of Changes
source/tools/git/utils.ts: ExtendedgetCommits()options withfollow?: booleanand pass--followbefore--when bothfollowandfileare provided.source/tools/git/git-log.tsx:follow?: booleantoGitLogInputandgitLogCoreTool.inputSchema.Error: The "follow" option requires a "file" parameter.) whenfollowis enabled without a non-emptyfile.follow: truein both the empty-result filter message andGitLogFormatter.source/tools/git/git-log.spec.tsx&source/tools/git/utils.spec.ts: Added unit and integration tests verifying rename history traversal with and withoutfollow, validation error whenfileis omitted/blank, formatter rendering, empty-result filter reporting, and input schema definition.Type of Change
Changeset
.changeset/git-log-follow-option.md) describing this change for the changelogTesting
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)Checklist
followdefaults tofalse)