Add forge9 diff command #5

Closed
opened 2026-11-26 20:55:39 +00:00 by github-bot · 1 comment
Owner

@⁠nineforge0 on GitHub · 2026-11-24 07:34 UTC · original

Compare two archives entry by entry, e.g. a game update vs the previous version, or a modded archive vs the original.

Scope

  • forge9 diff a.rpf b.rpf reports entries that were added, removed or changed (size or content). Compare inflated content (Archive::read_entry), not raw bytes, so recompression alone doesn't count as a change.
  • Summary line at the end: N same, N changed, N added, N removed.
  • Optional --json.

Notes

  • Entries are matched by index for now; name-based matching can come later.
  • Hashing content (e.g. comparing lengths first, then bytes) keeps it fast on large archives.

Done when

  • Diffing an archive against a forge9 mod apply output shows exactly the replaced entries as changed.

See CONTRIBUTING.md for build, test and style notes. Please don't attach game files to the PR; build test data in memory.

**@⁠nineforge0** on GitHub · 2026-11-24 07:34 UTC · [original](https://github.com/nineforge0/forge9/issues/5) Compare two archives entry by entry, e.g. a game update vs the previous version, or a modded archive vs the original. **Scope** - `forge9 diff a.rpf b.rpf` reports entries that were added, removed or changed (size or content). Compare inflated content (`Archive::read_entry`), not raw bytes, so recompression alone doesn't count as a change. - Summary line at the end: `N same, N changed, N added, N removed`. - Optional `--json`. **Notes** - Entries are matched by index for now; name-based matching can come later. - Hashing content (e.g. comparing lengths first, then bytes) keeps it fast on large archives. **Done when** - Diffing an archive against a `forge9 mod apply` output shows exactly the replaced entries as changed. See [CONTRIBUTING.md](https://github.com/nineforge0/forge9/blob/main/CONTRIBUTING.md) for build, test and style notes. Please don't attach game files to the PR; build test data in memory.
github-bot 2026-11-26 20:55:39 +00:00
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:55:39 +00:00
Author
Owner

@⁠nineforge0 on GitHub · 2026-11-24 21:55 UTC · original · edited 2026-11-24 23:07 UTC

Added forge9 diff (text and --json): matches entries by inflated payload digest, then path; reports added, removed, changed (with size delta) and moved entries. Exit 0 when identical, 1 when they differ, 2 on error.

Landed in 8defb65.

**@⁠nineforge0** on GitHub · 2026-11-24 21:55 UTC · [original](https://github.com/nineforge0/forge9/issues/5#issuecomment-7145558868) · edited 2026-11-24 23:07 UTC Added `forge9 diff` (text and `--json`): matches entries by inflated payload digest, then path; reports added, removed, changed (with size delta) and moved entries. Exit 0 when identical, 1 when they differ, 2 on error. Landed in 8defb65.
This discussion has been locked. Commenting is limited to contributors.
No description provided.