Conversation
Implements a `git_blame` tool backed by `git blame --porcelain`, exposing per-line authorship over a bounded line range to the assistant during pair-programming sessions. Output is grouped by commit: consecutive lines that share the same blamed commit are collapsed into a single hunk, so token cost scales with the number of distinct commits rather than the number of lines. Each hunk carries `hash`, `short_hash`, `author`, `date`, `summary`, and — when present — a `previous` field containing the commit that owned those lines before the current change. That lets the assistant drill back through line history with a follow-up `git_show` or `git_diff_commit` call without an extra blame invocation. The range is capped at 200 lines per call. Validation rejects zero-based start lines, inverted ranges, and oversized windows with a clear error message before any subprocess is spawned. An optional `revision` parameter allows blaming at any commit, tag, or branch; `ignore_whitespace` passes `-w` through to git. The tool is wired into the MCP tool registry and added to the git-reading skill so it is available whenever that skill is active. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
Implements a
git_blametool backed bygit blame --porcelain,exposing per-line authorship over a bounded line range to the assistant
during pair-programming sessions.
Output is grouped by commit: consecutive lines that share the same
blamed commit are collapsed into a single hunk, so token cost scales
with the number of distinct commits rather than the number of lines.
Each hunk carries
hash,short_hash,author,date,summary, and— when present — a
previousfield containing the commit that ownedthose lines before the current change. That lets the assistant drill
back through line history with a follow-up
git_showorgit_diff_commitcall without an extra blame invocation.The range is capped at 200 lines per call. Validation rejects zero-based
start lines, inverted ranges, and oversized windows with a clear error
message before any subprocess is spawned. An optional
revisionparameter allows blaming at any commit, tag, or branch;
ignore_whitespacepasses-wthrough to git.The tool is wired into the MCP tool registry and added to the
git-reading skill so it is available whenever that skill is active.