From fe270dca8f28cef06d751ac0faf17af088c3ea3a Mon Sep 17 00:00:00 2001 From: "Maciek \"mab122\" Bator" Date: Thu, 16 Jul 2026 14:39:12 +0200 Subject: [PATCH] docs: fix stale pre-batching pre-commit hook description The pre-commit hook (installed by rad-heartwood-lfs's `rad lfs init`) no longer calls `rad lfs store` once per staged file -- it batches every file into one `rad lfs precommit` call, so a private repo's passphrase is only prompted for once per commit rather than once per file. Also note the push gotcha (pushing a commit and pushing its `refs/notes/rad-lfs` mapping are two separate `git push rad` invocations) here too, not just in the companion repo's docs. --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 33e3ba5..58f38ca 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,20 @@ once a repository has been set up with `rad lfs init` (from the fork above). ## How it works Every peer uses their own local IPFS node — there's no shared server. All of the actual -IPFS add/pin work and git-notes bookkeeping (`refs/notes/rad-lfs`) lives in the `rad lfs -store`/`rad lfs fetch` subcommands, implemented in the companion +IPFS add/pin work and git-notes bookkeeping lives in the `rad lfs store`/`rad lfs fetch`/ +`rad lfs precommit` subcommands, implemented in the companion [**radicle-heartwood-lfs**](https://git.hswro.org/mab122/radicle-heartwood-lfs) fork — that's also where content gets encrypted for private repositories before it ever reaches IPFS. This crate deliberately has no dependency on Radicle's identity/crypto stack; it just shells out: -- On `git add`/`git commit`, a pre-commit hook (installed by `rad lfs init`) runs `rad lfs - store` on each staged LFS-tracked file, which adds it to your local IPFS daemon, pins it, - encrypts it first if the repo is private, and records the resulting CID as a git note. That - notes ref travels with the repository via Radicle's normal replication, alongside everything - else. +- On `git add`/`git commit`, a pre-commit hook (installed by `rad lfs init`) collects every + staged LFS-tracked file's oid/size and passes them all to a single `rad lfs precommit` call, + which adds each one to your local IPFS daemon, pins it, encrypts it first if the repo is + private, and records the resulting CID as a git note (batched into one call, rather than one + per file, so a private repo's passphrase is only prompted for once per commit). Note that + committing the note locally and pushing it are separate steps in Radicle — pushing your + commit (`git push rad `) does **not** also push the notes ref; that needs a separate + bare `git push rad` (see radicle-heartwood-lfs's `LFS-IPFS.md` for the full explanation). - `rad-lfs-transfer` implements the other half: when `git lfs push`/`pull` runs, it's invoked per-object over stdin/stdout JSON (the standard Git LFS custom-transfer-agent protocol) and: - **upload**: shells out to `rad lfs store --oid --size `, which is