Skip to content

Compare tree hashes instead of using git diff#154

Merged
IanButterworth merged 9 commits intomainfrom
ib/compare_sha
Nov 23, 2025
Merged

Compare tree hashes instead of using git diff#154
IanButterworth merged 9 commits intomainfrom
ib/compare_sha

Conversation

@IanButterworth
Copy link
Member

Comparing tree hashes is more accurate for detecting content differences between the merge commit and PR head, avoiding false positives when the content is identical but commit SHAs differ.

Fixes #153

Comparing tree hashes is more accurate for detecting content differences
between the merge commit and PR head, avoiding false positives when
the content is identical but commit SHAs differ.
@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (013f11f) to head (2e2177d).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #154   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            2         2           
=========================================
  Hits             2         2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI 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 improves the detection of content differences between the merge commit and PR head in GitHub Actions by comparing tree hashes instead of using git diff. This approach is more accurate as it avoids false positives when content is identical but commit SHAs differ.

Key changes:

  • Added a check to verify HEAD^2 exists before attempting to compare commits
  • Replaced git diff --quiet with tree hash comparison using git rev-parse
  • Added explicit handling for non-merge commits

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@IanButterworth IanButterworth merged commit d60b785 into main Nov 23, 2025
50 checks passed
@IanButterworth IanButterworth deleted the ib/compare_sha branch November 23, 2025 15:24
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.

Merge commit warning falsely triggered

1 participant