| 1 | // Package gitcmd builds every git invocation Reasonix runs on its own behalf: |
| 2 | // the status readout, workspace change listings and diffs, worktree |
| 3 | // management, and plugin source checkouts. |
| 4 | // |
| 5 | // Host git never runs a program named by repository configuration. A |
| 6 | // repository's .git/config, its includes and its hooks are data written by |
| 7 | // whoever produced the repository, or by any command able to write inside it, |
| 8 | // and git executes several of them during ordinary read-only work: |
| 9 | // |
| 10 | // - Fixed keys are overridden with -c, which outranks repository config: |
| 11 | // core.fsmonitor (empty: old git reads "false" as a hook name), |
| 12 | // core.hooksPath, signature verification, diff.submodule, auto-maintenance |
| 13 | // and safe.bareRepository=explicit. submodule.recurse is off for tree |
| 14 | // updates, and elsewhere where the repository sets it. GIT_NO_LAZY_FETCH |
| 15 | // keeps a missing object from becoming a fetch (ObjectsMissing names it). |
| 16 | // - diff, log and show carry --no-ext-diff and --no-textconv; status and diff |
| 17 | // carry --ignore-submodules=dirty, since inspecting a submodule's working |
| 18 | // tree starts git inside it under the submodule's own config. |
| 19 | // - Filter and merge drivers defined at local or worktree scope are listed by |
| 20 | // git itself before each invocation (includes followed) and overridden |
| 21 | // empty; user and system drivers stay live. A name -c cannot address stops |
| 22 | // the invocation (ErrRepositoryDrivers). Ref and history plumbing that |
| 23 | // converts no content (rev-parse, rev-list, update-ref...) skips the listing. |
| 24 | // |
| 25 | // Which repository is read is settled once. A session resolves its workspace |
| 26 | // with Open before any command runs, and every later call through the Repo |
| 27 | // names its git dir, common dir and work tree explicitly, so a nested .git, a |
| 28 | // commondir file or a damaged HEAD written afterwards cannot substitute |
| 29 | // another repository's config. StageAll stages without entering a nested |
| 30 | // repository, and host-created worktrees are opened as they are added. |
| 31 | // |
| 32 | // A checkout during `worktree add` runs in a child past the driver listing, so |
| 33 | // callers add --no-checkout and populate through gitcmd in the new worktree. |
| 34 | // Remote transport settings reach only network commands, which run outside |
| 35 | // any repository (see Detached). |
| 36 | package gitcmd |
| 37 |