Loom now supports serving content directly from a git repository. No working directory needed — it reads blobs via git show and lists files via git ls-tree.
Usage
./loom --git /path/to/repo main content/
Three arguments:
- repo path — bare or non-bare repository
- branch — branch name to serve (default:
main) - content prefix — subdirectory within the repo (default: root)
How It Works
GitSource implements the same ContentSource concept as FileSystemSource. Under the hood:
git ls-tree -r <branch>:<prefix>/postslists all post filesgit ls-tree -d <branch>:<prefix>/postslists subdirectories (series)git show <branch>:<path>reads individual file contentsgit logprovides file timestamps for publish dates and modification times
The git watcher polls git rev-parse HEAD every 100ms. When the commit hash changes, it triggers a full cache rebuild with the same atomic swap as filesystem mode.
Why
Deploy Loom on a server, point it at a bare repo, and push to publish. No build pipeline, no CI, no deploy scripts. git push and the site updates within seconds.
Works with post-receive hooks too:
#!/bin/sh
# .git/hooks/post-receive
# Loom auto-detects the new commit and rebuilds
echo "Push received — Loom will pick up changes automatically"