Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add get_file_blame tool for retrieving git blame information#1538

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MayorFaj wants to merge2 commits intogithub:main
base:main
Choose a base branch
Loading
fromMayorFaj:feat/git-blame-tool

Conversation

@MayorFaj
Copy link
Contributor

This pull request adds a new tool for retrieving git blame information for files in a GitHub repository, along with comprehensive tests and documentation updates. The main focus is on enabling users to see who last modified each line in a file, with support for specifying branches, tags, or commit SHAs.

New Git Blame Tool Integration

  • Added theget_file_blame tool to the codebase, which uses the GitHub GraphQL API to fetch blame information for a file, including author details, commit SHA, message, and line ranges. The tool supports specifying the repository owner, name, file path, and git reference, defaulting to the repository's default branch if not provided. (pkg/github/repositories.go)
  • Registered the newget_file_blame tool in the default toolset group so it is available for use alongside other repository tools. (pkg/github/tools.go)

Documentation and Tool Snapshots

  • UpdatedREADME.md to document the newget_file_blame tool, including its parameters and usage.
  • Added a tool snapshot definition forget_file_blame for validation and testing purposes. (pkg/github/__toolsnaps__/get_file_blame.snap)
Screenshot 2025-12-04 at 18 09 06Screenshot 2025-12-04 at 18 11 28

Closes:#504

orsonvale reacted with thumbs up emoji
CopilotAI review requested due to automatic review settingsDecember 4, 2025 18:26
@MayorFajMayorFaj requested a review froma team as acode ownerDecember 4, 2025 18:26
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull request overview

This PR adds a newget_file_blame tool that enables users to retrieve git blame information for files in GitHub repositories using the GraphQL API. The implementation includes comprehensive test coverage, proper error handling, and complete documentation updates.

Key Changes

  • AddedGetFileBlame function that queries GitHub's GraphQL API to retrieve blame information showing who last modified each line of a file
  • Integrated the new tool into the default toolset alongside other repository management tools
  • Created comprehensive unit tests covering successful operations, error scenarios, and edge cases like missing default branches

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
pkg/github/repositories.goImplements the GetFileBlame tool with GraphQL queries for default branch resolution and blame data retrieval, including proper type conversions and JSON response formatting
pkg/github/tools.goRegisters GetFileBlame in the DefaultToolsetGroup for availability in the standard tool collection
pkg/github/repositories_test.goAdds comprehensive test coverage including tool schema validation, default branch handling, specific ref queries, and error scenarios
pkg/github/toolsnaps/get_file_blame.snapTool schema snapshot documenting the API surface with ReadOnly annotation
README.mdDocuments the new tool with parameter descriptions and usage information

@MayorFajMayorFaj marked this pull request as draftDecember 4, 2025 18:36
@MayorFajMayorFaj marked this pull request as ready for reviewDecember 4, 2025 19:16
@MayorFaj
Copy link
ContributorAuthor

MayorFaj commentedDec 5, 2025
edited
Loading

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

Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

git blame tool (to get the latest contributors of the class)

1 participant

@MayorFaj

[8]ページ先頭

©2009-2025 Movatter.jp