Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 29, 2025

The sarif blame command now includes the commit hash/SHA in the blame information output. Previously, while the blame functionality extracted commit hashes from git blame --porcelain, it only exposed author information, timestamps, and commit messages without the actual commit identifier.

The commit hash is now available as a commit field in the blame properties:

{
  "properties": {
    "blame": {
      "commit": "915da616c17784840dd6b63e58aea0503e451264",
      "author": "Test User",
      "author-mail": "<test@example.com>",
      "author-time": "1756489481",
      "author-tz": "+0000",
      "committer": "Test User", 
      "committer-mail": "<test@example.com>",
      "committer-time": "1756489481",
      "committer-tz": "+0000",
      "summary": "Fix file format",
      "filename": "test.py"
    }
  }
}

This change also adds a commit filtering shortcut that maps to properties.blame.commit for easier filtering by commit hash.

The implementation is minimal and preserves all existing functionality while adding the requested commit hash information that was already being extracted internally.

Fixes #99.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Contributor Author

Copilot AI commented Aug 29, 2025

@gramster 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

- Add commit hash as "commit" field in blame properties
- Update tests to expect commit hash in output
- Update README documentation with new commit field
- Add commit shortcut to filtering table
- Verify functionality with manual testing

Co-authored-by: gramster <2762632+gramster@users.noreply.github.com>
Copilot AI changed the title [WIP] Feature request: expose commit hash from sarif blame Expose commit hash in sarif blame output Aug 29, 2025
Copilot AI requested a review from gramster August 29, 2025 17:47
@gramster gramster marked this pull request as ready for review August 29, 2025 22:00
@gramster gramster requested a review from rchiodo August 29, 2025 22:02
@gramster gramster merged commit 5b8d9e6 into main Aug 29, 2025
4 checks passed
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 request: expose commit hash from sarif blame

3 participants