Expand description
fs.git_status: what git says about the entries of a listed folder, for
the Files pane’s markers (modified, untracked, ignored…) and its status
line (branch, ahead/behind).
Running git inside a folder the user merely browsed must not run code the
folder chose. A repository’s own config can name programs that git status executes: core.fsmonitor, and a filter.<name>.clean (or
.process) applied through its .gitattributes whenever a file’s stat
data differs from the index. Command-line -c settings win over every
config file, so the fsmonitor is turned off and every filter the
repository itself defines is blanked; the user’s own system and global
filters (Git LFS) are left alone. Submodules, which have configs of their
own, are not entered. The status never writes the index
(--no-optional-locks), prompts for nothing, and is killed after a few
seconds on a huge repository.
Spec: docs/specs/SPEC_FILE_BROWSER_PANE_2026_10_01.md §12 (Phase 2, git decorations).
Structs§
- GitRecord
- One path git reported, relative to the repository’s top.
- Porcelain
- What
git status --porcelain=v2 -z --branchprinted.
Enums§
- GitError 🔒
- Status
Error 🔒 - Why
safe_status_porcelaingave no status.
Constants§
- GIT_
TIMEOUT 🔒 - A status that takes longer than this is abandoned: the pane shows no markers rather than waiting.
- SAFE_
CONFIG 🔒 - Settings forced on every git run here, ahead of any config file.
Functions§
- filter_
names - Filter names from
git config [--show-scope] --name-only --get-regexp ^filter\.output; with scopes, only those outside system and global. - git_
status fs.git_statusforraw(a folder the pane listed).- parse_
porcelain_ v2 - Parse porcelain v2 output (
-z: NUL-terminated records; a rename’s original path follows it as its own NUL-terminated field). - repo_
filters 🔒 - The names of the filters a repository’s own config defines (its
.git/config, worktree config, and what they include): everyfilter.<name>.*key whose scope isn’t the user’s system or global config. An older git without--show-scopegets every filter blanked.Errwhen the config couldn’t be read: the caller must not run git status then. Only--get-regexp’s exit 1 (“no match”) means none. - run_git 🔒
- Run git in
dirwith the safe settings; its stdout, or a sentence. - safe_
git_ 🔒line - Run a read-only git command (
rev-parse,remote get-url) indirwith the same safe settings and timeout as the status above: its trimmed stdout, orNoneon any failure. - safe_
status_ 🔒porcelain git status --porcelain=v2 -z --branch --untracked-files=normal --ignore-submodules=all <extra>indir, with the repository’s own filters blanked (see module docs). Shared by the Files pane and the agents’ work facts (backend::work_facts).- state_
of_ 🔒xy - The state an ordinary (
1) or rename/copy (2) record’s XY code means: the most pressing of the staged (X) and unstaged (Y) changes. - summarize
- Fold the records under
prefix(the listed folder, relative to the repository’s top,/-separated with a trailing/, or empty) into one state per direct child. A folder takes the most pressing state of what’s inside it, except that a folder is only “ignored” when git ignores the folder itself.