Bug#839538: diffoscope: json: detect order-only differences
mattia at debian.org
Sun Oct 23 23:25:55 UTC 2016
On Sun, Oct 02, 2016 at 04:55:37PM +0000, Daniel Shahaf wrote:
> 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
While that is right, considering that "falling back to text" is not
really easily done; currently if a comparator fails to find a difference
diffoscope will just resort to diffing the hexdump.
So it needs some work to have this, what about considering this bug only
for the bit proposed by Daniel? (maybe file another bug for the text
fallback in case of formatting difference only?)
> 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?
Of course I'm saying this considering to put the text fallback at a
higher level than hacking it into the json comparator.
GPG Key: 66AE 2B4A FCCF 3F52 DA18 4D18 4B04 3FCD B944 4540 .''`.
more about me: https://mapreri.org : :' :
Launchpad user: https://launchpad.net/~mapreri `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia `-
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 801 bytes
Desc: not available
More information about the Reproducible-builds