mbox series

[v2,0/3] diff: fix --exit-code with external diff

Message ID 6fa51a62-5dc1-4865-9f79-eaf7d65189ab@web.de (mailing list archive)
Headers show
Series diff: fix --exit-code with external diff | expand

Message

René Scharfe June 5, 2024, 8:31 a.m. UTC
Changes since v1:
- old patch 1 was merged
- old patch 2 was merged and reverted
- new patch 1 adds tests that exercises diff --exit-code and --quiet
  together with all methods for specifying external diffs
- new patch 2 adds a struct to store the flag that patch 3 adds
- patch 3 adds configuration options and an environment variable to
  accept diff(1)-style exit codes from external diffs

  t4020: test exit code with external diffs
  userdiff: add and use struct external_diff
  diff: let external diffs report that changes are uninteresting

 Documentation/config/diff.txt   | 14 ++++++++
 Documentation/git.txt           |  7 ++++
 Documentation/gitattributes.txt |  5 +++
 diff.c                          | 62 ++++++++++++++++++++++++---------
 t/t4020-diff-external.sh        | 44 +++++++++++++++++++++++
 userdiff.c                      |  8 +++--
 userdiff.h                      |  7 +++-
 7 files changed, 128 insertions(+), 19 deletions(-)

--
2.45.2

Comments

Junio C Hamano June 5, 2024, 4:47 p.m. UTC | #1
René Scharfe <l.s.r@web.de> writes:

>   t4020: test exit code with external diffs
>   userdiff: add and use struct external_diff
>   diff: let external diffs report that changes are uninteresting

OK, we now need to mark each external diff driver if we want to
honor their exit status, but that awkwardness is to be blamed on the
original design.  Thanks for addressing the misdesign I made years
ago in the mildest way possible not to introduce any unnecessary
regressions.