1 +#
Nushell git module verification matrix 3 +Primary scope: `nushell/modules/git.nu`.
5 +Secondary verified scope:
7 +- `nushell/modules/sy.nu`: dotfiles sync helper; real `run-external git` calls are verified separately.
9 +Not command modules for this goal:
11 +- `nushell/modules/prompt.nu`: parses `.git` metadata, does not invoke `git`.
12 +- `nushell/gen-aliases.nu`: defines alias metadata only (`aka g git`), no concrete git argv to verify.
14 +All verification must run in disposable temp repos/remotes via:
16 +- `nushell/tests/git-scope-guard.sh`: static guard for Nushell files that launch external `git`; prevents silently ignoring a new module/caller.
17 +- `nushell/tests/git-worktree-layout.sh`: `git.nu` behavior/effects smoke.
18 +- `nushell/tests/git-command-coverage.sh`: wraps `git` during `git.nu` Nushell calls, logs actual argv, and asserts every command shape below is exercised.
19 +- `nushell/tests/git-sync-module.sh`: `sy.nu` behavior/effects smoke with git argv logging.
21 +##
Exported command coverage 23 +| Export | Class | Covered by smoke | Notes |
25 +| `co` | network/local mutating | yes | local bare remote fixture only |
26 +| `wt` | read-only | yes | alias for `wt ls` |
27 +| `wt root` | read-only | yes | layout metadata |
28 +| `wt repo` | read-only | yes | layout metadata |
29 +| `wt path` | read-only | yes | canonical paths |
30 +| `wt ls` | read-only + per-worktree status | yes | checks dirty state |
31 +| `wt migrate --dry` | read-only planning | yes | normal checkout fixture |
32 +| `wt migrate` | destructive/local mutating | yes | normal + legacy fixtures; source backup verified |
33 +| `wt new` | local mutating | yes | with and without `--switch` |
34 +| `wt go` | env/local mutating with `--create` | yes | create path verified |
35 +| `wt rm` | destructive/local mutating | yes | removes worktree only |
36 +| `wt done` | destructive/local mutating | yes | removes worktree + branch |
37 +| `wt prune` | destructive metadata cleanup | yes | temp layout only |
38 +| `wt repair` | local mutating metadata | yes | forces absolute layout |
39 +| `wt add` | local mutating | yes | alias for `wt new` |
40 +| `wt list` | read-only | yes | alias for `wt ls` |
41 +| `wt lock` | local metadata mutating | yes | locks temp worktree |
42 +| `wt unlock` | local metadata mutating | yes | unlocks temp worktree |
43 +| `wt move` | local mutating | yes | path move verified |
44 +| `wt remove` | destructive/local mutating | yes | alias for `wt rm` |
46 +##
`sy.nu` exported command coverage 48 +| Export | Git command shape | Class | Covered by smoke | Notes |
49 +|---|---|---:|---:|---|
50 +| `sy` / `main` | `git -C $DOTFILES status --short --branch` | read-only | yes | disposable `$DOTFILES` clone; fake `macchina` |
51 +| `sy up` | `git -C $DOTFILES add --all` | local mutating | yes | clean disposable clone |
52 +| `sy up` | `git -C $DOTFILES commit --all` | local mutating | yes | clean clone, failure tolerated by module |
53 +| `sy up` | `git -C $DOTFILES push` | remote/network mutating | yes | local bare remote only |
54 +| `sy down` | `git -C $DOTFILES pull` | remote/network mutating | yes | local bare remote only; fake `topgrade` |
56 +##
`git.nu` invocation inventory 58 +| Line | Git command shape | Class | Exercised by |
60 +| 32 | `git ...$args` | wrapper | all commands |
61 +| 34 | `git -C $cwd ...$args` | wrapper | status/diff/apply/stash checks |
62 +| 81 | `git --git-dir <dir> config --get <key>` | read-only | layout, migration, config checks |
63 +| 86 | `git --git-dir <dir> config --bool --get <key>` | read-only | layout detection/config checks |
64 +| 91 | `git --git-dir <dir> config <key> <value>` | local metadata mutating | `co`, `wt migrate`, `wt repair` |
65 +| 95 | `git --git-dir <dir> config --unset <key>` | local metadata mutating | `co`, `wt migrate`, `wt repair` |
66 +| 99 | `git --git-dir <dir> -c worktree.useRelativePaths=false ...` | wrapper | all worktree add/move/repair absolute-path operations |
67 +| 123 | `git rev-parse --path-format=absolute --git-common-dir` | read-only | all layout commands |
68 +| 201 | `git --git-dir <dir> worktree list --porcelain` | read-only | `wt`, `wt ls`, `wt list`, path lookup |
69 +| 211 | `git --git-dir <dir> show-ref --verify --quiet refs/heads/<branch>` | read-only | `wt new`, `wt add`, `wt go --create` |
70 +| 223 | `git worktree add [ -b ] <path> <branch/base>` | local mutating | `wt new`, `wt add`, `wt go --create` |
71 +| 241 | `git rev-parse --abbrev-ref HEAD` | read-only | current branch, migrate, default remove |
72 +| 247 | `git rev-parse --show-toplevel` | read-only | current repo top/current marker |
73 +| 271 | `git --git-dir <dir> branch -d/-D <branch>` | destructive local mutating | `wt done` |
74 +| 280 | `git --git-dir <dir> worktree remove [--force] <path>` | destructive local mutating | `wt rm`, `wt remove`, `wt done` |
75 +| 290 | `git clone --bare <source> <git_dir>` | network/local mutating | `co` with local bare fixture |
76 +| 302 | `git --git-dir <dir> symbolic-ref --short HEAD` | read-only | `co` without `--branch` |
77 +| 327 | `git worktree add <main-path> <branch>` | local mutating | `co` |
78 +| 338 | `git -C <cwd> stash list` | read-only | `wt migrate` normal checkout |
79 +| 352 | `git rev-parse --path-format=absolute --git-common-dir` | read-only | `wt migrate` layout detection |
80 +| 362 | `git rev-parse --show-toplevel` | read-only | `wt migrate` normal checkout |
81 +| 405 | `git --git-dir <dir> worktree list --porcelain` | read-only | `wt migrate` legacy container |
82 +| 421 | `git -C <source> diff --binary --cached` | read-only | dirty migration |
83 +| 422 | `git -C <source> diff --binary` | read-only | dirty migration |
84 +| 432 | `git -C <target> apply [--index] <patch>` | local mutating | dirty migration |
85 +| 449 | `git -C <source> status` | read-only sanity | dirty migration |
86 +| 476 | `git worktree add <target> <branch>` | local mutating | normal checkout migration |
87 +| 515 | `git worktree repair` | local metadata mutating | migration repair |
88 +| 517 | `git worktree repair <paths...>` | local metadata mutating | normal checkout migration |
89 +| 530 | `git worktree list --porcelain` | read-only | legacy migration |
90 +| 536 | `git worktree move <old> <new>` | local mutating | legacy migration |
91 +| 544 | `git worktree repair` | local metadata mutating | `wt migrate` on already-new layout |
92 +| 660 | `git worktree prune` | destructive metadata cleanup | `wt prune` |
93 +| 666 | `git worktree repair` | local metadata mutating | `wt repair` |
94 +| 681 | `git worktree lock [--reason] <path>` | local metadata mutating | `wt lock` |
95 +| 686 | `git worktree unlock <path>` | local metadata mutating | `wt unlock` |
96 +| 690 | `git worktree move <path> <dest>` | local mutating | `wt move` |
98 +##
Failure behavior coverage 100 +| Scenario | Covered by smoke | Expected behavior |
102 +| `wt ls` outside co/wt layout | yes | fails |
103 +| `co .` | yes | fails; instructs `wt migrate` |
104 +| `wt new` to existing path/branch (`trunk`) | yes | fails |
105 +| `wt migrate` detached HEAD | yes | fails; original `.git` checkout remains |
107 +##
Evidence commands 109 +Current verification set:
112 +bash nushell/tests/git-scope-guard.sh
113 +bash nushell/tests/git-worktree-layout.sh
114 +bash nushell/tests/git-command-coverage.sh
115 +bash nushell/tests/git-sync-module.sh
116 +nu --commands
'use ./nushell/modules/git.nu *; help co | ignore; help wt migrate | ignore' 117 +nu --commands
'use ./nushell/modules/sy.nu; help sy | ignore; help "sy up" | ignore; help "sy down" | ignore' 121 +`git-scope-guard.sh` records the exact external-git callers in `nushell/`: `nushell/modules/git.nu` and `nushell/modules/sy.nu` are verified; `nushell/gen-aliases.nu` is alias metadata only.
123 +`git-command-coverage.sh` logs only git invocations launched from `git.nu` Nushell calls (`DOTFILES_GIT_TEST_PHASE=nu`) and ignores fixture setup git commands.
125 +`git-sync-module.sh` logs only git invocations reached through `sy.nu` commands and uses fake `macchina`/`topgrade` plus a local bare remote.
127 +##
Remaining verification gaps 129 +None known for exported commands and direct git invocation shapes in `nushell/modules/git.nu` or `nushell/modules/sy.nu`.