Mount Git repo to view commits and branches as files
3 days ago
- #fuse
- #filesystem
- #git
- GitSnapFS exposes Git repository snapshots as a read-only filesystem for inspection, audits, and tooling.
- Provides access via `/commits/<commit-id>`, `/branches/`, `/tags/`, and `/HEAD` as symlinks to commits.
- Uses synthetic inodes from Git object IDs for stable links across views.
- Read-only, lazy-loading filesystem that updates without pre-scanning the underlying repo.
- Supports hot upgrades by duplicating FUSE file descriptor across `exec`.
- Optimized performance with zero-message open/opendir paths (`NO_OPEN_SUPPORT`, `NO_OPENDIR_SUPPORT`).
- Requires Linux with FUSE kernel support (`EXPORT_SUPPORT`, `ZERO_MESSAGE_OPEN`, `ZERO_MESSAGE_OPENDIR`).
- Needs `fusermount`/`fusermount3` and Rust toolchain (nightly or stable).
- Mount with `cargo run -- --repo path/to/.git --mountpoint /tmp/gitfs`.
- Unmount using `fusermount -u /tmp/gitfs` or by terminating the process.
- Design notes in `codex_spec.md`; enforced formatting/linting via `cargo fmt` and `cargo clippy`.
- Uses `gix` for Git access and `fuse-backend-rs` for FUSE, avoiding libfuse/libgit2 shims.