Files
jj-vcs-jj/cli/tests/test_interdiff_command.rs
Jakub Stasiak 92b7af489d diff: avoid word inlining without color
Color-words diffs use formatter labels to distinguish removed and
added tokens. When color is disabled, those labels are invisible,
so inline word changes can collapse into unreadable text when
stdout is not a TTY.

Render color-words hunks as separate before and after lines
whenever the formatter cannot emit color. This keeps the default
diff format stable while making piped or redirected output
readable.

Color-words tests that rely on inline display force color output
because inlining is only triggered when color is available, ANSI
sequences are stripped before snapshotting to keep the snapshots
readable.

This does not make redirected diffs into git-format patches.
Users still need --git for patch exchange or tools that require
unified diff input.

Fixes #5894.
Related to #6972.
2026-06-01 06:15:18 +00:00

6.8 KiB