Feature Request: Compare Subdirectories, ignore directory name difference
miketheman opened this issue Β· comments
Hello! Thanks for making this tool - it's quite cool and fast.
I've been using difft as well as diffoscope and was curious if you had a solution to a problem diffoscope solves, that I don't think difft handles today.
Here's my current use case, let me know if it doesn't make sense:
I often expand multiple zip files containing a variety of files, and want to establish a few things:
a. How "same" are these zip file contents?
b. What are the distinct differences?
For a, I'd love a way to emit only a percentage as output, somewhat similar to --check-only
- that way I could run a lot of diffs and only stop when something is either too similar or too divergent.
I think difft
solves most of b, but doesn't handle path name differences yet, unless I don't have the right flags.
Here's an example expanded layout of two almost-identical zip files:
analyticsclient-6502
βββ LICENSE.txt
βββ MANIFEST.in
βββ PKG-INFO
βββ README.md
βββ analyticsclient.egg-info
β βββ PKG-INFO
β βββ SOURCES.txt
β βββ dependency_links.txt
β βββ requires.txt
β βββ top_level.txt
βββ data
β βββ data_file
βββ pyproject.toml
βββ setup.cfg
βββ setup.py
βββ tests
βββ __init__.py
βββ test_simple.py
4 directories, 15 files
brotli-bin-0.0.1
βββ LICENSE.txt
βββ MANIFEST.in
βββ PKG-INFO
βββ README.md
βββ brotli_bin.egg-info
β βββ PKG-INFO
β βββ SOURCES.txt
β βββ dependency_links.txt
β βββ requires.txt
β βββ top_level.txt
βββ data
β βββ data_file
βββ pyproject.toml
βββ setup.cfg
βββ setup.py
βββ tests
βββ __init__.py
βββ test_simple.py
4 directories, 15 files
Both contain same files, but have slightly differing different paths.
Using diffoscope I execute: diffoscope --exclude-directory-metadata=yes analyticsclient-6502 brotli-bin-0.0.1
and get an output of the differences for the PKG_INFO
files in the *-info
sudirectories side by side - but difft can't compare those yet.
(--exclude-directory-metadata=yes
is to remove comparing the times and dates on the files, but I think that's diffoscope-specific and difft doesn't care about that yet.)