rebase-branch: mark up range-diffs with ```diff code blocks#157
Merged
Conversation
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 <[email protected]>
The shears branches use merging rebases, so the interesting changes often happen inside merge commits (conflict resolutions). Without --remerge-diff, range-diff shows these as empty, hiding exactly the information that is most useful for reviewing the rebase result. By passing --remerge-diff, the merge conflict resolutions are included in the range-diff output, making problems visible at a glance. Only the three user-facing range-diff call 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 <[email protected]>
When all patches rebase cleanly, the resulting PR is not very interesting: everything went as expected. But when conflicts had to be resolved (whether by skipping upstreamed patches or by surgical AI resolution), the PR deserves closer attention, and that should be obvious from the title without having to open it. The rebase script now writes a small conflict-stats.txt file alongside the conflict report. The workflow reads it and, when the total is non-zero, rewrites the PR title to include the breakdown, e.g. "Rebase shears/next: 3 conflict(s) (1 skipped, 2 resolved) (#12345)". Trivial rebases with zero conflicts keep the plain title. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.