mirror of
https://github.com/jj-vcs/jj.git
synced 2026-07-03 14:02:54 +08:00
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.
6.8 KiB
6.8 KiB