Skip to content

Skip rewriting unchanged files with --replace#46

Open
katexochen wants to merge 1 commit into
google:masterfrom
katexochen:only-write-on-change
Open

Skip rewriting unchanged files with --replace#46
katexochen wants to merge 1 commit into
google:masterfrom
katexochen:only-write-on-change

Conversation

@katexochen

Copy link
Copy Markdown

--replace overwrote each input file unconditionally, bumping its mtime even when the formatted output was byte-identical. Compare against the file's current contents first and only write on a real difference, so already-formatted files keep their mtime. This makes the tool idempotent for change-detecting callers

--replace overwrote each input file unconditionally, bumping its mtime
even when the formatted output was byte-identical. Compare against the
file's current contents first and only write on a real difference, so
already-formatted files keep their mtime. This makes the tool idempotent
for change-detecting callers

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
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