Bug#888402: diffoscope: report differences in file metadata when comparing files

Paul Wise pabs at debian.org
Thu Jan 25 04:05:57 UTC 2018


Package: diffoscope
Version: 90
Severity: wishlist

Currently, when comparing individual files, diffoscope does not
report any of the metadata that it reports when comparing files in
directories. It would be useful in some situations to have that.

$ echo foo > foo ; date
Thu 25 Jan 11:50:42 AWST 2018
$ echo foo > bar ; date
Thu 25 Jan 11:50:46 AWST 2018
$ chmod 777 bar
$ setfacl -m u:nobody:r bar
$ setfattr -n user.xdg.origin.url -v bar bar
$ sudo chattr +i bar
$ diffoscope --no-progress foo bar
$ stat foo bar ; getfacl foo bar ; getfattr -dR foo bar ; lsattr foo bar
  File: foo
  Size: 4         	Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 6038024     Links: 1
Access: (0640/-rw-r-----)  Uid: ( 1000/    pabs)   Gid: ( 1000/    pabs)
Access: 2018-01-25 11:54:04.847312293 +0800
Modify: 2018-01-25 11:50:42.973529209 +0800
Change: 2018-01-25 11:50:42.973529209 +0800
 Birth: -
  File: bar
  Size: 4         	Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 6038025     Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/    pabs)   Gid: ( 1000/    pabs)
Access: 2018-01-25 11:54:20.063144546 +0800
Modify: 2018-01-25 11:50:46.649489005 +0800
Change: 2018-01-25 11:54:17.303174979 +0800
 Birth: -
# file: foo
# owner: pabs
# group: pabs
user::rw-
group::r--
other::---

# file: bar
# owner: pabs
# group: pabs
user::rwx
user:nobody:r--
group::rwx
mask::rwx
other::rwx

# file: bar
user.xdg.origin.url="bar"

--------------e---- foo
----i---------e---- bar


$ mkdir 1 2
$ echo foo > 1/foo ; date
Thu 25 Jan 12:02:34 AWST 2018
$ echo foo > 2/foo ; date
Thu 25 Jan 12:02:38 AWST 2018
$ chmod 777 2/foo
$ setfacl -m u:nobody:r 2/foo
$ setfattr -n user.xdg.origin.url -v bar 2/foo
$ sudo chattr +i 2/foo
$ diffoscope --no-progress 1 2
--- 1
+++ 2
+-- stat {}
| @@ -1,8 +1,8 @@
|  
|    Size: 4096      	Blocks: 8          IO Block: 4096   directory
|  Links: 2
|  Access: (0750/drwxr-x---)  Uid: ( 1000/    pabs)   Gid: ( 1000/    pabs)
|  
| -Modify: 2018-01-25 04:02:34.825610344 +0000
| +Modify: 2018-01-25 04:02:38.793559855 +0000
|  
|   Birth: -
|   --- 1/foo
+-- +++ 2/foo
| +-- stat {}
| | @@ -1,8 +1,8 @@
| |  
| |    Size: 4         	Blocks: 8          IO Block: 4096   regular file
| |  Links: 1
| | -Access: (0640/-rw-r-----)  Uid: ( 1000/    pabs)   Gid: ( 1000/    pabs)
| | +Access: (0777/-rwxrwxrwx)  Uid: ( 1000/    pabs)   Gid: ( 1000/    pabs)
| |  
| | -Modify: 2018-01-25 04:02:34.825610344 +0000
| | +Modify: 2018-01-25 04:02:38.793559855 +0000
| |  
| |   Birth: -
| +-- getfacl -p -c {}
| | @@ -1,4 +1,6 @@
| | -user::rw-
| | -group::r--
| | -other::---
| | +user::rwx
| | +user:nobody:r--
| | +group::rwx
| | +mask::rwx
| | +other::rwx
| +-- lsattr
| | @@ -1 +1 @@
| | ---------------e----
| | +----i---------e----
$ stat 1/foo 2/foo ; getfacl 1/foo 2/foo ; getfattr -dR 1/foo 2/foo ; lsattr 1/foo 2/foo
  File: 1/foo
  Size: 4         	Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 6038026     Links: 1
Access: (0640/-rw-r-----)  Uid: ( 1000/    pabs)   Gid: ( 1000/    pabs)
Access: 2018-01-25 12:03:30.860897857 +0800
Modify: 2018-01-25 12:02:34.825610344 +0800
Change: 2018-01-25 12:02:34.825610344 +0800
 Birth: -
  File: 2/foo
  Size: 4         	Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 6038027     Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/    pabs)   Gid: ( 1000/    pabs)
Access: 2018-01-25 12:03:30.860897857 +0800
Modify: 2018-01-25 12:02:38.793559855 +0800
Change: 2018-01-25 12:03:19.089047443 +0800
 Birth: -
# file: 1/foo
# owner: pabs
# group: pabs
user::rw-
group::r--
other::---

# file: 2/foo
# owner: pabs
# group: pabs
user::rwx
user:nobody:r--
group::rwx
mask::rwx
other::rwx

# file: 2/foo
user.xdg.origin.url="bar"

--------------e---- 1/foo
----i---------e---- 2/foo

-- 
bye,
pabs

https://wiki.debian.org/PaulWise
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20180125/79c896cf/attachment.sig>


More information about the Reproducible-builds mailing list