Problem
The git remote helper binary that lets git natively use freenet: URLs.
What needs to happen
git-remote-freenet implements the git remote helper protocol:
- Read commands from stdin: capabilities, list, fetch, push.
- Write responses to stdout per the protocol.
- Must be on PATH; git invokes it automatically when it sees a freenet: URL.
list
Read the repo contract via WS GET, return the refs from RepoState.refs.
fetch
For each commit requested:
- Walk RepoState.object_index, pull SinglePack bundles whose pack contains commits in our want set.
- For each pack, GET the pack contract by id (pack_contract_id helper already exists).
- Verify BLAKE3(pack_bytes) matches what we expect, then unpack into .git/objects.
push
- Build a packfile of new objects with
git pack-objects.
- PUT the pack as a new pack-contract instance.
- Sign and submit a delta to the repo contract that adds the bundle to object_index and updates refs[ref] to the new commit.
- Subscribe to the repo contract; wait for the network to reflect our update is the visible head.
- If the visible head is someone else's update (race), surface "superseded — please rebase" via stderr and exit non-zero.
Phase 1.0 simplifications
- SinglePack only (no ChunkedPack support; reject contracts that have unfetchable ChunkedPack records with a clear message).
- Single-writer; the helper signs as the loaded identity.
Pointers
[AI-assisted - Claude]
Problem
The git remote helper binary that lets git natively use freenet: URLs.
What needs to happen
git-remote-freenet implements the git remote helper protocol:
list
Read the repo contract via WS GET, return the refs from RepoState.refs.
fetch
For each commit requested:
push
git pack-objects.Phase 1.0 simplifications
Pointers
[AI-assisted - Claude]