AI News HubLIVE
In-site rewrite2 min read

Show HN: Git-lazy-mount mount a repo without cloning it. Works with ordinary Git

git-lazy-mount is a tool that lazily mounts a Git repository using FUSE, fetching files on demand. It is designed for coding agents in microVMs and integrates with sgrep to avoid pulling the entire repo during searches. Linux-only.

SourceHacker News AIAuthor: mohsen1

Notifications You must be signed in to change notification settings

Fork 0

Star 1

BranchesTags

Open more actions menu

Folders and files

NameName

Last commit message

Last commit date

Latest commit

History

69 Commits

69 Commits

.github/workflows

.github/workflows

crates

crates

docs

docs

.gitignore

.gitignore

Cargo.lock

Cargo.lock

Cargo.toml

Cargo.toml

LICENSE-APACHE

LICENSE-APACHE

LICENSE-MIT

LICENSE-MIT

README.md

README.md

rust-toolchain.toml

rust-toolchain.toml

rustfmt.toml

rustfmt.toml

Repository files navigation

Lazily mount a git repo without cloning it. Files materialize as they are read or edited.

git lazy-mount https://github.com/example/huge-repo ~/huge-repo

After it returns, your ordinary git and tools just work:

cd ~/huge-repo vim src/main.rs git commit -am 'Some edit' git switch -c feature git push

Why?

This is aimed at microVMs that spin up to run coding agents against a git repository. The idea is that the coding agent can start working immediately without having to wait for a full clone.

When the agent runs a test or build, only relevant files are downloaded on demand.

Grep tool in AI session

Tools like rg and git grep read every file, so they pull the whole repo and undo the point of lazy-mount.

To mititgate this, we can route search through sgrep instead. It queries a code-search index (Sourcegraph by default, and pluggable) and overlays your uncommitted edits, fetching nothing.

More in crates/sgrep.

Performance in real world

Measured cold in a Linux container, with one real claude prompt per repo:

prompt files full working tree git lazy-mount

"where does useState resolve its initial state?" facebook/react 7,244 72 MB 19 MB

"where is the toggle-word-wrap command registered?" microsoft/vscode 16,001 301 MB 94 MB

"what does createTypeChecker return?" microsoft/TypeScript 81,370 652 MB 27 MB

Linux Only

Linux only: because almost all microVMs are Linux-based.

The whole stack (a transparent kernel-mounted working tree) is built on Linux FUSE (libfuse3, /dev/fuse).

Windows and macOS

Windows and macOS are not supported. The design notes and feasibility studies are kept under docs/future-platforms/ if we pick them up later.

Install / build

Linux. Needs libfuse3 + the system git (>= 2.36).

cargo build --release -p glm-cli --features fuse # produces git-lazy-mount

Docs

Everything is in docs/:

Using it: compatibility (which git commands work, and how lazily) and limitations (what's deferred, and why).

How it works: the architecture overview, then deep-dives into the worktree model, FUSE semantics, and object fetching.

License

MIT + Apache

About

Lazily mount a git repo without cloning it. Works with ordinary git commands

Topics

git

rust

Resources

Readme

License

Unknown, MIT licenses found

Unknown

LICENSE-APACHE

MIT

LICENSE-MIT

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks

Report repository

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Rust 100.0%