LibraLibra
LibraLibra
DocsBlogLibra
Getting Started
Architecture
Design
Commands
libra addlibra agentlibra alternateslibra applylibra archivelibra authlibra automationlibra bisectlibra blamelibra branchlibra bundlelibra cachelibra cat-filelibra check-attrlibra check-ignorelibra check-mailmaplibra checkoutlibra cherry-picklibra cleanlibra clonelibra cloudlibra code-controllibra codelibra commit-treelibra commitlibra completionslibra configlibra credentiallibra depslibra describelibra diff-fileslibra diff-indexlibra diff-treelibra difflibra dirtylibra fast-exportlibra fast-importlibra fetchlibra filelibra for-each-reflibra format-patchlibra fscklibra gclibra graphlibra greplibra hash-objectlibra hookslibra hydratelibra index-packlibra initlibra investigatelibra layerlibra lfslibra loglibra logfilelibra loginlibra logoutlibra ls-fileslibra ls-remotelibra ls-treelibra maintenancelibra medialibra merge-baselibra merge-filelibra mergelibra metadatalibra mvlibra noteslibra oplibra openlibra pack-objectslibra packagelibra prunelibra publishlibra pulllibra pushlibra read-treelibra rebaselibra refloglibra remotelibra repacklibra replacelibra rererelibra resetlibra restorelibra rev-listlibra rev-parselibra revertlibra reviewlibra revisionlibra rmlibra sandboxlibra servicelibra shortloglibra show-reflibra showlibra sparse-viewlibra stashlibra statslibra statuslibra switchlibra symbolic-reflibra taglibra update-indexlibra update-reflibra usagelibra verify-packlibra whoamilibra worktreelibra write-tree
API Reference
Policy
Commands

libra alternates

Command reference for `libra alternates`

libra alternates manages object alternates (lore.md 2.3): borrow objects from a shared/parent object store instead of copying them. A Libra extension (git has no alternates command — you edit objects/info/alternates by hand).

Compatibility

  • Level: intentionally-different.

Design

The single-owner internal::alternates module reads/writes two git-standard files under objects/info/:

  • alternates — object dirs this store borrows FROM. The read-resolver consults the transitive chain (cycle-safe, depth-capped) on a LOCAL miss; every borrowed hit is full-byte OID-verified before it is returned.
  • borrowers — object dirs that borrow FROM this store (a Libra extension).

exist consults alternates, so a borrowed-but-present object is never treated as missing.

Deletion safety (airtight)

Registering a base ALSO records this repo as a borrower of it. While any live borrower exists, the base's gc and cache evict refuse to prune loose objects — a shared base can never delete an object a borrower still needs. file obliterate refuses a borrow-only object (it never reaches into a parent's store); fsck reports a dangling alternate as an actionable error.

Guards

add refuses a self-reference, a base with a different core.objectformat (never borrow across hash kinds), and a TIERED (s3/r2) base (a local alternate cannot reach the base's remote tier).

Examples

libra alternates add /path/to/base/.libra/objects   # borrow from a shared store
libra alternates list
libra alternates remove /path/to/base/.libra/objects # stop borrowing

Deferred (not v1)

git clone --reference/--shared copy-avoidance (needs fetch have-negotiation against the alternate — the flags stay accepted no-ops for now); --dissociate (copy borrowed objects in + break the link); the 2.11 default shared-store.

libra agent

Command reference for `libra agent`

libra apply

Command reference for `libra apply`

On this page

CompatibilityDesignDeletion safety (airtight)GuardsExamplesDeferred (not v1)