mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 19:13:52 +00:00
feat(editor): add --diff-tree to compare two directories of .w* catalogs
Walks both trees in parallel, classifies each file by its 4-byte
magic, and bucks differences into five categories:
- only-in-A file present in A, missing from B (removed)
- only-in-B file present in B, missing from A (added)
- magic-changed same path but the format swapped
(e.g. somebody renamed a .wsrg to .wmat)
- size-changed same magic, different byte size
(content was edited)
- identical same magic, same size
Exit 1 if any category but identical is non-zero, so it composes
into shell pipelines and CI. JSON sidecar via --json.
Useful for project-version comparison: did anything actually
change between two snapshots? --diff-tree answers in one pass.
Pairs naturally with the existing --diff-headers (which goes
deeper on a single file pair) and the --bulk-* / --audit-tree
family of cross-tree utilities.
Files whose magic isn't recognized by the format table are
silently skipped so unrelated junk in the tree (build artifacts,
temp files) doesn't pollute the diff. Identity check is
magic+size only — true byte-equality would need a hash and the
heuristic is good enough for the typical use case.
This is the 15th cross-format utility:
--list-formats / --info-magic / --summary-dir / --rename-by-magic
--bulk-rename-by-magic / --touch-tree / --tree-summary-md
--catalog-grep / --diff-headers / --audit-tree / --magic-fix
--bulk-validate / --bulk-export-json / --bulk-import-json
--diff-tree
CLI flag count 988 -> 989.
This commit is contained in:
parent
6b2bfb0f5a
commit
a97bc676db
6 changed files with 252 additions and 0 deletions
|
|
@ -98,6 +98,7 @@
|
|||
#include "cli_magic_fix.hpp"
|
||||
#include "cli_bulk_validate.hpp"
|
||||
#include "cli_bulk_json.hpp"
|
||||
#include "cli_diff_tree.hpp"
|
||||
#include "cli_macros_catalog.hpp"
|
||||
#include "cli_char_features_catalog.hpp"
|
||||
#include "cli_pvp_catalog.hpp"
|
||||
|
|
@ -261,6 +262,7 @@ constexpr DispatchFn kDispatchTable[] = {
|
|||
handleMagicFix,
|
||||
handleBulkValidate,
|
||||
handleBulkJson,
|
||||
handleDiffTree,
|
||||
handleMacrosCatalog,
|
||||
handleCharFeaturesCatalog,
|
||||
handlePVPCatalog,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue