Skip to content

Show hunk start line in diff header - #106

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-diff-line-numbers
Sep 30, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-diff-line-numbers

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Port of rectorphp/rector-src#7875 to both ECS engines.

Changes the diff hunk header from an empty/full range marker to @@ Line N @@, where N is the start line of the change in the original file. Makes it easy to locate changes when a file has multiple hunks.

  • PHP engine (ColorConsoleDiffFormatter): normalizes @@ -67,6 +67,8 @@ to @@ Line 67 @@.
  • Go engine (blink internal/diff): emits @@ Line N @@ instead of @@ @@, computing N from the original-file line count so both engines stay 1:1.

Verified the two engines print identical line numbers on multi-hunk input.

@TomasVotruba
TomasVotruba merged commit 59c25ba into main Sep 30, 2026
18 checks passed
@TomasVotruba
TomasVotruba deleted the tv-diff-line-numbers branch September 30, 2026 12:03
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