Skip to content

loopvec: label -d diffs with the file's path - #10

Open
thesyncim wants to merge 1 commit into
mauri870:masterfrom
thesyncim:diff-labels
Open

thesyncim wants to merge 1 commit into
mauri870:masterfrom
thesyncim:diff-labels

Conversation

@thesyncim

@thesyncim thesyncim commented Nov 1, 2026 •

Copy link
Copy Markdown

flag_diff.txt fails on macOS. The -d headers carry diff's timestamp, and BSD diff prints it differently from GNU diff (no fractional seconds, no zone). It's the timestamp of a temp file anyway, so it doesn't tell the reader anything.

This passes -L path for both sides (GNU, BSD and busybox diff all have it), so the headers are just --- path / +++ path like gofmt -d, and the filename replacement goes away. The four diff scripts now expect the path alone.

It's one of three small fixes to get the suite passing on macOS, along with #8 and #9, which I needed while trying loopvec on goav1.

-d ran diff -u on two temporary files and replaced their names with the
file's path, so each header still carried diff's timestamp. GNU diff
prints it as "2026-10-31 18:49:17.123456789 +0000" and BSD diff, the one
macOS ships, as "2026-10-31 18:49:17", which made flag_diff.txt fail on
macOS, and the timestamp of a temporary file says nothing about the
source.

diff now labels both sides with the path (-L, which GNU and BSD diff both
support), as gofmt -d does, so the headers are the same everywhere.
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