@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
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import { type GcResult } from "@statewalker/vcs-store-files";
|
|
1
2
|
import { GitCommand } from "../git-command.js";
|
|
2
3
|
/**
|
|
3
4
|
* Result of garbage collection
|
|
4
5
|
*/
|
|
5
6
|
export interface GCCommandResult {
|
|
6
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Objects the repository no longer stores: distinct object ids (loose or packed) in its own
|
|
9
|
+
* objects directory before the gc, less those after it. 0 without a files backend.
|
|
10
|
+
*/
|
|
7
11
|
objectsRemoved: number;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Bytes freed in the objects directory (loose object files and the pack directory's files),
|
|
14
|
+
* before less after: negative when the gc made it grow (a cruft pack beside packs kept)
|
|
15
|
+
*/
|
|
9
16
|
bytesFreed: number;
|
|
10
17
|
/** Whether refs were packed */
|
|
11
18
|
refsPacked: boolean;
|
|
@@ -18,65 +25,74 @@ export interface GCCommandResult {
|
|
|
18
25
|
worktreesPruned: string[];
|
|
19
26
|
/**
|
|
20
27
|
* `setAuto(true)` only: why nothing was done (git's `gc --auto` returning at once): no
|
|
21
|
-
* housekeeping needed (`not-needed`, gc.auto 0 included),
|
|
22
|
-
* it (`hook`)
|
|
28
|
+
* housekeeping needed (`not-needed`, gc.auto 0 included), the pre-auto-gc hook refused
|
|
29
|
+
* it (`hook`), or another gc holds `gc.pid` (`running`)
|
|
23
30
|
*/
|
|
24
|
-
autoSkipped?: "not-needed" | "hook";
|
|
31
|
+
autoSkipped?: "not-needed" | "hook" | "running";
|
|
25
32
|
/** `setAuto(true)` and run: git's "Auto packing the repository ..." lines (its stderr) */
|
|
26
33
|
messages?: string[];
|
|
27
34
|
/**
|
|
28
35
|
* git's error lines (its stderr): first the alternates' (`alternatesErrors()`, once: git's
|
|
29
36
|
* repack and prune children repeat them), then those while packing refs (also in the hook
|
|
30
37
|
* output): a loose ref whose object is missing stays loose, a ref changed before its prune
|
|
31
|
-
* keeps its loose file
|
|
38
|
+
* keeps its loose file; then the reflog expiry's
|
|
32
39
|
*/
|
|
33
40
|
errors?: string[];
|
|
41
|
+
/** git's warnings (a bitmap not written, `--auto`'s "too many unreachable loose objects") */
|
|
42
|
+
warnings?: string[];
|
|
43
|
+
/**
|
|
44
|
+
* What the store's gc did (repack, prune, reflog expiry, rerere gc, commit-graph), where the
|
|
45
|
+
* repository is a files repository; absent otherwise (only refs and worktrees are handled)
|
|
46
|
+
*/
|
|
47
|
+
details?: GcResult;
|
|
34
48
|
}
|
|
35
49
|
/**
|
|
36
|
-
* Run garbage collection on the repository
|
|
37
|
-
*
|
|
38
|
-
* Equivalent to `git gc`.
|
|
50
|
+
* Run garbage collection on the repository: `git gc`.
|
|
39
51
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* -
|
|
44
|
-
* -
|
|
45
|
-
*
|
|
46
|
-
*
|
|
52
|
+
* Over a files repository it runs what `git gc` runs, in git's order (builtin/gc.c): `pack-refs
|
|
53
|
+
* --all --prune` (`gc.packRefs`), `reflog expire --all` (`gc.reflogExpire*`), `worktree prune
|
|
54
|
+
* --expire <gc.worktreePruneExpire>` and `rerere gc` (`gc.rerereResolved`/`Unresolved`), the
|
|
55
|
+
* repack (`repack -d -l` with `--cruft --cruft-expiration=<gc.pruneExpire>` (`gc.cruftPacks`,
|
|
56
|
+
* default), `-A --unpack-unreachable=<expire>` without cruft packs, or `-a` for `--prune=now`;
|
|
57
|
+
* `--keep-pack` for `--keep-largest-pack`/`gc.bigPackThreshold`; `-f --depth --window` for
|
|
58
|
+
* `--aggressive`; a bitmap in a bare repository), `update-server-info`, `prune --expire
|
|
59
|
+
* <expire>` (with `prune_shallow`), and the commit-graph (`gc.writeCommitGraph`). git 2.43 runs
|
|
60
|
+
* the worktree prune and rerere gc after the prune, 2.5x before the repack: the hook runner's
|
|
61
|
+
* compatibility decides. Without a files repository only refs are packed and worktrees pruned.
|
|
47
62
|
*
|
|
48
63
|
* @example
|
|
49
64
|
* ```typescript
|
|
50
|
-
* // Basic garbage collection
|
|
51
65
|
* const result = await git.gc().call();
|
|
52
66
|
* console.log(`Removed ${result.objectsRemoved} objects`);
|
|
53
67
|
*
|
|
54
|
-
* //
|
|
55
|
-
*
|
|
56
|
-
* .setAggressive(true)
|
|
57
|
-
* .call();
|
|
68
|
+
* // git gc --aggressive --prune=now
|
|
69
|
+
* await git.gc().setAggressive(true).setPrune("now").call();
|
|
58
70
|
*
|
|
59
|
-
* //
|
|
60
|
-
*
|
|
61
|
-
* const result = await git.gc()
|
|
62
|
-
* .setExpire(twoWeeksAgo)
|
|
63
|
-
* .call();
|
|
71
|
+
* // git gc --no-prune
|
|
72
|
+
* await git.gc().setPrune(false).call();
|
|
64
73
|
* ```
|
|
65
74
|
*/
|
|
66
75
|
export declare class GarbageCollectCommand extends GitCommand<GCCommandResult> {
|
|
67
|
-
private _packRefs
|
|
76
|
+
private _packRefs?;
|
|
68
77
|
/** git's fsck and gc read the objects as stored, never through replace refs. */
|
|
69
78
|
protected readsReplacedObjects(): boolean;
|
|
70
79
|
private _aggressive;
|
|
71
80
|
private _expire?;
|
|
81
|
+
private _prune?;
|
|
72
82
|
private _auto;
|
|
83
|
+
private _quiet;
|
|
84
|
+
private _cruft?;
|
|
85
|
+
private _maxCruftSize?;
|
|
86
|
+
private _keepLargestPack?;
|
|
87
|
+
private _force;
|
|
73
88
|
/**
|
|
74
89
|
* `git gc --auto`: housekeeping only when needed (git's `need_to_gc`: more loose objects
|
|
75
90
|
* than `gc.auto`, estimated from `objects/17` as git does, default 6700, or more packs
|
|
76
91
|
* without a `.keep` than `gc.autoPackLimit`, default 50; 0 or less turns either check
|
|
77
92
|
* off, `gc.auto=0` all of auto gc), and only when the pre-auto-gc hook, run first, agrees.
|
|
78
|
-
*
|
|
79
|
-
*
|
|
93
|
+
* With too many packs the repack is a full one, else an incremental one (the reachable loose
|
|
94
|
+
* objects into a new pack). No command runs it by itself: callers decide when (git's
|
|
95
|
+
* `maintenance.auto` after a commit, merge or fetch is not reproduced).
|
|
80
96
|
*
|
|
81
97
|
* @example
|
|
82
98
|
* ```typescript
|
|
@@ -85,42 +101,58 @@ export declare class GarbageCollectCommand extends GitCommand<GCCommandResult> {
|
|
|
85
101
|
* ```
|
|
86
102
|
*/
|
|
87
103
|
setAuto(auto: boolean): this;
|
|
104
|
+
/** `--quiet`: no "Auto packing the repository ..." messages. */
|
|
105
|
+
setQuiet(quiet: boolean): this;
|
|
106
|
+
/**
|
|
107
|
+
* `--prune=<date>` (a git expiry date: `now`, `never`, `2.weeks.ago`, a `Date`), `--prune`
|
|
108
|
+
* (true: `gc.pruneExpire`, default two weeks) or `--no-prune` (false: nothing unreachable
|
|
109
|
+
* expires, `git prune` does not run).
|
|
110
|
+
*/
|
|
111
|
+
setPrune(prune: string | Date | boolean): this;
|
|
112
|
+
/** `--cruft` / `--no-cruft` (default `gc.cruftPacks`, true). */
|
|
113
|
+
setCruft(cruft: boolean): this;
|
|
114
|
+
/** `--max-cruft-size=<bytes>` (default `gc.maxCruftSize`). */
|
|
115
|
+
setMaxCruftSize(bytes: number): this;
|
|
88
116
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
117
|
+
* `--keep-largest-pack` (true) / `--no-keep-largest-pack` (false): the largest non-cruft
|
|
118
|
+
* pack is kept as it is; false also ignores `gc.bigPackThreshold`.
|
|
91
119
|
*/
|
|
120
|
+
setKeepLargestPack(keep: boolean): this;
|
|
121
|
+
/** git's `need_to_gc`: whether `gc --auto` has work to do. */
|
|
92
122
|
private needsAutoGc;
|
|
93
123
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
* `--force`: run even when `gc.pid` says another gc is running (git's `lock_repo_for_gc`
|
|
125
|
+
* with `force`); `gc.pid.lock` must still be free.
|
|
126
|
+
*/
|
|
127
|
+
setForce(force: boolean): this;
|
|
128
|
+
/**
|
|
129
|
+
* `--aggressive`: deltas searched again (`repack -f`) with `gc.aggressiveWindow` (250) and
|
|
130
|
+
* `gc.aggressiveDepth` (50).
|
|
99
131
|
*/
|
|
100
132
|
setAggressive(aggressive: boolean): this;
|
|
101
133
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* When true (default), loose refs are packed into packed-refs.
|
|
105
|
-
*
|
|
106
|
-
* @param packRefs Whether to pack refs
|
|
134
|
+
* Whether to pack refs (`git pack-refs --all --prune`). Default: `gc.packRefs` (true;
|
|
135
|
+
* `notbare` packs them only in a repository with a worktree).
|
|
107
136
|
*/
|
|
108
137
|
setPackRefs(packRefs: boolean): this;
|
|
109
138
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* Objects unreachable but modified after this date will not be deleted.
|
|
113
|
-
* This provides a grace period to prevent deleting objects that might
|
|
114
|
-
* still be needed by in-progress operations.
|
|
115
|
-
*
|
|
116
|
-
* @param expire Expiration date (objects older than this may be deleted)
|
|
139
|
+
* `--prune=<date>`: unreachable objects older than this date expire; younger ones stay
|
|
140
|
+
* (loose, or in a cruft pack) in case a write in progress needs them.
|
|
117
141
|
*/
|
|
118
142
|
setExpire(expire: Date): this;
|
|
143
|
+
/** The repository's files backend: its FilesApi, common git directory and history. */
|
|
144
|
+
private filesRepository;
|
|
145
|
+
/** The prune expiry in milliseconds before now, undefined for the config's. */
|
|
146
|
+
private pruneExpireMs;
|
|
147
|
+
/** `gc.packRefs`: a boolean, or `notbare` (packed unless the repository is bare). */
|
|
148
|
+
private packRefsConfigured;
|
|
119
149
|
/**
|
|
120
150
|
* Execute the garbage collection.
|
|
121
151
|
*
|
|
122
152
|
* @returns GC result with statistics
|
|
123
153
|
*/
|
|
124
154
|
call(): Promise<GCCommandResult>;
|
|
155
|
+
/** git's `unable_to_lock_die` for `gc.pid.lock` (2.43's longer advice under its compatibility). */
|
|
156
|
+
private gcLockFileMessage;
|
|
125
157
|
}
|
|
126
158
|
//# sourceMappingURL=gc-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gc-command.d.ts","sourceRoot":"","sources":["../../src/commands/gc-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gc-command.d.ts","sourceRoot":"","sources":["../../src/commands/gc-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAkC,MAAM,8BAA8B,CAAC;AAK7F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;IAChD,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,qBAAsB,SAAQ,UAAU,CAAC,eAAe,CAAC;IACpE,OAAO,CAAC,SAAS,CAAC,CAAU;IAE5B,gFAAgF;IAChF,UAAmB,oBAAoB,IAAI,OAAO,CAEjD;IACD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAAC,CAAO;IACvB,OAAO,CAAC,MAAM,CAAC,CAAmB;IAClC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO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ER_DATE` give the same timestamps and offsets as native git.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* parseGitDate("1700000000 +0100"); // { timestamp: 1700000000, tzOffset: "+0100" }
|
|
8
|
-
* parseGitDate("@1700000000 +0160"); // { timestamp: 1700000000, tzOffset: "+0200" }
|
|
9
|
-
* parseGitDate("Tue, 14 Nov 2023 23:13:20 +0100"); // { timestamp: 1700000000, tzOffset: "+0100" }
|
|
10
|
-
* parseGitDate("2023-11-14 23:13:20"); // the local time, in its local offset
|
|
11
|
-
* parseGitDate("17000000 +0100"); // undefined: git refuses it
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* The parser walks the text as git does. Words are month names, weekdays, git's zone names,
|
|
15
|
-
* `AM` / `PM` and ISO's `T`; other words are skipped. Numbers are seconds since the epoch
|
|
16
|
-
* (nine digits or more, before any other field), `H:M[:S]` times, `Y-M-D`, `M/D/Y` and
|
|
17
|
-
* `D.M.Y` dates (with git's guesses when a field is out of range), `YYYYMMDD` and
|
|
18
|
-
* `HHMMSS`, four-digit years, offsets written without a sign (`0100`), days, months and
|
|
19
|
-
* two-digit years. `+HHMM`, `+HH:MM` and `+HH` are offsets; one git finds invalid is
|
|
20
|
-
* ignored. The date must fall in 1970..2099, as git's `tm_to_time_t` requires.
|
|
21
|
-
*
|
|
22
|
-
* Without an offset the time is local. Its offset is the one glibc's `mktime` finds with
|
|
23
|
-
* `tm_isdst = -1`: a time in a spring-forward gap keeps the offset before the change, and
|
|
24
|
-
* an ambiguous time takes the offset the search reaches first from UTC.
|
|
25
|
-
*
|
|
26
|
-
* `@<seconds> <+-HHMM>` is git's raw form: the seconds as they are (even 0), the offset's
|
|
27
|
-
* minutes carried into hours (`+0160` is `+0200`).
|
|
28
|
-
*/
|
|
29
|
-
/** A timezone offset in minutes as git writes it (`+HHMM`). */
|
|
30
|
-
export declare function formatOffset(minutes: number): string;
|
|
31
|
-
/**
|
|
32
|
-
* The local timezone offset at `timestamp` (seconds; default now) as git writes it
|
|
33
|
-
* (`+HHMM`): `Date#getTimezoneOffset`, which every JavaScript host has.
|
|
34
|
-
*/
|
|
35
|
-
export declare function localTimezoneOffset(timestamp?: number): string;
|
|
36
|
-
/**
|
|
37
|
-
* A date as git's `parse_date` reads `GIT_AUTHOR_DATE` / `GIT_COMMITTER_DATE`, undefined
|
|
38
|
-
* where git refuses it (`fatal: invalid date format`). See the module comment for the forms.
|
|
39
|
-
*/
|
|
40
|
-
export declare function parseGitDate(text: string): {
|
|
41
|
-
timestamp: number;
|
|
42
|
-
tzOffset: string;
|
|
43
|
-
} | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* git's `approxidate_careful`: a date as `parse_date` reads it, else git's approximate
|
|
46
|
-
* forms (`yesterday`, `2.weeks.ago`, `noon`, `last friday`, `3 hours ago`, `Dec 6`), in
|
|
47
|
-
* local time relative to `now` (seconds, default the current time). `error` is set when
|
|
48
|
-
* nothing in the text was a date (git then rejects `<ref>@{<text>}`).
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* approxidateCareful("1700000000 +0000"); // { timestamp: 1700000000, error: false }
|
|
53
|
-
* approxidateCareful("2.hours.ago"); // { timestamp: now - 7200, error: false }
|
|
54
|
-
* approxidateCareful("blah"); // { error: true, ... }
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare function approxidateCareful(text: string, now?: number): {
|
|
58
|
-
timestamp: number;
|
|
59
|
-
error: boolean;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* A timestamp in git's RFC 2822 date mode (`show_date(..., DATE_RFC2822)`), in the given
|
|
63
|
-
* offset: `Thu, 7 Apr 2005 22:13:13 +0000`.
|
|
64
|
-
*/
|
|
65
|
-
export declare function formatRfc2822Date(timestamp: number, tzOffset: string): string;
|
|
1
|
+
export { approxidateCareful, formatOffset, formatRfc2822Date, localTimezoneOffset, parseGitDate, } from "@statewalker/vcs-utils";
|
|
66
2
|
//# sourceMappingURL=git-date.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-date.d.ts","sourceRoot":"","sources":["../../src/commands/git-date.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git-date.d.ts","sourceRoot":"","sources":["../../src/commands/git-date.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,GACb,MAAM,wBAAwB,CAAC"}
|
|
@@ -24,6 +24,10 @@ export interface DescribeOptions {
|
|
|
24
24
|
match?: readonly string[];
|
|
25
25
|
/** No tags whose name matches one of these globs (`--exclude`) */
|
|
26
26
|
exclude?: readonly string[];
|
|
27
|
+
/** Any ref, not only tags (`--all`): names below `refs/`, an annotated tag as `tags/<name>` */
|
|
28
|
+
all?: boolean;
|
|
29
|
+
/** The abbreviated id when nothing describes the commit (`--always`) */
|
|
30
|
+
always?: boolean;
|
|
27
31
|
}
|
|
28
32
|
/** What {@link createDescriber} reads. */
|
|
29
33
|
export interface DescriberSource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-describe.d.ts","sourceRoot":"","sources":["../../src/commands/git-describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE,kGAAkG;AAClG,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,kEAAkE;IAClE,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"git-describe.d.ts","sourceRoot":"","sources":["../../src/commands/git-describe.ts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AO,EAAE,QAAQ,EAAE,CAAC;YAAC,SAAS,EAAE,WAAW,CAAA;SAAE,GAAG,SAAS,CAAC,CAAC;KAC1F,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,yFAAyF;IACzF,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACxD;AAwCD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe,GACtB,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,MAAM,CAAC,CAQ9D"}
|
|
@@ -209,6 +209,23 @@ export type HookListEntry = ({
|
|
|
209
209
|
/** The script's path as git names it (`.git/hooks/pre-commit`) */
|
|
210
210
|
path: string;
|
|
211
211
|
};
|
|
212
|
+
/**
|
|
213
|
+
* A file of a working copy's common git directory (`remotes/<name>`, `packed-refs`) as the
|
|
214
|
+
* repository's FilesApi names it; undefined when the working copy has no files layout.
|
|
215
|
+
*/
|
|
216
|
+
export declare function commonGitFileOf(workingCopy: WorkingCopy, name: string): Promise<{
|
|
217
|
+
files: FilesApi;
|
|
218
|
+
path: string;
|
|
219
|
+
} | undefined>;
|
|
220
|
+
/**
|
|
221
|
+
* A file of a working copy's own git directory (a linked worktree's `worktrees/<id>/`:
|
|
222
|
+
* `modules/`, which git keeps per worktree) as the repository's FilesApi names it; undefined
|
|
223
|
+
* when the working copy has no files layout.
|
|
224
|
+
*/
|
|
225
|
+
export declare function gitFileOf(workingCopy: WorkingCopy, name: string): Promise<{
|
|
226
|
+
files: FilesApi;
|
|
227
|
+
path: string;
|
|
228
|
+
} | undefined>;
|
|
212
229
|
/**
|
|
213
230
|
* The hooks one command runs, with git's per-process memory of the hints given and the
|
|
214
231
|
* output the hooks wrote (git relays it on its stderr, the hints included).
|
|
@@ -282,6 +299,27 @@ export declare class HookSession {
|
|
|
282
299
|
* hooks run in; as given without a layout.
|
|
283
300
|
*/
|
|
284
301
|
hookPathOf(filesPath: string): Promise<string>;
|
|
302
|
+
/**
|
|
303
|
+
* Runs a shell command git runs for a setting (trailer.c's `apply_command`: `use_shell`,
|
|
304
|
+
* stdin closed, `local_repo_env` unset) in the directory git runs in, through the hook
|
|
305
|
+
* runner: its exit code, stdout and stderr (not kept in {@link output}: the caller places
|
|
306
|
+
* it). Undefined without a runner or a layout (the command is not run); a runner that
|
|
307
|
+
* cannot start it answers as a failure (exit code 1).
|
|
308
|
+
*/
|
|
309
|
+
runShellCommand(name: string, command: string, args?: string[]): Promise<{
|
|
310
|
+
exitCode: number;
|
|
311
|
+
stdout: string;
|
|
312
|
+
stderr: string;
|
|
313
|
+
} | undefined>;
|
|
314
|
+
/**
|
|
315
|
+
* A file a git option names as the repository's FilesApi reaches it: a relative path from
|
|
316
|
+
* the directory git runs in (the worktree top). Undefined without a layout, or for a path
|
|
317
|
+
* outside the FilesApi.
|
|
318
|
+
*/
|
|
319
|
+
fileAt(path: string): Promise<{
|
|
320
|
+
files: FilesApi;
|
|
321
|
+
path: string;
|
|
322
|
+
} | undefined>;
|
|
285
323
|
/**
|
|
286
324
|
* The bytes of a file a git option names (`git hook run --to-stdin=<path>`): a relative
|
|
287
325
|
* path from the directory git runs in (the worktree top, the git directory when bare),
|
|
@@ -299,6 +337,11 @@ export declare class HookSession {
|
|
|
299
337
|
hostGitDir(options?: {
|
|
300
338
|
real?: boolean;
|
|
301
339
|
}): Promise<string | undefined>;
|
|
340
|
+
/**
|
|
341
|
+
* The host directory git runs its child processes in (the worktree top, the git directory
|
|
342
|
+
* when bare), where the repository's files have a host path: a signing program's cwd.
|
|
343
|
+
*/
|
|
344
|
+
hostWorkingDirectory(): Promise<string | undefined>;
|
|
302
345
|
/** Whether `name` exists as an executable hook (git's `hook_exists`), giving no hint. */
|
|
303
346
|
exists(name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@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git grep` (builtin/grep.c over grep.c): lines matching patterns in the worktree's tracked
|
|
3
|
+
* files, the index (`--cached`), untracked files too (`--untracked`), a directory outside
|
|
4
|
+
* git's control (`--no-index`), or trees and revisions.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // git grep -n -e foo --and --not -e bar HEAD -- src
|
|
9
|
+
* const result = await git
|
|
10
|
+
* .grep()
|
|
11
|
+
* .addPattern("foo")
|
|
12
|
+
* .and()
|
|
13
|
+
* .not()
|
|
14
|
+
* .addPattern("bar")
|
|
15
|
+
* .setLineNumber(true)
|
|
16
|
+
* .setArguments(["HEAD", "--", "src"])
|
|
17
|
+
* .call();
|
|
18
|
+
* process.stdout.write(result.output); // HEAD:src/a.c:12:foo()
|
|
19
|
+
* result.exitCode; // 0 when something matched, else 1
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* What it searches, as git does:
|
|
23
|
+
* - The worktree: every regular file of the index (stage 0 once per unmerged path, skip-worktree
|
|
24
|
+
* entries left out), read from disk, or from the index when the entry is assume-unchanged
|
|
25
|
+
* (an intent-to-add or unmerged one then skipped).
|
|
26
|
+
* - `--cached`: the index's blobs. Trees and revisions (`setArguments`, `addRevision`): their
|
|
27
|
+
* files named `<rev>:<path>` (a blob given as `<rev>:<path>` by that name alone); the diff
|
|
28
|
+
* attributes of a commit's files come from the worktree and index, a tree's files have none.
|
|
29
|
+
* - `--untracked` and `--no-index`: the files of the directory (`.git` never entered), ignored
|
|
30
|
+
* ones left out unless `--no-exclude-standard` (the default of `--no-index`); `--no-index`
|
|
31
|
+
* enters nested repositories. Without a repository, {@link grepNoIndex}.
|
|
32
|
+
*
|
|
33
|
+
* Names are relative to the current directory ({@link GrepCommand.setPrefix}) unless
|
|
34
|
+
* `--full-name`/`grep.fullName`, quoted as `core.quotePath` says (not with `-z`). Binary files
|
|
35
|
+
* (a NUL in their first 8000 bytes, or the `diff` attribute's driver) report `Binary file x
|
|
36
|
+
* matches`; `--textconv` runs `diff.<driver>.textconv` through the runner the host installs
|
|
37
|
+
* (`installTextconvRunner`). `-p`/`-W` use the driver's funcname pattern. Configuration:
|
|
38
|
+
* `grep.lineNumber`, `grep.column`, `grep.fullName`, `grep.patternType`,
|
|
39
|
+
* `grep.extendedRegexp`, `grep.threads`, `color.grep`, `color.grep.<slot>`.
|
|
40
|
+
*
|
|
41
|
+
* Output follows git's threaded grep (its default, `GrepEngine`): with context, every source's
|
|
42
|
+
* output after the first starts with `--`. `--recurse-submodules` (or `submodule.recurse`)
|
|
43
|
+
* is refused; `-O`/`--open-files-in-pager` is not offered.
|
|
44
|
+
*
|
|
45
|
+
* @module
|
|
46
|
+
*/
|
|
47
|
+
import { type Worktree } from "@statewalker/vcs-working-tree";
|
|
48
|
+
import { GitCommand } from "../../git-command.js";
|
|
49
|
+
import type { GrepPatternType } from "../rev-filter/index.js";
|
|
50
|
+
import { type GrepBinaryMode, type GrepEngineOptions, type GrepToken } from "./grep-engine.js";
|
|
51
|
+
/** What `git grep` printed and how it ended. */
|
|
52
|
+
export interface GrepResult {
|
|
53
|
+
/** git's exit status: 0 when something matched (`-L`: a file was listed), else 1 */
|
|
54
|
+
exitCode: 0 | 1;
|
|
55
|
+
/** Whether something matched */
|
|
56
|
+
matched: boolean;
|
|
57
|
+
/** git's stdout */
|
|
58
|
+
output: Uint8Array;
|
|
59
|
+
}
|
|
60
|
+
/** Every option of a grep run (what {@link GrepCommand}'s setters set). */
|
|
61
|
+
export interface GrepOptions extends Omit<GrepEngineOptions, "lineNumber" | "column" | "colors" | "patternType"> {
|
|
62
|
+
tokens: GrepToken[];
|
|
63
|
+
/** `-E`/`-F`/`-G`/`-P`; undefined: `grep.patternType`, `grep.extendedRegexp` */
|
|
64
|
+
patternType?: GrepPatternType;
|
|
65
|
+
lineNumber?: boolean;
|
|
66
|
+
column?: boolean;
|
|
67
|
+
/** `--full-name` (undefined: `grep.fullName`) */
|
|
68
|
+
fullName?: boolean;
|
|
69
|
+
/** `--color[=<when>]` (undefined: `color.grep`, `color.ui`; `auto` is off here) */
|
|
70
|
+
color?: boolean;
|
|
71
|
+
cached?: boolean;
|
|
72
|
+
untracked?: boolean;
|
|
73
|
+
noIndex?: boolean;
|
|
74
|
+
/** `--[no-]exclude-standard` */
|
|
75
|
+
excludeStandard?: boolean;
|
|
76
|
+
/** `--max-depth` (-1: none) */
|
|
77
|
+
maxDepth?: number;
|
|
78
|
+
/** `--textconv` */
|
|
79
|
+
textconv?: boolean;
|
|
80
|
+
/** `--recurse-submodules` */
|
|
81
|
+
recurseSubmodules?: boolean;
|
|
82
|
+
/** The current directory below the top (`sub/`), git's prefix */
|
|
83
|
+
prefix?: string;
|
|
84
|
+
/** The revision and path arguments, as given after the pattern */
|
|
85
|
+
args?: string[];
|
|
86
|
+
}
|
|
87
|
+
/** Setters shared by the command and {@link GrepNoIndex} */
|
|
88
|
+
interface GrepSetters {
|
|
89
|
+
readonly options: GrepOptions;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* `git grep`. Patterns: {@link addPattern} (`-e`), {@link addPatternFile} (`-f`), with
|
|
93
|
+
* {@link and}, {@link not}, {@link open}, {@link close} between them (`--or` is the default).
|
|
94
|
+
* Where to search: {@link setArguments} (`[<rev>...] [[--] <path>...]` as git reads them),
|
|
95
|
+
* {@link setCached}, {@link setUntracked}, {@link setNoIndex}. {@link call} resolves with
|
|
96
|
+
* git's stdout and exit status, or throws `GrepError`/`GrepPatternError`/`RevisionError` with
|
|
97
|
+
* git's line where it dies (exit status 128).
|
|
98
|
+
*/
|
|
99
|
+
export declare class GrepCommand extends GitCommand<GrepResult> implements GrepSetters {
|
|
100
|
+
readonly options: GrepOptions;
|
|
101
|
+
private set;
|
|
102
|
+
/** `-e <pattern>` (a string is taken as UTF-8) */
|
|
103
|
+
addPattern(pattern: string | Uint8Array, origin?: string): this;
|
|
104
|
+
/** `-f <file>`: the file's content, one pattern per non-empty line; `name` as given */
|
|
105
|
+
addPatternFile(content: string | Uint8Array, name: string): this;
|
|
106
|
+
/** `--and` */
|
|
107
|
+
and(): this;
|
|
108
|
+
/** `--not` */
|
|
109
|
+
not(): this;
|
|
110
|
+
/** `(` */
|
|
111
|
+
open(): this;
|
|
112
|
+
/** `)` */
|
|
113
|
+
close(): this;
|
|
114
|
+
private token;
|
|
115
|
+
/** `--all-match` */
|
|
116
|
+
setAllMatch(on: boolean): this;
|
|
117
|
+
/** `-E` (`extended`), `-F` (`fixed`), `-G` (`basic`), `-P` (`perl`) */
|
|
118
|
+
setPatternType(type: GrepPatternType | undefined): this;
|
|
119
|
+
/** `-i` */
|
|
120
|
+
setIgnoreCase(on: boolean): this;
|
|
121
|
+
/** `-w` */
|
|
122
|
+
setWordRegexp(on: boolean): this;
|
|
123
|
+
/** `-v` */
|
|
124
|
+
setInvertMatch(on: boolean): this;
|
|
125
|
+
/** `--cached` */
|
|
126
|
+
setCached(on: boolean): this;
|
|
127
|
+
/** `--untracked` */
|
|
128
|
+
setUntracked(on: boolean): this;
|
|
129
|
+
/** `--no-index` */
|
|
130
|
+
setNoIndex(on: boolean): this;
|
|
131
|
+
/** `--exclude-standard` (true) / `--no-exclude-standard` (false) */
|
|
132
|
+
setExcludeStandard(on: boolean | undefined): this;
|
|
133
|
+
/** `--recurse-submodules`: refused (not supported yet) */
|
|
134
|
+
setRecurseSubmodules(on: boolean): this;
|
|
135
|
+
/**
|
|
136
|
+
* The arguments after the pattern: revisions, then paths (`--` between them), checked as
|
|
137
|
+
* git checks them (a path must exist without `--`, a revision must not also be a file)
|
|
138
|
+
*/
|
|
139
|
+
setArguments(args: string[]): this;
|
|
140
|
+
/** A revision or tree to search (`<rev>`, `<rev>:<path>`, a tree id) */
|
|
141
|
+
addRevision(revision: string): this;
|
|
142
|
+
/** Pathspecs (`-- <path>...`) */
|
|
143
|
+
addPath(...paths: string[]): this;
|
|
144
|
+
/** The current directory below the top (`sub/` or `sub`): names are relative to it */
|
|
145
|
+
setPrefix(prefix: string): this;
|
|
146
|
+
/** `--max-depth <n>` (-1: none) */
|
|
147
|
+
setMaxDepth(depth: number): this;
|
|
148
|
+
/** `-n` / `--no-line-number` (undefined: `grep.lineNumber`) */
|
|
149
|
+
setLineNumber(on: boolean | undefined): this;
|
|
150
|
+
/** `--column` (undefined: `grep.column`) */
|
|
151
|
+
setColumn(on: boolean | undefined): this;
|
|
152
|
+
/** `-H` (true) / `-h` (false) */
|
|
153
|
+
setShowFilename(on: boolean): this;
|
|
154
|
+
/** `--full-name` (undefined: `grep.fullName`) */
|
|
155
|
+
setFullName(on: boolean | undefined): this;
|
|
156
|
+
/** `-z` */
|
|
157
|
+
setNull(on: boolean): this;
|
|
158
|
+
/** `-o` */
|
|
159
|
+
setOnlyMatching(on: boolean): this;
|
|
160
|
+
/** `-c` */
|
|
161
|
+
setCount(on: boolean): this;
|
|
162
|
+
/** `-l` */
|
|
163
|
+
setFilesWithMatches(on: boolean): this;
|
|
164
|
+
/** `-L` */
|
|
165
|
+
setFilesWithoutMatch(on: boolean): this;
|
|
166
|
+
/** `-q` */
|
|
167
|
+
setQuiet(on: boolean): this;
|
|
168
|
+
/** `--break` */
|
|
169
|
+
setBreak(on: boolean): this;
|
|
170
|
+
/** `--heading` */
|
|
171
|
+
setHeading(on: boolean): this;
|
|
172
|
+
/** `-B <n>` */
|
|
173
|
+
setBeforeContext(n: number): this;
|
|
174
|
+
/** `-A <n>` */
|
|
175
|
+
setAfterContext(n: number): this;
|
|
176
|
+
/** `-C <n>` */
|
|
177
|
+
setContext(n: number): this;
|
|
178
|
+
/** `-p` */
|
|
179
|
+
setShowFunction(on: boolean): this;
|
|
180
|
+
/** `-W` */
|
|
181
|
+
setFunctionContext(on: boolean): this;
|
|
182
|
+
/** `-m <n>` (negative: no limit) */
|
|
183
|
+
setMaxCount(n: number): this;
|
|
184
|
+
/** `-a` (`text`), `-I` (`nomatch`) */
|
|
185
|
+
setBinary(mode: GrepBinaryMode): this;
|
|
186
|
+
/** `--textconv` / `--no-textconv` */
|
|
187
|
+
setTextconv(on: boolean): this;
|
|
188
|
+
/** `--color=always` (true), `--no-color` (false); undefined: `color.grep`/`color.ui` */
|
|
189
|
+
setColor(on: boolean | undefined): this;
|
|
190
|
+
/**
|
|
191
|
+
* `--threads <n>`: 1 prints as git's single-threaded grep, more (the default) as its
|
|
192
|
+
* threaded one (a hunk mark before each file's context, the first output's first line
|
|
193
|
+
* dropped)
|
|
194
|
+
*/
|
|
195
|
+
setThreads(n: number): this;
|
|
196
|
+
/** The git version to follow (`2.43` or `2.56`, the default); see `GrepEngineOptions` */
|
|
197
|
+
setCompatibility(compatibility: "2.43" | "2.56"): this;
|
|
198
|
+
call(): Promise<GrepResult>;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* `git grep --no-index` outside a repository: the files of `worktree` (any `Worktree`, a
|
|
202
|
+
* `FileWorktree` over the directory), read as git reads them without a repository. Options
|
|
203
|
+
* are {@link GrepOptions} (`prefix` the current directory below `worktree`'s root);
|
|
204
|
+
* `config` gives configuration values (the global and system files', if any).
|
|
205
|
+
*/
|
|
206
|
+
export declare function grepNoIndex(worktree: Worktree, options: Partial<GrepOptions> & {
|
|
207
|
+
tokens: GrepToken[];
|
|
208
|
+
}, config?: (key: string) => string | undefined): Promise<GrepResult>;
|
|
209
|
+
export {};
|
|
210
|
+
//# sourceMappingURL=grep-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grep-command.d.ts","sourceRoot":"","sources":["../../../src/commands/grep/grep-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAOH,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAMlD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,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