Conversation
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>
More constness/C23 fixes [0.4.x]
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 Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge in 0.4.x changes.
Update
--git-extended-diffsoption to default toinclude.