Skip to content

regression when metadata differ when comparing byte-by-byte identical files

When writing autopkgtests for rsync, I've discovered that diffoscope 240 from Debian stable behaves differently from the version in Debian unstable (297).

When comparing byte-by-byte identical files with different metadata with the following executable shell script:

#!/bin/sh

DIFF_CMD="~/programming/debian/diffoscope/bin/diffoscope --no-progress"  # adapt to your local diffoscope binary
RSYNC_BIN="/usr/bin/rsync"

echo foo > src
cp src target
touch -d "next minute" target

$RSYNC_BIN -tu src target

stat src
stat target
$DIFF_CMD --exclude-directory-metadata=no src target 2>&1
status=$?
echo $status

diffoscope 240 exits with 1 (as expected since the mtimes are clearly different) whereas diffoscope 297 surprisingly exits with 0.

Running git bisect shows that this commit introduces the regression.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information