@statewalker/vcs-commands 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/add-command.d.ts +38 -0
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/am/am-command.d.ts +55 -1
- package/dist/commands/am/am-command.d.ts.map +1 -1
- package/dist/commands/am/index.d.ts +1 -0
- package/dist/commands/am/index.d.ts.map +1 -1
- package/dist/commands/am/mailsplit.d.ts +88 -0
- package/dist/commands/am/mailsplit.d.ts.map +1 -0
- package/dist/commands/apply/apply-command.d.ts.map +1 -1
- package/dist/commands/apply/apply-engine.d.ts.map +1 -1
- package/dist/commands/apply/apply-parse.d.ts.map +1 -1
- package/dist/commands/bisect/bisect-command.d.ts +2 -0
- package/dist/commands/bisect/bisect-command.d.ts.map +1 -1
- package/dist/commands/bisect/bisect-engine.d.ts.map +1 -1
- package/dist/commands/branch-command.d.ts +148 -18
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/branch-info-command.d.ts +55 -0
- package/dist/commands/branch-info-command.d.ts.map +1 -0
- package/dist/commands/branch-tracking.d.ts +106 -17
- package/dist/commands/branch-tracking.d.ts.map +1 -1
- package/dist/commands/branch-upstream-command.d.ts +83 -0
- package/dist/commands/branch-upstream-command.d.ts.map +1 -0
- package/dist/commands/checkout-command.d.ts +19 -3
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/cherry-pick-command.d.ts +59 -0
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +12 -0
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +17 -0
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/comment-char-config.d.ts +35 -0
- package/dist/commands/comment-char-config.d.ts.map +1 -0
- package/dist/commands/commit-command.d.ts +191 -5
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/commit-reuse.d.ts +33 -0
- package/dist/commands/commit-reuse.d.ts.map +1 -0
- package/dist/commands/config-command.d.ts +236 -0
- package/dist/commands/config-command.d.ts.map +1 -0
- package/dist/commands/config-value-types.d.ts +91 -0
- package/dist/commands/config-value-types.d.ts.map +1 -0
- package/dist/commands/core-config.d.ts +20 -0
- package/dist/commands/core-config.d.ts.map +1 -1
- package/dist/commands/default-branch.d.ts +70 -0
- package/dist/commands/default-branch.d.ts.map +1 -0
- package/dist/commands/diff-color-config.d.ts +73 -0
- package/dist/commands/diff-color-config.d.ts.map +1 -0
- package/dist/commands/diff-command.d.ts +252 -5
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/fetch-command.d.ts +20 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/fmt-merge-msg-command.d.ts +124 -0
- package/dist/commands/fmt-merge-msg-command.d.ts.map +1 -0
- package/dist/commands/fork-point.d.ts +38 -0
- package/dist/commands/fork-point.d.ts.map +1 -0
- package/dist/commands/format-patch-command.d.ts +41 -1
- package/dist/commands/format-patch-command.d.ts.map +1 -1
- package/dist/commands/fsck/fetch-fsck.d.ts +51 -0
- package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-command.d.ts +2 -0
- package/dist/commands/fsck/fsck-command.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-loose.d.ts +3 -0
- package/dist/commands/fsck/fsck-loose.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-object-checks.d.ts +25 -14
- package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-object-table.d.ts +15 -7
- package/dist/commands/fsck/fsck-object-table.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-pack.d.ts +11 -4
- package/dist/commands/fsck/fsck-pack.d.ts.map +1 -1
- package/dist/commands/fsck/verify-pack-command.d.ts.map +1 -1
- package/dist/commands/gc-command.d.ts +80 -48
- package/dist/commands/gc-command.d.ts.map +1 -1
- package/dist/commands/git-date.d.ts +1 -65
- package/dist/commands/git-date.d.ts.map +1 -1
- package/dist/commands/git-describe.d.ts +4 -0
- package/dist/commands/git-describe.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +43 -0
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/grep/grep-command.d.ts +210 -0
- package/dist/commands/grep/grep-command.d.ts.map +1 -0
- package/dist/commands/grep/grep-engine.d.ts +218 -0
- package/dist/commands/grep/grep-engine.d.ts.map +1 -0
- package/dist/commands/grep/index.d.ts +3 -0
- package/dist/commands/grep/index.d.ts.map +1 -0
- package/dist/commands/index-adder.d.ts +15 -2
- package/dist/commands/index-adder.d.ts.map +1 -1
- package/dist/commands/index.d.ts +28 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +3 -3
- package/dist/commands/init-command.d.ts +50 -3
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/interpret-trailers-command.d.ts +90 -0
- package/dist/commands/interpret-trailers-command.d.ts.map +1 -0
- package/dist/commands/legacy-remotes.d.ts +55 -0
- package/dist/commands/legacy-remotes.d.ts.map +1 -0
- package/dist/commands/local-transport.d.ts +36 -5
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +296 -11
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-graph.d.ts +26 -1
- package/dist/commands/log-graph.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +133 -5
- package/dist/commands/log-output.d.ts.map +1 -1
- package/dist/commands/ls-remote-command.d.ts +2 -0
- package/dist/commands/ls-remote-command.d.ts.map +1 -1
- package/dist/commands/mailmap.d.ts +30 -0
- package/dist/commands/mailmap.d.ts.map +1 -1
- package/dist/commands/merge-base-command.d.ts +60 -0
- package/dist/commands/merge-base-command.d.ts.map +1 -0
- package/dist/commands/merge-bases.d.ts +23 -0
- package/dist/commands/merge-bases.d.ts.map +1 -1
- package/dist/commands/merge-command.d.ts +108 -9
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-support.d.ts +11 -3
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/mv-command.d.ts +4 -0
- package/dist/commands/mv-command.d.ts.map +1 -1
- package/dist/commands/name-rev.d.ts +48 -0
- package/dist/commands/name-rev.d.ts.map +1 -0
- package/dist/commands/notes-command.d.ts.map +1 -1
- package/dist/commands/notes-merge-command.d.ts.map +1 -1
- package/dist/commands/notes-tree.d.ts +11 -1
- package/dist/commands/notes-tree.d.ts.map +1 -1
- package/dist/commands/patch-id.d.ts +3 -0
- package/dist/commands/patch-id.d.ts.map +1 -1
- package/dist/commands/pathspec-file.d.ts +39 -0
- package/dist/commands/pathspec-file.d.ts.map +1 -0
- package/dist/commands/pathspec.d.ts +3 -0
- package/dist/commands/pathspec.d.ts.map +1 -1
- package/dist/commands/pretty-format.d.ts +43 -3
- package/dist/commands/pretty-format.d.ts.map +1 -1
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/pull-command.d.ts +28 -0
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +160 -9
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/read-tree-command.d.ts +6 -0
- package/dist/commands/read-tree-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +168 -6
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/for-each-ref-command.d.ts +121 -0
- package/dist/commands/ref-filter/for-each-ref-command.d.ts.map +1 -0
- package/dist/commands/ref-filter/index.d.ts +8 -0
- package/dist/commands/ref-filter/index.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-atoms.d.ts +88 -0
- package/dist/commands/ref-filter/ref-atoms.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-filter.d.ts +178 -0
- package/dist/commands/ref-filter/ref-filter.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-format.d.ts +222 -0
- package/dist/commands/ref-filter/ref-format.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts +56 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-quote.d.ts +20 -0
- package/dist/commands/ref-filter/ref-quote.d.ts.map +1 -0
- package/dist/commands/ref-filter/version-compare.d.ts +20 -0
- package/dist/commands/ref-filter/version-compare.d.ts.map +1 -0
- package/dist/commands/reflog-command.d.ts +120 -0
- package/dist/commands/reflog-command.d.ts.map +1 -1
- package/dist/commands/reflog-walk.d.ts +72 -0
- package/dist/commands/reflog-walk.d.ts.map +1 -0
- package/dist/commands/remote-command.d.ts +138 -29
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/remote-transport.d.ts +7 -1
- package/dist/commands/remote-transport.d.ts.map +1 -1
- package/dist/commands/reset-command.d.ts +2 -3
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts +2 -3
- package/dist/commands/restore-command.d.ts.map +1 -1
- package/dist/commands/rev-filter/commit-filter.d.ts +95 -0
- package/dist/commands/rev-filter/commit-filter.d.ts.map +1 -0
- package/dist/commands/rev-filter/commit-grep.d.ts +91 -0
- package/dist/commands/rev-filter/commit-grep.d.ts.map +1 -0
- package/dist/commands/rev-filter/index.d.ts +3 -0
- package/dist/commands/rev-filter/index.d.ts.map +1 -0
- package/dist/commands/rev-list-command.d.ts +154 -2
- package/dist/commands/rev-list-command.d.ts.map +1 -1
- package/dist/commands/rev-parse-command.d.ts +9 -0
- package/dist/commands/rev-parse-command.d.ts.map +1 -1
- package/dist/commands/revert-command.d.ts +32 -0
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +32 -1
- package/dist/commands/revision-range.d.ts.map +1 -1
- package/dist/commands/revision-resolver.d.ts +21 -2
- package/dist/commands/revision-resolver.d.ts.map +1 -1
- package/dist/commands/rm-command.d.ts +70 -2
- package/dist/commands/rm-command.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +85 -5
- package/dist/commands/sequencer-pick.d.ts.map +1 -1
- package/dist/commands/sequencer-support.d.ts +2 -0
- package/dist/commands/sequencer-support.d.ts.map +1 -1
- package/dist/commands/serve-repository.d.ts +7 -0
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/show-command.d.ts +130 -0
- package/dist/commands/show-command.d.ts.map +1 -0
- package/dist/commands/show-commit.d.ts +11 -0
- package/dist/commands/show-commit.d.ts.map +1 -0
- package/dist/commands/signature-check.d.ts +164 -0
- package/dist/commands/signature-check.d.ts.map +1 -0
- package/dist/commands/signing.d.ts +160 -0
- package/dist/commands/signing.d.ts.map +1 -0
- package/dist/commands/sparse-checkout-command.d.ts.map +1 -1
- package/dist/commands/sparse-index-view.d.ts +45 -0
- package/dist/commands/sparse-index-view.d.ts.map +1 -0
- package/dist/commands/ssh-signer.d.ts +29 -0
- package/dist/commands/ssh-signer.d.ts.map +1 -0
- package/dist/commands/ssh-verifier.d.ts +42 -0
- package/dist/commands/ssh-verifier.d.ts.map +1 -0
- package/dist/commands/stash-apply-command.d.ts +5 -0
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-branch-command.d.ts +34 -0
- package/dist/commands/stash-branch-command.d.ts.map +1 -0
- package/dist/commands/stash-create-command.d.ts +18 -1
- package/dist/commands/stash-create-command.d.ts.map +1 -1
- package/dist/commands/stash-info.d.ts +93 -0
- package/dist/commands/stash-info.d.ts.map +1 -0
- package/dist/commands/stash-list-command.d.ts +16 -0
- package/dist/commands/stash-list-command.d.ts.map +1 -1
- package/dist/commands/stash-pop-command.d.ts +39 -0
- package/dist/commands/stash-pop-command.d.ts.map +1 -0
- package/dist/commands/stash-show-command.d.ts +48 -0
- package/dist/commands/stash-show-command.d.ts.map +1 -0
- package/dist/commands/stash-store-command.d.ts +29 -0
- package/dist/commands/stash-store-command.d.ts.map +1 -0
- package/dist/commands/stash-working-tree.d.ts.map +1 -1
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-header.d.ts +5 -0
- package/dist/commands/status-header.d.ts.map +1 -1
- package/dist/commands/submodule-add-command.d.ts +89 -0
- package/dist/commands/submodule-add-command.d.ts.map +1 -0
- package/dist/commands/submodule-auth.d.ts +90 -0
- package/dist/commands/submodule-auth.d.ts.map +1 -0
- package/dist/commands/submodule-commands.d.ts +375 -0
- package/dist/commands/submodule-commands.d.ts.map +1 -0
- package/dist/commands/submodule-model.d.ts +288 -0
- package/dist/commands/submodule-model.d.ts.map +1 -0
- package/dist/commands/submodule-summary-command.d.ts.map +1 -1
- package/dist/commands/submodule-update-command.d.ts +198 -0
- package/dist/commands/submodule-update-command.d.ts.map +1 -0
- package/dist/commands/switch-command.d.ts.map +1 -1
- package/dist/commands/tag-command.d.ts +259 -10
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/trailers.d.ts +218 -17
- package/dist/commands/trailers.d.ts.map +1 -1
- package/dist/commands/tree-restore.d.ts +7 -0
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/untracked-cache-support.d.ts +2 -1
- package/dist/commands/untracked-cache-support.d.ts.map +1 -1
- package/dist/commands/verify-command.d.ts +92 -0
- package/dist/commands/verify-command.d.ts.map +1 -0
- package/dist/commands/worktree-add-command.d.ts +79 -7
- package/dist/commands/worktree-add-command.d.ts.map +1 -1
- package/dist/commands/worktree-list-command.d.ts.map +1 -1
- package/dist/commands/worktree-path-rules.d.ts +66 -0
- package/dist/commands/worktree-path-rules.d.ts.map +1 -0
- package/dist/commands/worktree-remove-command.d.ts +10 -3
- package/dist/commands/worktree-remove-command.d.ts.map +1 -1
- package/dist/commands/worktree-repair-command.d.ts +15 -2
- package/dist/commands/worktree-repair-command.d.ts.map +1 -1
- package/dist/commands/worktree-support.d.ts +5 -0
- package/dist/commands/worktree-support.d.ts.map +1 -1
- package/dist/{commands-DnmlfwGV.js → commands-ISM52N0n.js} +66120 -49271
- package/dist/errors/checkout-errors.d.ts +19 -0
- package/dist/errors/checkout-errors.d.ts.map +1 -1
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/index.js +57 -3
- package/dist/errors/ref-errors.d.ts +19 -0
- package/dist/errors/ref-errors.d.ts.map +1 -1
- package/dist/errors/worktree-errors.d.ts +6 -1
- package/dist/errors/worktree-errors.d.ts.map +1 -1
- package/dist/{git-command-DxvwPrPB.js → fsck-DLRpbwTj.js} +6863 -1070
- package/dist/git-command.d.ts +43 -2
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +276 -3
- package/dist/git.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/remote-config/index.d.ts +1 -1
- package/dist/remote-config/index.d.ts.map +1 -1
- package/dist/remote-config/remote-config-store.d.ts +117 -3
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/rename/detect-renames.d.ts.map +1 -1
- package/dist/results/clone-result.d.ts +8 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/combined-diff.d.ts +3 -0
- package/dist/results/combined-diff.d.ts.map +1 -1
- package/dist/results/diff-check.d.ts +38 -0
- package/dist/results/diff-check.d.ts.map +1 -0
- package/dist/results/diff-color.d.ts +135 -0
- package/dist/results/diff-color.d.ts.map +1 -0
- package/dist/results/diff-output.d.ts +85 -1
- package/dist/results/diff-output.d.ts.map +1 -1
- package/dist/results/diff-pickaxe.d.ts +67 -0
- package/dist/results/diff-pickaxe.d.ts.map +1 -0
- package/dist/results/diff-words.d.ts +55 -0
- package/dist/results/diff-words.d.ts.map +1 -0
- package/dist/results/index.d.ts +4 -0
- package/dist/results/index.d.ts.map +1 -1
- package/dist/results/index.js +2 -2
- package/dist/results/init-result.d.ts +7 -0
- package/dist/results/init-result.d.ts.map +1 -1
- package/dist/results/pull-result.d.ts +5 -0
- package/dist/results/pull-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +12 -0
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/rebase-result.d.ts +2 -0
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/stash-result.d.ts +6 -0
- package/dist/results/stash-result.d.ts.map +1 -1
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/{results-BZGa2Z3I.js → results-TB2IJ64h.js} +2178 -412
- package/dist/whitespace/index.d.ts +2 -0
- package/dist/whitespace/index.d.ts.map +1 -0
- package/dist/whitespace/whitespace-rule.d.ts +94 -0
- package/dist/whitespace/whitespace-rule.d.ts.map +1 -0
- package/package.json +12 -12
- package/src/commands/add-command.ts +178 -17
- package/src/commands/add-patch/add-interactive.ts +3 -3
- package/src/commands/am/am-command.ts +263 -43
- package/src/commands/am/index.ts +1 -0
- package/src/commands/am/mailsplit.ts +326 -0
- package/src/commands/apply/apply-command.ts +18 -8
- package/src/commands/apply/apply-engine.ts +6 -7
- package/src/commands/apply/apply-parse.ts +10 -10
- package/src/commands/attributes-source.ts +1 -1
- package/src/commands/bisect/bisect-command.ts +18 -5
- package/src/commands/bisect/bisect-engine.ts +2 -1
- package/src/commands/branch-command.ts +528 -53
- package/src/commands/branch-info-command.ts +150 -0
- package/src/commands/branch-tracking.ts +335 -60
- package/src/commands/branch-upstream-command.ts +218 -0
- package/src/commands/checkout-command.ts +70 -44
- package/src/commands/cherry-pick-command.ts +143 -0
- package/src/commands/clean-command.ts +34 -3
- package/src/commands/clone-command.ts +118 -5
- package/src/commands/comment-char-config.ts +160 -0
- package/src/commands/commit-command.ts +790 -71
- package/src/commands/commit-reuse.ts +94 -0
- package/src/commands/config-command.ts +1256 -0
- package/src/commands/config-value-types.ts +358 -0
- package/src/commands/core-config.ts +47 -2
- package/src/commands/default-branch.ts +196 -0
- package/src/commands/diff-color-config.ts +274 -0
- package/src/commands/diff-command.ts +1053 -75
- package/src/commands/fetch-command.ts +161 -13
- package/src/commands/fmt-merge-msg-command.ts +715 -0
- package/src/commands/fork-point.ts +63 -0
- package/src/commands/format-patch-command.ts +316 -43
- package/src/commands/fsck/fetch-fsck.ts +172 -18
- package/src/commands/fsck/fsck-command.ts +183 -66
- package/src/commands/fsck/fsck-loose.ts +14 -4
- package/src/commands/fsck/fsck-object-checks.ts +87 -46
- package/src/commands/fsck/fsck-object-table.ts +52 -42
- package/src/commands/fsck/fsck-pack.ts +64 -34
- package/src/commands/fsck/verify-pack-command.ts +5 -2
- package/src/commands/gc-command.ts +238 -107
- package/src/commands/git-date.ts +9 -895
- package/src/commands/git-describe.ts +31 -11
- package/src/commands/git-hooks.ts +92 -0
- package/src/commands/grep/grep-command.ts +1077 -0
- package/src/commands/grep/grep-engine.ts +1024 -0
- package/src/commands/grep/index.ts +2 -0
- package/src/commands/index-adder.ts +54 -10
- package/src/commands/index.ts +28 -0
- package/src/commands/init-command.ts +167 -11
- package/src/commands/interpret-trailers-command.ts +256 -0
- package/src/commands/legacy-remotes.ts +224 -0
- package/src/commands/local-transport.ts +109 -10
- package/src/commands/log-command.ts +1283 -232
- package/src/commands/log-graph.ts +123 -26
- package/src/commands/log-output.ts +280 -21
- package/src/commands/ls-remote-command.ts +9 -0
- package/src/commands/mailmap.ts +119 -0
- package/src/commands/merge-base-command.ts +170 -0
- package/src/commands/merge-bases.ts +63 -8
- package/src/commands/merge-command.ts +360 -82
- package/src/commands/merge-support.ts +43 -9
- package/src/commands/mv-command.ts +6 -3
- package/src/commands/name-rev.ts +171 -0
- package/src/commands/notes-command.ts +11 -1
- package/src/commands/notes-merge-command.ts +23 -14
- package/src/commands/notes-tree.ts +28 -13
- package/src/commands/octopus-merge.ts +3 -2
- package/src/commands/patch-id.ts +16 -8
- package/src/commands/pathspec-file.ts +72 -0
- package/src/commands/pathspec.ts +14 -2
- package/src/commands/pretty-format.ts +105 -20
- package/src/commands/promisor-remote.ts +10 -1
- package/src/commands/pull-command.ts +149 -22
- package/src/commands/push-command.ts +704 -72
- package/src/commands/read-tree-command.ts +34 -3
- package/src/commands/rebase-command.ts +957 -142
- package/src/commands/ref-filter/for-each-ref-command.ts +298 -0
- package/src/commands/ref-filter/index.ts +7 -0
- package/src/commands/ref-filter/ref-atoms.ts +581 -0
- package/src/commands/ref-filter/ref-filter.ts +651 -0
- package/src/commands/ref-filter/ref-format.ts +1070 -0
- package/src/commands/ref-filter/ref-listing-command.ts +421 -0
- package/src/commands/ref-filter/ref-quote.ts +69 -0
- package/src/commands/ref-filter/version-compare.ts +177 -0
- package/src/commands/reflog-command.ts +492 -2
- package/src/commands/reflog-walk.ts +234 -0
- package/src/commands/remote-command.ts +484 -74
- package/src/commands/remote-transport.ts +9 -1
- package/src/commands/reset-command.ts +40 -42
- package/src/commands/restore-command.ts +12 -41
- package/src/commands/rev-filter/commit-filter.ts +159 -0
- package/src/commands/rev-filter/commit-grep.ts +444 -0
- package/src/commands/rev-filter/index.ts +2 -0
- package/src/commands/rev-list-command.ts +402 -15
- package/src/commands/rev-parse-command.ts +22 -0
- package/src/commands/revert-command.ts +82 -0
- package/src/commands/revision-range.ts +204 -4
- package/src/commands/revision-resolver.ts +55 -22
- package/src/commands/rm-command.ts +282 -21
- package/src/commands/sequencer-pick.ts +504 -86
- package/src/commands/sequencer-support.ts +30 -5
- package/src/commands/serve-repository.ts +18 -3
- package/src/commands/show-command.ts +490 -0
- package/src/commands/show-commit.ts +24 -0
- package/src/commands/signature-check.ts +657 -0
- package/src/commands/signing.ts +385 -0
- package/src/commands/sparse-checkout-command.ts +2 -9
- package/src/commands/sparse-checkout-support.ts +2 -2
- package/src/commands/sparse-index-view.ts +135 -0
- package/src/commands/ssh-signer.ts +199 -0
- package/src/commands/ssh-verifier.ts +523 -0
- package/src/commands/stash-apply-command.ts +17 -5
- package/src/commands/stash-branch-command.ts +88 -0
- package/src/commands/stash-create-command.ts +30 -2
- package/src/commands/stash-info.ts +243 -0
- package/src/commands/stash-list-command.ts +33 -0
- package/src/commands/stash-pop-command.ts +83 -0
- package/src/commands/stash-show-command.ts +141 -0
- package/src/commands/stash-store-command.ts +82 -0
- package/src/commands/stash-working-tree.ts +2 -2
- package/src/commands/status-command.ts +7 -6
- package/src/commands/status-header.ts +44 -8
- package/src/commands/submodule-add-command.ts +509 -0
- package/src/commands/submodule-auth.ts +276 -0
- package/src/commands/submodule-commands.ts +1517 -0
- package/src/commands/submodule-model.ts +930 -0
- package/src/commands/submodule-summary-command.ts +6 -7
- package/src/commands/submodule-update-command.ts +1092 -0
- package/src/commands/switch-command.ts +3 -1
- package/src/commands/tag-command.ts +876 -64
- package/src/commands/trailers.ts +837 -100
- package/src/commands/tree-restore.ts +38 -10
- package/src/commands/untracked-cache-support.ts +16 -12
- package/src/commands/verify-command.ts +235 -0
- package/src/commands/worktree-add-command.ts +268 -24
- package/src/commands/worktree-list-command.ts +3 -5
- package/src/commands/worktree-path-rules.ts +183 -0
- package/src/commands/worktree-remove-command.ts +39 -5
- package/src/commands/worktree-repair-command.ts +52 -5
- package/src/commands/worktree-support.ts +22 -1
- package/src/core-commands/add.command.impl.ts +1 -1
- package/src/errors/checkout-errors.ts +29 -0
- package/src/errors/command-errors.ts +2 -1
- package/src/errors/ref-errors.ts +23 -0
- package/src/errors/worktree-errors.ts +8 -1
- package/src/git-command.ts +98 -3
- package/src/git.ts +420 -4
- package/src/remote-config/index.ts +4 -0
- package/src/remote-config/remote-config-store.ts +238 -11
- package/src/rename/detect-renames.ts +5 -1
- package/src/results/clone-result.ts +9 -0
- package/src/results/combined-diff.ts +38 -18
- package/src/results/diff-check.ts +185 -0
- package/src/results/diff-color.ts +868 -0
- package/src/results/diff-output.ts +204 -37
- package/src/results/diff-pickaxe.ts +304 -0
- package/src/results/diff-words.ts +395 -0
- package/src/results/index.ts +4 -0
- package/src/results/init-result.ts +9 -0
- package/src/results/pull-result.ts +5 -0
- package/src/results/push-result.ts +12 -0
- package/src/results/rebase-result.ts +3 -0
- package/src/results/stash-result.ts +7 -0
- package/src/results/status-result.ts +5 -2
- package/src/whitespace/index.ts +1 -0
- package/src/{commands/apply/whitespace.ts → whitespace/whitespace-rule.ts} +173 -23
- package/dist/commands/apply/whitespace.d.ts +0 -58
- package/dist/commands/apply/whitespace.d.ts.map +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git config` as a library command (builtin/config.c): `get`, `set`, `--add`, `unset`,
|
|
3
|
+
* `--replace-all` / `--unset-all` with value patterns, `rename-section` and
|
|
4
|
+
* `remove-section`, on the repository's file or on one scope's.
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* await git.config().set("core.editor", "vim").call();
|
|
8
|
+
* await git.config().add("remote.origin.fetch", "+refs/tags/*:refs/tags/*").call();
|
|
9
|
+
* await git.config().unset("remote.origin.fetch").setValuePattern("tags").call();
|
|
10
|
+
* await git.config().setScope("global").set("user.name", "A U Thor").call();
|
|
11
|
+
* await git.config().renameSection("remote.origin", "remote.upstream").call();
|
|
12
|
+
* const { stdout, exitCode } = await git.config().get("core.bare").call(); // "false\n", 0
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Writes edit the scope's file as git does (`setConfigMultivarInFile`,
|
|
16
|
+
* `renameConfigSectionInFile` of vcs-store-files: under `<file>.lock`, comments, includes and
|
|
17
|
+
* other sections kept byte for byte), and give git's exit status and stderr: 5 for a key to
|
|
18
|
+
* unset that is not there or several values without `setAll`, 1 or 2 for an invalid key, 6
|
|
19
|
+
* for an invalid pattern, 3 for a file whose header git cannot name, 255 for a lock held,
|
|
20
|
+
* 128 where git dies (`no such section`, a bad config line).
|
|
21
|
+
*
|
|
22
|
+
* Reads follow `git config --get`, `--get-all`, `--get-regexp`, `--get-urlmatch`, `--list`,
|
|
23
|
+
* `--get-color` and `--get-colorbool` (and 2.46's `get [--all] [--regexp] [--url=<url>]` and
|
|
24
|
+
* `list`): values canonicalised by {@link ConfigCommand.setType} as builtin/config.c's
|
|
25
|
+
* `format_config` (`--type=bool|int|bool-or-int|bool-or-str|path|expiry-date|color`; `set`
|
|
26
|
+
* writes them as `normalize_value`), `--default`, `--show-origin`, `--show-scope`,
|
|
27
|
+
* `--name-only`, `--show-names`, `-z`, and `--blob=<rev>:<path>`.
|
|
28
|
+
*
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const { stdout } = await git.config().list().setShowOrigin(true).call(); // "file:.git/config\tcore.bare=false\n"
|
|
31
|
+
* await git.config().get("pack.window").setType("int").call(); // "1024\n" for `1k`
|
|
32
|
+
* await git.config().getUrlmatch("http", "https://example.com/repo").call(); // "http.sslverify false\n"
|
|
33
|
+
* await git.config().getRegexp("^remote\\.").setBlob("HEAD:shared.config").call();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
import { GitCommand } from "../git-command.js";
|
|
37
|
+
import { type ConfigValueType } from "./config-value-types.js";
|
|
38
|
+
/** The file `git config` reads or writes: `--local`, `--worktree`, `--global`, `--system`. */
|
|
39
|
+
export type ConfigCommandScope = "local" | "worktree" | "global" | "system";
|
|
40
|
+
/** What {@link ConfigCommand} did. */
|
|
41
|
+
export interface ConfigCommandResult {
|
|
42
|
+
/** git's exit status */
|
|
43
|
+
exitCode: number;
|
|
44
|
+
/** git's stdout: the values `get` prints, one per line */
|
|
45
|
+
stdout: string;
|
|
46
|
+
/** git's stderr: its `warning:`, `error:` and `fatal:` lines */
|
|
47
|
+
stderr: string;
|
|
48
|
+
/** The values `get` found, in order (undefined for a variable without `=`) */
|
|
49
|
+
values?: (string | undefined)[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `git config` on one key or section (see the module comment).
|
|
53
|
+
*
|
|
54
|
+
* The action is one of {@link get}, {@link set}, {@link add}, {@link unset},
|
|
55
|
+
* {@link renameSection}, {@link removeSection}. Without {@link setScope} or {@link setFile}
|
|
56
|
+
* writes go to the repository's `config` and `get` reads the whole configuration (system,
|
|
57
|
+
* global, the repository's, `config.worktree`, the command line, includes followed); with one,
|
|
58
|
+
* only that file is read, its includes not followed, as git does.
|
|
59
|
+
*
|
|
60
|
+
* git's two syntaxes differ only in their messages and refusals: the legacy one (`git config
|
|
61
|
+
* <key> <value> [<value-pattern>]`, `--add`, `--replace-all`, `--unset[-all]`,
|
|
62
|
+
* `--rename-section`, `--remove-section`, `--get[-all]`) with {@link setLegacySyntax}, else
|
|
63
|
+
* git 2.46's subcommands (`git config set [--all] [--value=<pattern>] [--append]`,
|
|
64
|
+
* `unset`, `get`, `rename-section`, `remove-section`).
|
|
65
|
+
*/
|
|
66
|
+
export declare class ConfigCommand extends GitCommand<ConfigCommandResult> {
|
|
67
|
+
/** git's command reads no core settings: an unparsable `core.whitespace` does not stop it */
|
|
68
|
+
protected readsCoreConfig(): boolean;
|
|
69
|
+
private action?;
|
|
70
|
+
private scope?;
|
|
71
|
+
private file?;
|
|
72
|
+
private all;
|
|
73
|
+
private valuePattern?;
|
|
74
|
+
private fixedValue;
|
|
75
|
+
private comment?;
|
|
76
|
+
private defaultValue?;
|
|
77
|
+
private legacy;
|
|
78
|
+
private type?;
|
|
79
|
+
private blob?;
|
|
80
|
+
private includes?;
|
|
81
|
+
private showOrigin;
|
|
82
|
+
private showScope;
|
|
83
|
+
private nameOnly;
|
|
84
|
+
private showNames;
|
|
85
|
+
private nullTerminated;
|
|
86
|
+
private compatibility;
|
|
87
|
+
private dumbTerminal;
|
|
88
|
+
/** git's warnings of a read (a file it cannot open), printed before the values */
|
|
89
|
+
private warnings;
|
|
90
|
+
/** `get <key>` / `--get <key>` (`--get-all` with {@link setAll}). */
|
|
91
|
+
get(key: string): this;
|
|
92
|
+
/**
|
|
93
|
+
* `set <key> <value>` / `<key> <value>`: the key's value replaced (`--all` /
|
|
94
|
+
* `--replace-all` with {@link setAll}; only values matching {@link setValuePattern}).
|
|
95
|
+
*/
|
|
96
|
+
set(key: string, value: string): this;
|
|
97
|
+
/** `set --append <key> <value>` / `--add <key> <value>`: a new line, the old ones kept. */
|
|
98
|
+
add(key: string, value: string): this;
|
|
99
|
+
/** `unset <key>` / `--unset <key>` (`--all` / `--unset-all` with {@link setAll}). */
|
|
100
|
+
unset(key: string): this;
|
|
101
|
+
/** `rename-section <old> <new>` / `--rename-section`: `old` as written in its headers. */
|
|
102
|
+
renameSection(from: string, to: string): this;
|
|
103
|
+
/** `remove-section <name>` / `--remove-section`: every section of that name, whole. */
|
|
104
|
+
removeSection(name: string): this;
|
|
105
|
+
/** `--local`, `--worktree`, `--global`, `--system`: the file read or written. */
|
|
106
|
+
setScope(scope: ConfigCommandScope | undefined): this;
|
|
107
|
+
/**
|
|
108
|
+
* `--get-regexp <pattern>` / `get --regexp <pattern>`: the keys matching a POSIX extended
|
|
109
|
+
* regex (its section and last part lowered, as git does). The legacy syntax prints every
|
|
110
|
+
* value with its key; the subcommand only the last value unless {@link setAll}, with its
|
|
111
|
+
* key under {@link setShowNames}.
|
|
112
|
+
*/
|
|
113
|
+
getRegexp(pattern: string): this;
|
|
114
|
+
/**
|
|
115
|
+
* `--get-urlmatch <name> <url>` / `get --url=<url> <name>`: the value of `<section>.<key>`
|
|
116
|
+
* (or, for a bare section, of each of its keys with the key) that best matches the URL
|
|
117
|
+
* among `<section>.<url-pattern>.<key>` entries (urlmatch.c).
|
|
118
|
+
*/
|
|
119
|
+
getUrlmatch(name: string, url: string): this;
|
|
120
|
+
/** `--list` / `list`: every value, `key=value` per line. */
|
|
121
|
+
list(): this;
|
|
122
|
+
/**
|
|
123
|
+
* `--get-color <slot> [<default>]`: the escape sequence of the color the slot is set to
|
|
124
|
+
* (the default's when unset), with no newline.
|
|
125
|
+
*/
|
|
126
|
+
getColor(slot: string, defaultColor?: string): this;
|
|
127
|
+
/**
|
|
128
|
+
* `--get-colorbool <slot> [<stdout-is-tty>]`: whether color is wanted for the slot (falling
|
|
129
|
+
* back to `diff.color` for `color.diff`, then `color.ui`). With `stdoutIsTty` (a boolean as
|
|
130
|
+
* git reads it) git prints `true`/`false`; without, the exit status tells (stdout is no
|
|
131
|
+
* terminal here). `auto` needs a terminal that is not dumb ({@link setDumbTerminal}).
|
|
132
|
+
*/
|
|
133
|
+
getColorBool(slot: string, stdoutIsTty?: string): this;
|
|
134
|
+
/**
|
|
135
|
+
* `--type=<type>` (`--bool`, `--int`, `--bool-or-int`, `--bool-or-str`, `--path`,
|
|
136
|
+
* `--expiry-date`, `--type=color`): values printed canonical, and written canonical by
|
|
137
|
+
* `set`/`add`. A name git does not know is refused when the command runs (git's
|
|
138
|
+
* `unrecognized --type argument`).
|
|
139
|
+
*/
|
|
140
|
+
setType(type: ConfigValueType | string | undefined): this;
|
|
141
|
+
/** `--blob=<blob-ish>`: read the configuration from a blob (`HEAD:shared.config`). */
|
|
142
|
+
setBlob(blob: string | undefined): this;
|
|
143
|
+
/**
|
|
144
|
+
* `--includes` / `--no-includes` for a file read with {@link setScope} or {@link setFile}
|
|
145
|
+
* (default off there, as git; the whole configuration always follows them).
|
|
146
|
+
*/
|
|
147
|
+
setIncludes(includes: boolean | undefined): this;
|
|
148
|
+
/** `--show-origin`: each value after `file:<name>`, `blob:<name>` or `command line:`. */
|
|
149
|
+
setShowOrigin(show: boolean): this;
|
|
150
|
+
/** `--show-scope`: each value after its scope (`local`, `global`, `command`, ...). */
|
|
151
|
+
setShowScope(show: boolean): this;
|
|
152
|
+
/** `--name-only`: keys without their values (`--list`, `--get-regexp`). */
|
|
153
|
+
setNameOnly(nameOnly: boolean): this;
|
|
154
|
+
/** `--show-names` (2.46's `get`): each value after its key. */
|
|
155
|
+
setShowNames(show: boolean): this;
|
|
156
|
+
/** `-z` / `--null`: values end with NUL, a key and its value separated by a newline. */
|
|
157
|
+
setNullTerminated(nul: boolean): this;
|
|
158
|
+
/**
|
|
159
|
+
* The git version whose behaviour applies where they differ (default 2.56): 2.43's `--list`
|
|
160
|
+
* ignores `--type`, knows no `:(optional)` paths nor `#rgb` colors, and dies on a
|
|
161
|
+
* `--get-color` default it cannot parse (2.5x: an error, exit 255).
|
|
162
|
+
*/
|
|
163
|
+
setCompatibility(version: "2.43" | "2.56"): this;
|
|
164
|
+
/** Whether the terminal is dumb (`TERM` unset or `dumb`): `--get-colorbool`'s `auto`. */
|
|
165
|
+
setDumbTerminal(dumb: boolean): this;
|
|
166
|
+
/**
|
|
167
|
+
* `--file <path>`: an absolute host path (written through the host environment's
|
|
168
|
+
* `hostFilesOf`), or a path relative to the worktree top.
|
|
169
|
+
*/
|
|
170
|
+
setFile(path: string | undefined): this;
|
|
171
|
+
/** `--all` (`--get-all`, `--replace-all`, `--unset-all`): every value matching. */
|
|
172
|
+
setAll(all: boolean): this;
|
|
173
|
+
/**
|
|
174
|
+
* `--value=<pattern>` / the legacy positional `<value-pattern>`: only the values matching it
|
|
175
|
+
* (a POSIX extended regex, `!` first to invert, or the string with {@link setFixedValue}).
|
|
176
|
+
*/
|
|
177
|
+
setValuePattern(pattern: string | undefined): this;
|
|
178
|
+
/** `--fixed-value`: the value pattern is compared as a string. */
|
|
179
|
+
setFixedValue(fixed: boolean): this;
|
|
180
|
+
/** `--comment <text>`: written after the value set or added. */
|
|
181
|
+
setComment(comment: string | undefined): this;
|
|
182
|
+
/** `--default <value>`: what `get` prints when the key has no value. */
|
|
183
|
+
setDefault(value: string | undefined): this;
|
|
184
|
+
/** git's legacy option syntax (`--add`, `--unset-all`, ...): its messages and refusals. */
|
|
185
|
+
setLegacySyntax(legacy: boolean): this;
|
|
186
|
+
private setAction;
|
|
187
|
+
call(): Promise<ConfigCommandResult>;
|
|
188
|
+
private run;
|
|
189
|
+
/** builtin/config.c's `normalize_value` of a value to write, or git's death. */
|
|
190
|
+
private normalized;
|
|
191
|
+
/** The option checks git makes before it reads or writes anything. */
|
|
192
|
+
private checkOptions;
|
|
193
|
+
/** The display options as builtin/config.c's `display_options_init` sets them. */
|
|
194
|
+
private display;
|
|
195
|
+
/** What a value's formatting needs from the host. */
|
|
196
|
+
private valueContext;
|
|
197
|
+
/**
|
|
198
|
+
* builtin/config.c's `format_config`: scope, origin, key and the value as typed, ended
|
|
199
|
+
* with the terminator; a death of git's thrown as a {@link Refusal}.
|
|
200
|
+
*/
|
|
201
|
+
private format;
|
|
202
|
+
/**
|
|
203
|
+
* A value that failed to format while git read the configuration: the read stops with git's
|
|
204
|
+
* `bad config line` (or the command line's) death after the formatter's error.
|
|
205
|
+
*/
|
|
206
|
+
private configReadDeath;
|
|
207
|
+
/** `get` / `--get[-all]` / `--get-regexp`: builtin/config.c's `get_value`. */
|
|
208
|
+
private runGet;
|
|
209
|
+
/** `list` / `--list`: builtin/config.c's `show_all_config` over the whole read. */
|
|
210
|
+
private runList;
|
|
211
|
+
/** `--get-urlmatch` / `get --url=`: builtin/config.c's `get_urlmatch`. */
|
|
212
|
+
private runUrlmatch;
|
|
213
|
+
/** `--get-color`: builtin/config.c's `get_color`. */
|
|
214
|
+
private runGetColor;
|
|
215
|
+
/** `--get-colorbool`: builtin/config.c's `get_colorbool`. */
|
|
216
|
+
private runGetColorBool;
|
|
217
|
+
/**
|
|
218
|
+
* The entries read, in git's order: of the blob, of the scope's file or `--file`, or of the
|
|
219
|
+
* whole configuration. A source `list` cannot read is git's death there; `get` reads it as
|
|
220
|
+
* empty.
|
|
221
|
+
*/
|
|
222
|
+
private readEntries;
|
|
223
|
+
/** `--blob=<blob-ish>`: git's `git_config_from_blob_ref`. */
|
|
224
|
+
private readBlobEntries;
|
|
225
|
+
/** A blob's bytes. */
|
|
226
|
+
private readBlob;
|
|
227
|
+
/** The working copy's configuration, read again after a write (git's `repo_config_clear`). */
|
|
228
|
+
private reloadConfig;
|
|
229
|
+
/** git's `location_options_init`: the file the scope names. */
|
|
230
|
+
private location;
|
|
231
|
+
/** The repository's configuration, which must be backed by files to be edited. */
|
|
232
|
+
private repositoryConfig;
|
|
233
|
+
/** `--file <path>`: a host path, or one relative to the worktree top. */
|
|
234
|
+
private fileLocation;
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=config-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-command.d.ts","sourceRoot":"","sources":["../../src/commands/config-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AA6BH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,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OAAO,CAAC,OAAO;IAUf,qDAAqD;IACrD,OAAO,CAAC,YAAY;IAyBpB;;;OAGG;YACW,MAAM;IA0CpB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAYvB,8EAA8E;YAChE,MAAM;IAyFpB,mFAAmF;YACrE,OAAO;IAoBrB,0EAA0E;YAC5D,WAAW;IA0BzB,qDAAqD;YACvC,WAAW;IAuCzB,6DAA6D;YAC/C,eAAe;IAgC7B;;;;OAIG;YACW,WAAW;IA2FzB,6DAA6D;YAC/C,eAAe;IAgD7B,sBAAsB;YACR,QAAQ;IAkBtB,8FAA8F;YAChF,YAAY;IAK1B,+DAA+D;YACjD,QAAQ;IAmCtB,kFAAkF;IAClF,OAAO,CAAC,gBAAgB;IAQxB,yEAAyE;YAC3D,YAAY;CAa3B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git config --type=<type>` (builtin/config.c `format_config`, `normalize_value`): a config
|
|
3
|
+
* value canonicalised as git prints it on `get` and writes it on `set`.
|
|
4
|
+
*
|
|
5
|
+
* ```typescript
|
|
6
|
+
* await formatConfigValue("int", "pack.window", "1k", source, context); // { ok: "1024" }
|
|
7
|
+
* await formatConfigValue("bool", "core.bare", "yes", source, context); // { ok: "true" }
|
|
8
|
+
* await formatConfigValue("color", "color.diff.old", "red", source, context); // { ok: "\x1b[31m" }
|
|
9
|
+
* normalizeConfigValue("bool-or-int", "x.y", "on"); // "true"
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Where git dies (`bad numeric config value`, `bad boolean config value`) a
|
|
13
|
+
* {@link ConfigValueDeath} is thrown carrying git's lines; where git's formatter returns an
|
|
14
|
+
* error after printing its `error:` line (a path without a value, a date or color it cannot
|
|
15
|
+
* parse), the result is `{ error: [lines] }`; `{ skip: true }` is a value git treats as absent
|
|
16
|
+
* (`:(optional)` naming a missing file, 2.5x). The gentle mode (`git config list --type`,
|
|
17
|
+
* 2.5x) drops values that do not canonicalise without a word, except git's `error:` lines
|
|
18
|
+
* for a path without a value.
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
/** git's `--type` values (`--bool`, `--int`, ... are the same types). */
|
|
23
|
+
export type ConfigValueType = "bool" | "int" | "bool-or-int" | "bool-or-str" | "path" | "expiry-date" | "color";
|
|
24
|
+
/** The types `--type=<type>` names. */
|
|
25
|
+
export declare const CONFIG_VALUE_TYPES: readonly ConfigValueType[];
|
|
26
|
+
/** Where a value was read (git's `key_value_info`), for git's messages. */
|
|
27
|
+
export interface ConfigValueSource {
|
|
28
|
+
/** git's origin type: a file, a blob, the command line (`-c`, `--default`) */
|
|
29
|
+
origin: "file" | "blob" | "command line" | "standard input" | "";
|
|
30
|
+
/** The file or blob as git names it; empty for the command line */
|
|
31
|
+
name: string;
|
|
32
|
+
}
|
|
33
|
+
/** What a value needs from its surroundings. */
|
|
34
|
+
export interface ConfigValueContext {
|
|
35
|
+
/** git's version where the types differ (`:(optional)`, `#rgb` colors: 2.5x) */
|
|
36
|
+
compatibility: "2.43" | "2.56";
|
|
37
|
+
/** `$HOME` for `~/` (undefined: git's "failed to expand user dir") */
|
|
38
|
+
home: string | undefined;
|
|
39
|
+
/** `~user`'s home directory, when the host can tell */
|
|
40
|
+
userHome?: (name: string) => Promise<string | undefined>;
|
|
41
|
+
/** Whether a path names nothing (git's `is_missing_file`), for `:(optional)` */
|
|
42
|
+
isMissing?: (path: string) => Promise<boolean>;
|
|
43
|
+
/** The current time in seconds, for relative expiry dates */
|
|
44
|
+
now: number;
|
|
45
|
+
}
|
|
46
|
+
/** git died: its exit status 128 and its lines. */
|
|
47
|
+
export declare class ConfigValueDeath extends Error {
|
|
48
|
+
readonly lines: string[];
|
|
49
|
+
readonly exitCode = 128;
|
|
50
|
+
constructor(lines: string[]);
|
|
51
|
+
}
|
|
52
|
+
/** A value as git formats it. */
|
|
53
|
+
export type FormattedConfigValue = {
|
|
54
|
+
ok: string;
|
|
55
|
+
} | {
|
|
56
|
+
skip: true;
|
|
57
|
+
} | {
|
|
58
|
+
error: string[];
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* git's `git_parse_signed`: strtoimax (leading whitespace, sign, base 0) and a `k`/`m`/`g`
|
|
62
|
+
* unit; the reason git refuses a value otherwise (errno: `invalid unit` or `out of range`).
|
|
63
|
+
*/
|
|
64
|
+
export declare function parseGitSigned(value: string | undefined, max?: bigint): {
|
|
65
|
+
value: bigint;
|
|
66
|
+
} | {
|
|
67
|
+
reason: "invalid unit" | "out of range";
|
|
68
|
+
};
|
|
69
|
+
/** git's `git_parse_maybe_bool`: the text spellings, else an `int`; -1 when neither. */
|
|
70
|
+
export declare function gitParseMaybeBool(value: string | undefined): number;
|
|
71
|
+
/** git's `git_config_bool`: true/false, or git's death. */
|
|
72
|
+
export declare function gitConfigBool(key: string, value: string | undefined): boolean;
|
|
73
|
+
/** color.c's `color_parse`: the escape sequence, undefined when git cannot parse it. */
|
|
74
|
+
export declare function parseGitColor(value: string, compatibility?: "2.43" | "2.56"): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* builtin/config.c's `format_config` of one value (without the key, origin and scope git
|
|
77
|
+
* prints before it). `gently` is 2.5x's `list --type`.
|
|
78
|
+
*
|
|
79
|
+
* @throws ConfigValueDeath where git dies
|
|
80
|
+
*/
|
|
81
|
+
export declare function formatConfigValue(type: ConfigValueType, key: string, value: string | undefined, source: ConfigValueSource, context: ConfigValueContext, gently?: boolean): Promise<FormattedConfigValue>;
|
|
82
|
+
/**
|
|
83
|
+
* builtin/config.c's `normalize_value`: the value `set` writes under `--type` (paths and
|
|
84
|
+
* dates as given; a color checked but written as given).
|
|
85
|
+
*
|
|
86
|
+
* @throws ConfigValueDeath where git dies
|
|
87
|
+
*/
|
|
88
|
+
export declare function normalizeConfigValue(type: ConfigValueType | undefined, key: string, value: string, compatibility?: "2.43" | "2.56"): string;
|
|
89
|
+
/** color.c's `git_config_colorbool`: never, always, auto, or (from a boolean) never/auto. */
|
|
90
|
+
export declare function gitConfigColorBool(key: string, value: string | undefined): "never" | "always" | "auto";
|
|
91
|
+
//# sourceMappingURL=config-value-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-value-types.d.ts","sourceRoot":"","sources":["../../src/commands/config-value-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,yEAAyE;AACzE,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,KAAK,GACL,aAAa,GACb,aAAa,GACb,MAAM,GACN,aAAa,GACb,OAAO,CAAC;AAEZ,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAQxD,CAAC;AAEF,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,gBAAgB,GAAG,EAAE,CAAC;IACjE,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,sEAAsE;IACtE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACzD,gFAAgF;IAChF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,mDAAmD;AACnD,qBAAa,gBAAiB,SAAQ,KAAK;IAE7B,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE;IADpC,QAAQ,CAAC,QAAQ,OAAO;IACxB,YAAqB,KAAK,EAAE,MAAM,EAAE,EAGnC;CACF;AAED,iCA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AAQ,GAAG,MAAM,CAQ7B"}
|
|
@@ -38,6 +38,26 @@ export declare function configLoadError(workingCopy: WorkingCopy): {
|
|
|
38
38
|
key: string;
|
|
39
39
|
message: string;
|
|
40
40
|
} | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* What git dies with reading `core.whitespace` in `git_default_core_config` (before the
|
|
43
|
+
* command does anything), else undefined: every value is parsed in the configuration's order,
|
|
44
|
+
* so a rule git cannot enforce (`fatal: cannot enforce both tab-in-indent and
|
|
45
|
+
* indent-with-non-tab`) or a variable without `=` (`error: missing value for
|
|
46
|
+
* 'core.whitespace'` and the `bad config variable` line) dies even when a later value
|
|
47
|
+
* replaces it. `git config`, `git remote` and `git ls-remote` read no core settings, and
|
|
48
|
+
* `git bisect` dies only in the checkout it runs.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* // .git/config: [core] whitespace = tab-in-indent,indent-with-non-tab
|
|
53
|
+
* whitespaceConfigError(workingCopy)?.message;
|
|
54
|
+
* // "fatal: cannot enforce both tab-in-indent and indent-with-non-tab"
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function whitespaceConfigError(workingCopy: WorkingCopy): {
|
|
58
|
+
key: string;
|
|
59
|
+
message: string;
|
|
60
|
+
} | undefined;
|
|
41
61
|
/**
|
|
42
62
|
* `id` abbreviated as git prints it (`repo_find_unique_abbrev(id, DEFAULT_ABBREV)`): to
|
|
43
63
|
* `core.abbrev` digits (auto: from the approximate object count, at least 7), lengthened until
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-config.d.ts","sourceRoot":"","sources":["../../src/commands/core-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"core-config.d.ts","sourceRoot":"","sources":["../../src/commands/core-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK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AmE;IACnE,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,uDAAuD;IACvD,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;CACtF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,oBAAyB,GACjC,aAAa,CA+Bf"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { GitHostEnvironment } from "@statewalker/vcs-working-tree";
|
|
2
|
+
/** The initial branch git picks, and the hint it prints with it. */
|
|
3
|
+
export interface DefaultBranch {
|
|
4
|
+
name: string;
|
|
5
|
+
/** git's `advice.defaultBranchName` lines (stderr), when the name is the built-in default */
|
|
6
|
+
hint?: string[];
|
|
7
|
+
}
|
|
8
|
+
/** `init.defaultBranch` names no valid branch: git dies (exit 128). */
|
|
9
|
+
export declare class InvalidDefaultBranchError extends Error {
|
|
10
|
+
readonly value: string;
|
|
11
|
+
name: string;
|
|
12
|
+
readonly lines: string[];
|
|
13
|
+
constructor(value: string);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `init.defaultBranch` without a value (`[init] defaultBranch`): git's config parser dies
|
|
17
|
+
* (`missing value`, then the variable's location), exit 128.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MissingDefaultBranchValueError extends Error {
|
|
20
|
+
name: string;
|
|
21
|
+
readonly lines: string[];
|
|
22
|
+
constructor(file?: string, line?: number);
|
|
23
|
+
}
|
|
24
|
+
/** `--initial-branch` names no valid branch: git dies (exit 128). */
|
|
25
|
+
export declare class InvalidInitialBranchError extends Error {
|
|
26
|
+
readonly value: string;
|
|
27
|
+
name: string;
|
|
28
|
+
readonly lines: string[];
|
|
29
|
+
constructor(value: string);
|
|
30
|
+
}
|
|
31
|
+
/** Whether `name` is a valid branch name (`check_refname_format("refs/heads/<name>")`). */
|
|
32
|
+
export declare function isValidBranchName(name: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The initial branch of a repository created now. Reads the protected configuration (the
|
|
35
|
+
* repository's own does not exist yet); without an environment, nothing is configured.
|
|
36
|
+
*
|
|
37
|
+
* @throws InvalidDefaultBranchError when `init.defaultBranch` names no valid branch (empty too)
|
|
38
|
+
* @throws MissingDefaultBranchValueError when `init.defaultBranch` has no value
|
|
39
|
+
*/
|
|
40
|
+
export declare function defaultInitialBranch(environment: GitHostEnvironment | undefined): Promise<DefaultBranch>;
|
|
41
|
+
/** git's `default_branch_name_advice` (2.5x, or 3.0), as `advise_if_enabled` prints it. */
|
|
42
|
+
export declare function defaultBranchHint(name: string, breakingChanges: boolean | undefined): string[];
|
|
43
|
+
/** A ref storage format git does not know: git dies (exit 128). */
|
|
44
|
+
export declare class UnknownRefFormatError extends Error {
|
|
45
|
+
readonly value: string;
|
|
46
|
+
name: string;
|
|
47
|
+
readonly lines: string[];
|
|
48
|
+
constructor(value: string, source: "command line" | "GIT_DEFAULT_REF_FORMAT");
|
|
49
|
+
}
|
|
50
|
+
/** The ref storage format of a new repository, and git's warnings while choosing it. */
|
|
51
|
+
export interface DefaultRefFormat {
|
|
52
|
+
format: "files" | "reftable";
|
|
53
|
+
warnings: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The ref storage format git gives a new repository (setup.c `repository_format_configure`):
|
|
57
|
+
* `requested` (`git init --ref-format`), else `$GIT_DEFAULT_REF_FORMAT`
|
|
58
|
+
* (`GitHostEnvironment.defaultRefFormat`), else `init.defaultRefFormat` from the system,
|
|
59
|
+
* global and command-line config (`feature.experimental` choosing reftable while that is
|
|
60
|
+
* unset), else `files`, or `reftable` with `GitHostEnvironment.breakingChanges` (git 3.0).
|
|
61
|
+
* An unknown name given or in the environment dies (`UnknownRefFormatError`); one in the
|
|
62
|
+
* config warns and is passed over.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const { format } = await defaultRefFormat(environment); // "reftable" under git 3.0
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function defaultRefFormat(environment: GitHostEnvironment | undefined, requested?: string): Promise<DefaultRefFormat>;
|
|
70
|
+
//# sourceMappingURL=default-branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-branch.d.ts","sourceRoot":"","sources":["../../src/commands/default-branch.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,uEAAuE;AACvE,qBAAa,yBAA0B,SAAQ,KAAK;IAGtC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAFzB,IAAI,SAA+B;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IACzB,YAAqB,KAAK,EAAE,MAAM,EAIjC;CACF;AAED;;;GAGG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;IAC9C,IAAI,SAAoC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAQvC;CACF;AAED,qEAAqE;AACrE,qBAAa,yBAA0B,SAAQ,KAAK;IAGtC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAFzB,IAAI,SAA+B;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IACzB,YAAqB,KAAK,EAAE,MAAM,EAIjC;CACF;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,kBAAkB,GAAG,SAAS,GAC1C,OAAO,CAAC,aAAa,CAAC,CAkBxB;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,EAAE,CAsB9F;AAED,mEAAmE;AACnE,qBAAa,qBAAsB,SAAQ,KAAK;IAI5C,QAAQ,CAAC,KAAK,EAAE,MAAM;IAHf,IAAI,SAA2B;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IACzB,YACW,KAAK,EAAE,MAAM,EACtB,MAAM,EAAE,cAAc,GAAG,wBAAwB,EAQlD;CACF;AAED,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,GAAG,UAAU,CAAC;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAKD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,kBAAkB,GAAG,SAAS,EAC3C,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CA6B3B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The color settings of `git diff`, `log` and `show` as git reads them: `color.ui`,
|
|
3
|
+
* `color.diff` (`diff.color`), `color.diff.<slot>` (`diff.color.<slot>`), `diff.colorMoved`,
|
|
4
|
+
* `diff.colorMovedWS`, `diff.wsErrorHighlight`, `color.decorate.<slot>`, then the command
|
|
5
|
+
* line's `--color`, `--color-moved`, `--color-moved-ws` and `--ws-error-highlight`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const settings = readDiffColorSettings(workingCopy, { color: true, colorMoved: "zebra" });
|
|
10
|
+
* // settings.colors: the palette; settings.colorMoved: "zebra"
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The configuration is read in its order, as git's config callbacks see it, and a value
|
|
14
|
+
* git refuses dies as git dies (`error: invalid color value: <v>`, then where it was read).
|
|
15
|
+
* Without a terminal `auto` means no color: only `always` (or `--color`) colors.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
import type { WorkingCopy } from "@statewalker/vcs-working-tree";
|
|
20
|
+
import { GitApiError } from "../errors/index.js";
|
|
21
|
+
import { type ColorMovedMode, type DiffColors } from "../results/diff-color.js";
|
|
22
|
+
/** The decoration slots of `color.decorate.<slot>` (log-tree.c's `color_decorate_slots`) */
|
|
23
|
+
export interface DecorationColors {
|
|
24
|
+
branch: string;
|
|
25
|
+
remoteBranch: string;
|
|
26
|
+
tag: string;
|
|
27
|
+
stash: string;
|
|
28
|
+
HEAD: string;
|
|
29
|
+
grafted: string;
|
|
30
|
+
reset: string;
|
|
31
|
+
}
|
|
32
|
+
/** log-tree.c's `decoration_colors` */
|
|
33
|
+
export declare const DEFAULT_DECORATION_COLORS: Readonly<DecorationColors>;
|
|
34
|
+
/** What the command line says about colors (each unset: the configuration's) */
|
|
35
|
+
export interface DiffColorOptions {
|
|
36
|
+
/** `--color[=always|never|auto]` (true is `always`), `--no-color` (false) */
|
|
37
|
+
color?: boolean | "always" | "never" | "auto";
|
|
38
|
+
/**
|
|
39
|
+
* `--color-moved[=<mode>]`: true is `--color-moved` alone (`diff.colorMoved` when it names
|
|
40
|
+
* a mode, else `zebra`), false `--no-color-moved`; a mode git does not know throws git's
|
|
41
|
+
* two lines (exit 129)
|
|
42
|
+
*/
|
|
43
|
+
colorMoved?: boolean | string;
|
|
44
|
+
/** `--color-moved-ws=<modes>`, false `--no-color-moved-ws` */
|
|
45
|
+
colorMovedWs?: string | false;
|
|
46
|
+
/** `--ws-error-highlight=<kinds>` */
|
|
47
|
+
wsErrorHighlight?: string;
|
|
48
|
+
/** 2.43 knows no `#rgb` colors (default 2.56) */
|
|
49
|
+
colorCompatibility?: "2.43" | "2.56";
|
|
50
|
+
}
|
|
51
|
+
/** The colors a diff (and a log) prints with */
|
|
52
|
+
export interface DiffColorSettings {
|
|
53
|
+
/** The palette, or undefined for no color */
|
|
54
|
+
colors?: DiffColors;
|
|
55
|
+
/** The decorations' palette (with `colors` only) */
|
|
56
|
+
decorationColors?: DecorationColors;
|
|
57
|
+
colorMoved: ColorMovedMode;
|
|
58
|
+
colorMovedWs: number;
|
|
59
|
+
wsErrorHighlight: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The color settings of a porcelain diff (`git_diff_ui_config` when `uiConfig`, else only
|
|
63
|
+
* the slots of `git_diff_basic_config`), then the command line's.
|
|
64
|
+
*
|
|
65
|
+
* @throws InvalidConfigError for a value git refuses in the configuration (exit 128)
|
|
66
|
+
* @throws InvalidArgumentError for an option git refuses (exit 129)
|
|
67
|
+
*/
|
|
68
|
+
export declare function readDiffColorSettings(workingCopy: WorkingCopy, options: DiffColorOptions & {
|
|
69
|
+
wordDiff?: string;
|
|
70
|
+
}, uiConfig?: boolean): DiffColorSettings;
|
|
71
|
+
/** Throws git's death for a `core.whitespace` git refuses */
|
|
72
|
+
export declare function whitespaceRuleError(message: string): GitApiError;
|
|
73
|
+
//# sourceMappingURL=diff-color-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-color-config.d.ts","sourceRoot":"","sources":["../../src/commands/diff-color-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAA4C,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,UAAU,EAOhB,MAAM,0BAA0B,CAAC;AAIlC,4FAA4F;AAC5F,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,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