#1446·tig

wrap-lines does not wrap the commit subject in the diff view

Author: timotheecourCreated Aug 20, 2026Updated Aug 20, 2026

Environment

  • Tig 2.6.1
  • Git 2.55.0
  • Darwin arm64

Reproduction

Use an isolated repository and Tig configuration:

bash
tmp_dir=$(mktemp -d)
git -C "$tmp_dir" init
git -C "$tmp_dir" config user.name Test
git -C "$tmp_dir" config user.email test@example.invalid
printf 'fixture\n' > "$tmp_dir/file.txt"
git -C "$tmp_dir" add file.txt
git -C "$tmp_dir" commit -m 'A deliberately long synthetic commit subject that exceeds a narrow Tig diff pane and should continue on another display line'
printf 'set wrap-lines = yes\n' > "$tmp_dir/tigrc"
TIGRC_USER="$tmp_dir/tigrc" tig -C "$tmp_dir" show

Make the terminal narrow enough that the synthetic subject does not fit.

Expected

With wrap-lines = yes, the full commit subject is shown on continuation display lines, like other long lines in the diff view.

Actual

The first commit-subject line is clipped at the right edge. Other long lines in the same diff view wrap as configured.

No line numbers are enabled.

Source-level observation

In diff_common_read, the first four-space-indented line is identified as the commit title and added directly with add_line_text:

https://github.com/jonas/tig/blob/1b86f070a1f6d4c686a09b997fd4249d52a2a272/src/diff.c#L339-L346

Ordinary lines reach pager_common_read, which honors opt_wrap_lines by calling pager_wrap_line:

https://github.com/jonas/tig/blob/1b86f070a1f6d4c686a09b997fd4249d52a2a272/src/pager.c#L108-L120

It looks as though the commit-title special case bypasses wrapping unintentionally. The title's overflow-highlighting behavior may need to remain unchanged when wrapping is disabled.