Skip to content

More constness/C23 fixes [0.4.x]#167

Closed
hhoffstaette wants to merge 4 commits intotwaugh:masterfrom
hhoffstaette:constness-0.4.x
Closed

More constness/C23 fixes [0.4.x]#167
hhoffstaette wants to merge 4 commits intotwaugh:masterfrom
hhoffstaette:constness-0.4.x

Conversation

@hhoffstaette
Copy link
Contributor

Description

Followup const/C23 fixes for #159

Type of Change

  • Bug fix (targets 0.4.x)
  • New feature (targets master)
  • Documentation update
  • Other (please describe)

Testing

make check:

============================================================================
Testsuite summary for patchutils 0.4.5
============================================================================
# TOTAL: 199
# PASS:  193
# SKIP:  0
# XFAIL: 6
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

twaugh and others added 4 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 twaugh#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 twaugh#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>
@hhoffstaette
Copy link
Contributor Author

Aaargh..wrong target branch 🙈

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.15%. Comparing base (9f5678c) to head (0cfe623).
⚠️ Report is 98 commits behind head on master.

Files with missing lines Patch % Lines
src/filterdiff.c 85.71% 3 Missing ⚠️
src/util.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #167       +/-   ##
===========================================
- Coverage   83.60%   65.15%   -18.45%     
===========================================
  Files           5        7        +2     
  Lines        4196     6015     +1819     
  Branches     1001     1507      +506     
===========================================
+ Hits         3508     3919      +411     
- Misses        688     2096     +1408     
Flag Coverage Δ
unittests 65.15% <83.33%> (-18.45%) ⬇️

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.

@hhoffstaette hhoffstaette deleted the constness-0.4.x branch February 27, 2026 16:04
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