Skip to content

Merge 0.4.x changes#170

Merged
twaugh merged 8 commits intomasterfrom
git-extended-diffs-default-include
Feb 27, 2026
Merged

Merge 0.4.x changes#170
twaugh merged 8 commits intomasterfrom
git-extended-diffs-default-include

Conversation

@twaugh
Copy link
Owner

@twaugh twaugh commented Feb 27, 2026

Merge in 0.4.x changes.

Update --git-extended-diffs option to default to include.

twaugh and others added 7 commits February 25, 2026 21:05
Version 0.4.4 introduced support for Git diffs without content hunks
(renames, copies, mode-only changes, binary files), which changed
file numbering behavior and broke compatibility with 0.4.3. This
caused scripts using -N/-F options to fail.

Add --git-extended-diffs=exclude|include option to control this
behavior. In 0.4.x, the default is 'exclude' to restore 0.4.3
compatibility. Users wanting the 0.4.4 behavior can use 'include'.

Implementation:
- Add git_extended_diffs_mode enum with EXCLUDE/INCLUDE values
- Skip extended diffs when in exclude mode to restore 0.4.3 behavior
- Add comprehensive test coverage in git-extended-diffs-exclude/
- Update all existing git-* tests to use --git-extended-diffs=include
- Update documentation for filterdiff, lsdiff, grepdiff, patchview
- Update NEWS to explain the reversion and new option

The default will change to 'include' in version 0.5.0 for modern
Git workflow support.

Addresses GitHub issue #157.

Assisted-by: Claude Code
Extends git-extended-diffs-exclude test to cover three previously
uncovered code paths: GIT_DIFF_NORMAL handling in exclude mode,
goto eof path for extended diffs at end of file, and invalid
argument error handling.

Assisted-by: Claude Code
Add --git-extended-diffs option to restore 0.4.3 compatibility
This is a followup to #159 and fixes more glibc-2.43/C23 related const
warnings. Where we can, we make things more const; where necessary we
explicitly treat mutable things as mutable instead of pretending that
they are not.

Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
The --git-extended-diffs option now defaults to 'include' instead of
'exclude'. This means Git diffs without traditional content hunks
(renames, copies, mode-only changes, and binary files) are now
processed by default, providing better Git workflow integration.

Users who prefer the old behaviour can explicitly specify
--git-extended-diffs=exclude.

Changes:
- src/filterdiff.c: Changed default from GIT_EXTENDED_DIFFS_EXCLUDE to
  GIT_EXTENDED_DIFFS_INCLUDE and updated help text
- doc/patchutils.xml: Updated documentation for all tools (filterdiff,
  lsdiff, grepdiff, patchview) to reflect the new default
- tests/git-extended-diffs-exclude: Renamed to tests/git-extended-diffs
  and updated to test both the new default (include) and explicit
  exclude mode

Assisted-by: Claude Code
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.34%. Comparing base (bb61dfb) to head (231979a).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
src/filterdiff.c 85.71% 3 Missing ⚠️
src/patch_common.c 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #170      +/-   ##
==========================================
+ Coverage   86.32%   86.34%   +0.01%     
==========================================
  Files          15       15              
  Lines        8118     8156      +38     
  Branches     1649     1658       +9     
==========================================
+ Hits         7008     7042      +34     
- Misses       1110     1114       +4     
Flag Coverage Δ
unittests 86.34% <90.00%> (+0.01%) ⬆️

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.

The scanner-based tools (lsdiff and grepdiff when built with
--enable-scanner-patchfilter) now support the --git-extended-diffs
option for compatibility with the legacy tools. The default is
'include', matching the new default.

When --git-extended-diffs=exclude is specified, the scanner tools
skip all extended diff types (renames, copies, mode-only changes,
binaries), only processing GIT_DIFF_NORMAL diffs with content hunks.

Changes:
- src/patch_common.h: Added git_extended_diffs_mode enum and extern,
  increased MAX_COMMON_OPTIONS to 20
- src/patch_common.c: Added git_extended_diffs_mode variable,
  initialization, and option parsing
- src/ls.c: Added --git-extended-diffs to help text and implemented
  exclude logic to skip non-normal git diffs before counting files
- src/grep.c: Added --git-extended-diffs to help text

Assisted-by: Claude Code
@twaugh twaugh merged commit 5885902 into master Feb 27, 2026
8 checks passed
@twaugh twaugh deleted the git-extended-diffs-default-include branch February 27, 2026 16:53
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.

2 participants