Skip to content

Add --git-extended-diffs option to restore 0.4.3 compatibility#164

Merged
twaugh merged 2 commits into0.4.xfrom
git-extended-diffs-option
Feb 26, 2026
Merged

Add --git-extended-diffs option to restore 0.4.3 compatibility#164
twaugh merged 2 commits into0.4.xfrom
git-extended-diffs-option

Conversation

@twaugh
Copy link
Owner

@twaugh twaugh commented Feb 25, 2026

Fixed: #157

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
@twaugh twaugh force-pushed the git-extended-diffs-option branch from 8d7c479 to 5ac07e2 Compare February 25, 2026 21:05
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.60%. Comparing base (9f5678c) to head (3bf4b5b).
⚠️ Report is 3 commits behind head on 0.4.x.

Files with missing lines Patch % Lines
src/filterdiff.c 85.71% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            0.4.x     #164   +/-   ##
=======================================
  Coverage   83.60%   83.60%           
=======================================
  Files           5        5           
  Lines        4196     4215   +19     
  Branches     1001     1006    +5     
=======================================
+ Hits         3508     3524   +16     
- Misses        688      691    +3     
Flag Coverage Δ
unittests 83.60% <85.71%> (+<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.

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
@sergiomb2
Copy link
Contributor

I don’t see any issue, but I won’t have time to analyze it further over the next few days.

@twaugh twaugh merged commit 2e12f65 into 0.4.x Feb 26, 2026
7 checks passed
@twaugh twaugh deleted the git-extended-diffs-option branch February 26, 2026 12: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