Skip to content

rebase-branch: mark up range-diffs with ```diff code blocks#157

Open
dscho wants to merge 1 commit intomainfrom
make-range-diffs-in-rebase-shears-colorful
Open

rebase-branch: mark up range-diffs with ```diff code blocks#157
dscho wants to merge 1 commit intomainfrom
make-range-diffs-in-rebase-shears-colorful

Conversation

@dscho
Copy link
Member

@dscho dscho commented Mar 1, 2026

The range-diffs in the shears-builds PRs (e.g. git-for-windows/shears-builds#12) are currently rendered as plain monochrome text. By wrapping each range-diff entry in ```diff fenced code blocks instead, GitHub applies diff-style syntax highlighting, making them noticeably more readable. This is the same markup used in the "Rebase to Git " PRs at git-for-windows/git.

All three user-facing range-diff sites are updated (per-skip, per-resolution, and final summary); the correspondence-map generation and AI agent prompts are untouched.

The range-diffs presented to the user in the conflict report and in the
PR body are currently wrapped in plain triple-backtick code blocks, which
renders them as monochrome text. By using ```diff fenced code blocks
instead (one per range-diff entry), GitHub's Markdown renderer applies
diff-style syntax highlighting, making additions, deletions, and context
lines visually distinct (not full range-diff coloring, but noticeably
more readable than plain text).

The markup logic is the same sed pipeline used in the "Rebase to Git
<version>" PRs at git-for-windows/git, split into two functions:
`range_diff_with_markup` runs `git range-diff` with the given
arguments and pipes through the markup, propagating failure from
range-diff itself; `markup_range_diff` applies just the sed pipeline to
already-produced range-diff text on stdin, which is needed for the final
summary range-diff that gets annotated with upstream OIDs between
generation and rendering.

Only the three user-facing range-diff sites are affected (per-skip,
per-resolution, and final summary). The correspondence-map generation
and AI agent prompts remain untouched.

Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho requested review from mjcheetham and rimrul March 1, 2026 08:52
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.

1 participant