Bug#839538: diffoscope: json: detect order-only differences

Daniel Shahaf danielsh at apache.org
Sun Oct 2 16:55:37 UTC 2016


HW42 wrote on Sat, Oct 01, 2016 at 17:39:00 +0000:
> Daniel Shahaf:
> > It would be better to report "json files are equal up to order of
> > elements in an object (= hash, dictionary, associative array)", and to
> > print the difference in a more readable way than a hex dump.  (For
> > example, a linewise diff of pretty-printed json.)
> 
> While at it, it should also be considered that the formating can be
> different without changing the order.

So the fallback order should be:

1. Compare as json, disregarding order
2. Compare as json, regarding order (added by the patch)
3. Compare as text

But (3) could apply to *any* text file, not just json, so perhaps it
should be done at a level higher than the json comparator?

Cheers,

Daniel



More information about the Reproducible-builds mailing list