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 sparse-view

Command reference for `libra sparse-view`

libra sparse-view manages a read-only sparse VIEW filter (lore.md 2.2) — the non-declined complement of git sparse-checkout. It is a Libra extension, deliberately NOT named sparse-checkout: it NEVER touches the working tree.

Compatibility

  • Level: intentionally-different.
  • The MATERIALIZING forms — the top-level sparse-checkout command and clone --sparse — remain declined (D10). mv --sparse / rm --sparse stay accepted no-ops (skip-worktree cone membership, still unimplemented).

Design

An allowlist of gitignore-syntax include patterns scopes what the read/query commands DISPLAY:

  • ls-files — lists only in-view tracked/other entries (unmerged entries are always shown).
  • diff — the WORKING-TREE diff (unstaged) is scoped to the view.

It is strictly read-only and commit-safe:

  • The working tree is never modified; no skip-worktree bits are written.
  • status content is NEVER filtered — it stays honest about what commit will record (only a one-line advisory notes the view is active).
  • diff --staged (commit-authoritative) and diff A..B (rev-vs-rev) are NEVER filtered.

Pattern semantics are an ALLOWLIST: the last matching pattern wins, a !pat carves a hole back out even under a broader include, and a path matched by no pattern is out-of-view (default-exclude). There is no ancestor-dominance short-circuit (which would defeat !child negations). A disabled or empty view is a no-op (output is byte-identical to no view configured).

State: patterns in the sparse_view SQLite table (owner internal::sparse); the toggle in config_kv sparse.enabled.

Examples

libra sparse-view set 'src/**' 'docs/**'   # scope ls-files/diff to these paths
libra sparse-view add '!src/gen/**'        # carve a hole out of the view
libra sparse-view list
libra sparse-view status                   # enabled state + pattern count
libra sparse-view disable                  # off (patterns kept)
libra sparse-view clear                    # drop all patterns and disable

Deferred (not v1)

Cone mode (auto-including parent dirs + full subtrees); any materialization (that is the declined D10 sparse-checkout).

libra show

Command reference for `libra show`

libra stash

Command reference for `libra stash`

On this page

CompatibilityDesignExamplesDeferred (not v1)