Skip to content

Better handling of git diff format in filterdiff/lsdiff/grepdiff - #103

Merged
twaugh merged 17 commits into
masterfrom
filterdiff-gitdiff
Sep 3, 2025
Merged

Better handling of git diff format in filterdiff/lsdiff/grepdiff#103
twaugh merged 17 commits into
masterfrom
filterdiff-gitdiff

Conversation

@twaugh

@twaughtwaugh commented Aug 27, 2025

Copy link
Copy Markdown
Owner

Fixed: #22
Fixed: #27
Fixed: #59
Fixed: #68

@wetneb

Copy link
Copy Markdown

Thanks for working on this! I haven't been able to make it work, though.
I have run (while on your filterdiff-gitdiff branch)

$ git diff 004c178d031ad4e1f38fbf6acffcd19a648e6bab^! > diff
$ ./src/filterdiff -x NEWS diff > filtered
$ vimdiff diff filtered

But filtered still contains changes for the NEWS file (diff and filtered are identical).

@twaugh

Copy link
Copy Markdown
OwnerAuthor

But filtered still contains changes for the NEWS file (diff and filtered are identical).

That's right -- it's backwards compatible right now, in that the default for --git-prefixes is keep. But look:

$ # -p1 has always been needed for git diff format input when matching/including:
$ git diff 8bf0b900ab4b89124972a38ad9a4b03be2af8269^! | src/filterdiff -p1 -x NEWS
$ # new --git-prefixes option will change default to 'strip' in 0.5.0:
$ git diff 8bf0b900ab4b89124972a38ad9a4b03be2af8269^! | src/filterdiff --git-prefixes=strip -x NEWS
$

@codecov-commenter

codecov-commenter commented Aug 30, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.62500% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.38%. Comparing base (b073854) to head (b7ef931).
⚠️ Report is 17 commits behind head on master.

Files with missing linesPatch %Lines
src/filterdiff.c96.05%9 Missing ⚠️
src/diff.c94.56%5 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## master #103 +/- ##
==========================================
+ Coverage 81.02% 82.38% +1.36% 
==========================================
Files 5 5 Lines 3890 4128 +238 Branches 925 982 +57 ==========================================
+ Hits 3152 3401 +249 + Misses 738 727 -11 
FlagCoverage Δ
unittests82.38% <95.62%> (+1.36%)⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@twaugh
twaughforce-pushed the filterdiff-gitdiff branch from a4cc68a to b18003fCompareAugust 30, 2025 09:20
@twaugh
twaugh merged commit 6ea4a1d into masterSep 3, 2025
7 checks passed
@twaugh
twaugh deleted the filterdiff-gitdiff branch September 3, 2025 10:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants

@twaugh@wetneb@codecov-commenter