$ show pcal43/fastback
FastBack is a Minecraft mod that provides fast, incremental world backups using Git. It stores backup snapshots as orphan branches in a Git repository embedded within the world save directory, enabling efficient storage of only changed files. The mod supports local backups, remote backups to any Git server or file system, automatic scheduling on shutdown or autosave, snapshot pruning with configurable retention policies (daily, fixed, GFS, all), and restoration of snapshots. It requires native git and git-lfs to be installed, with a fallback to JGit for legacy backups. The architecture is modular: a common module contains all backup logic (commands, repo management, config, logging, mixins), while Fabric and NeoForge loader-specific modules handle platform integration. The codebase demonstrates strong engineering practices with clean interfaces, robust error handling, comprehensive logging, and a well-designed retention policy system.
The LLM identified 2 files worth highlighting for reuse:
Encodes and decodes retention policies to/from a single-line string suitable for storage in Git config. Supports multiple policy types (daily, fixed, GFS, all) with parameterized configuration. The codec is self-contained, uses only standard Java and UserMessage, and could be extracted and reused in any project needing to serialize/deserialize policy configurations.
Provides robust execution of external processes with real-time line-by-line output handling via Consumer callbacks. Handles both stdout and stderr, supports environment variables, and includes detailed logging. The implementation correctly drains streams concurrently and handles line buffering. This utility is generic and could be reused in any Java project that needs to run external commands with progress feedback.