
Diffing YAML Files Without Whitespace Noise or Reordering
diff -w hides YAML indentation changes that alter meaning. Normalize both files with yq sort_keys and compare as data to ignore layout and order only.
Tag
12 posts

diff -w hides YAML indentation changes that alter meaning. Normalize both files with yq sort_keys and compare as data to ignore layout and order only.

Sort XML records by a key with XSLT or lxml so two exports of the same data produce the same file, including numeric keys and nested children.

Two branches each add a dependency to the same pom.xml and Git reports a conflict. See why, then use the union merge driver and a manual rule that works.

A feed renamed price to cost and the loader kept running with empty columns. A short script compares element path snapshots and reports the change.

A one-line XML file turns every change into one giant diff. Two ways to fix it, a textconv diff driver and a formatted file in the repo, with real output.

Make a line diff of two XML files show real changes only, by canonicalizing both sides, then use xmldiff when you need structural edit actions.

Three XML files with the same meaning gave three different checksums. Canonical XML (C14N) fixes attribute order and quoting, but not whitespace.

A tested guide to diffing, patching and merging JSON: normalizing, array identity, JSON Patch, Merge Patch, atomic apply, deep merge, history and tests.

Merge two people's edits of a CSV against a common base: git merge-file conflicts when both touch a row, merging by key and cell resolves different cells.

Keep a CSV sorted by its key so a one-row change is a one-line diff: sort the body not the header, use byte order and numeric keys, and sort in the writer.

Make git diff readable for a CSV: word diff on commas, a textconv that aligns columns, a sorted file with one record per line and a trailing newline.

A tested guide to comparing XML, from canonical form and keyed record diffs to Git diffs, merges, feed shape checks and schema compatibility.