Skip to content

Keep changes of all diffs for the same file in a patch - #991

Merged
Pomidorry merged 1 commit into
Samsung:mainfrom
sebxt:fix/patch-series-same-file-dropped
Oct 20, 2026
Merged

Pomidorry merged 1 commit into
Samsung:mainfrom
sebxt:fix/patch-series-same-file-dropped

Conversation

@sebxt

@sebxt sebxt commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Description

DiffContentProvider.patch2files_diff assigned the changes of each diff to its path, so when a patch contains several diffs of the same file (git format-patch --stdout, git log -p), only the last one was kept and the earlier added or deleted lines were never scanned.

  • Fix: append changes to the list of the path instead of overwriting it, for both added and deleted sides
  • Add a unit test with two diffs of the same file in one patch
  • Update the banner crc32 in check.yml (updated by test_banner_p)

How has this been tested?

  • UnitTest
  • Benchmark

pytest tests --ignore=tests/test_app.py: 1198 passed, 1 skipped. pytest tests/test_app.py: 54 passed. The new test fails on main and passes with the fix. The benchmark scans files with --path, so its scores are not affected.

Fixes #990

@sebxt
sebxt requested a review from a team as a code owner October 20, 2026 08:19
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.58%. Comparing base (18fd2c3) to head (972f166).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #991      +/-   ##
==========================================
- Coverage   90.61%   90.58%   -0.03%     
==========================================
  Files         169      169              
  Lines        7306     7306              
  Branches     1224     1224              
==========================================
- Hits         6620     6618       -2     
  Misses        464      464              
- Partials      222      224       +2     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@babenek babenek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.
Thanks @auraseb for the contribution!

@Pomidorry Pomidorry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Pomidorry
Pomidorry merged commit bb0822d into Samsung:main Oct 20, 2026
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.

--diff_path drops earlier changes when a patch touches the same file more than once

4 participants