@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,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's ref-filter.c, the part that chooses and orders refs: kinds, name patterns (as paths
|
|
3
|
+
* for `for-each-ref`, after the `refs/<kind>/` prefix for `branch -l`/`tag -l`), `--exclude`,
|
|
4
|
+
* `--points-at`, `--contains`/`--no-contains`, `--merged`/`--no-merged`, `--start-after`,
|
|
5
|
+
* and the sort keys (several, `-` reversed, `version:` with `versionsort.suffix`). The
|
|
6
|
+
* listing commands share it: `for-each-ref` today, the branch and tag listings next.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const format = new RefFormat("%(refname:short)", formatSource);
|
|
11
|
+
* const sorting = parseRefSorting(["-committerdate"], format);
|
|
12
|
+
* const { lines } = await filterAndFormatRefs(filterSource, { kind: RefKind.REGULAR }, sorting, format);
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import type { ObjectId } from "@statewalker/vcs-core";
|
|
18
|
+
import { type RefFilterItem, type RefFormat, type RefFormatObject } from "./ref-format.js";
|
|
19
|
+
/** A ref as the store lists it. */
|
|
20
|
+
export interface ListedRef {
|
|
21
|
+
name: string;
|
|
22
|
+
/** What it resolves to; undefined for a broken ref (a dangling symbolic ref) */
|
|
23
|
+
objectId?: ObjectId;
|
|
24
|
+
/** A symbolic ref's target */
|
|
25
|
+
symref?: string;
|
|
26
|
+
/** Read from packed-refs */
|
|
27
|
+
packed?: boolean;
|
|
28
|
+
/** What it peels to, when known */
|
|
29
|
+
peeledId?: ObjectId;
|
|
30
|
+
}
|
|
31
|
+
/** What the filter reads of the repository. */
|
|
32
|
+
export interface RefFilterSource {
|
|
33
|
+
/** Every ref under `refs/`, in name order */
|
|
34
|
+
listRefs(): Promise<ListedRef[]>;
|
|
35
|
+
/** HEAD and the root refs (`ORIG_HEAD`, ...), for `--include-root-refs` */
|
|
36
|
+
listRootRefs(): Promise<ListedRef[]>;
|
|
37
|
+
/** HEAD alone, for a listing of the detached HEAD (`branch` with `FILTER_REFS_DETACHED_HEAD`) */
|
|
38
|
+
head(): Promise<ListedRef | undefined>;
|
|
39
|
+
/** The object, through replace refs */
|
|
40
|
+
readObject(id: ObjectId): Promise<RefFormatObject | undefined>;
|
|
41
|
+
/** Whether `ancestor` is reachable from `descendant` (the commit-graph used where there is one) */
|
|
42
|
+
isAncestor(ancestor: ObjectId, descendant: ObjectId): Promise<boolean>;
|
|
43
|
+
/** A commit's parents and committer date, undefined when it is missing */
|
|
44
|
+
commitHeader(id: ObjectId): Promise<{
|
|
45
|
+
parents: ObjectId[];
|
|
46
|
+
date: number;
|
|
47
|
+
} | undefined>;
|
|
48
|
+
/** The commits only `ours` and only `theirs` reach */
|
|
49
|
+
aheadBehind(ours: ObjectId, theirs: ObjectId): Promise<{
|
|
50
|
+
ahead: number;
|
|
51
|
+
behind: number;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* `lookup_commit_reference_by_name`: the commit a name peels to, undefined when none; git's
|
|
55
|
+
* messages on the way (`warning: refname 'x' is ambiguous.`, `error: object ... is a
|
|
56
|
+
* blob, not a commit`) added to `warnings` unless `quiet`
|
|
57
|
+
*/
|
|
58
|
+
commitByName(name: string, warnings?: string[], quiet?: boolean): Promise<ObjectId | undefined>;
|
|
59
|
+
/** Every value of a configuration key, in order */
|
|
60
|
+
configValues(key: string): string[];
|
|
61
|
+
/** Whether a value of the key is missing (`[section] key` without `=`) */
|
|
62
|
+
configMissingValue?(key: string): boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Which refs a listing keeps (git's `struct ref_filter`). */
|
|
65
|
+
export interface RefFilterOptions {
|
|
66
|
+
/** The {@link RefKind}s listed */
|
|
67
|
+
kind: number;
|
|
68
|
+
/** Name patterns (any matches); none: every ref */
|
|
69
|
+
patterns?: readonly string[];
|
|
70
|
+
/** Patterns match full names as paths (`for-each-ref`), else after `refs/<kind>/` (`branch`, `tag`) */
|
|
71
|
+
matchAsPath?: boolean;
|
|
72
|
+
/** `--ignore-case`: patterns match without case */
|
|
73
|
+
ignoreCase?: boolean;
|
|
74
|
+
/** `--exclude`: refs matching any of these are left out */
|
|
75
|
+
exclude?: readonly string[];
|
|
76
|
+
/** `--points-at`: refs naming one of these objects, directly or through tags */
|
|
77
|
+
pointsAt?: readonly ObjectId[];
|
|
78
|
+
/** `--contains`: refs whose commit reaches one of these */
|
|
79
|
+
contains?: readonly ObjectId[];
|
|
80
|
+
/** `--no-contains`: refs whose commit reaches none of these */
|
|
81
|
+
noContains?: readonly ObjectId[];
|
|
82
|
+
/** `--merged`: refs whose commit one of these reaches */
|
|
83
|
+
merged?: readonly ObjectId[];
|
|
84
|
+
/** `--no-merged`: refs whose commit none of these reaches */
|
|
85
|
+
noMerged?: readonly ObjectId[];
|
|
86
|
+
/** `--start-after`: refs sorting after this name only */
|
|
87
|
+
startAfter?: string;
|
|
88
|
+
/** Only refs naming a commit (`branch -v`: git's `filter->verbose`) */
|
|
89
|
+
needCommit?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** A sort key (git's `struct ref_sorting`). */
|
|
92
|
+
export interface RefSortKey {
|
|
93
|
+
/** The atom's index in the format */
|
|
94
|
+
atom: number;
|
|
95
|
+
reverse?: boolean;
|
|
96
|
+
/** `version:` / `v:` */
|
|
97
|
+
version?: boolean;
|
|
98
|
+
/** `--ignore-case` */
|
|
99
|
+
icase?: boolean;
|
|
100
|
+
/** The detached HEAD first (`branch`'s listing) */
|
|
101
|
+
detachedHeadFirst?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/** Byte order of two texts (strcmp). */
|
|
104
|
+
export declare function compareBytes(a: string, b: string): number;
|
|
105
|
+
/** ref_kind_from_refname. */
|
|
106
|
+
export declare function refKindOf(name: string): number;
|
|
107
|
+
/** refs.c's is_root_ref. */
|
|
108
|
+
export declare function isRootRef(name: string): boolean;
|
|
109
|
+
/** The result of {@link filterRefs}. */
|
|
110
|
+
export interface FilteredRefs {
|
|
111
|
+
items: RefFilterItem[];
|
|
112
|
+
/** git's warnings (`warning: ignoring broken ref ...`) */
|
|
113
|
+
warnings: string[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* filter_refs: the refs of the wanted kinds that pass every filter, in the store's name
|
|
117
|
+
* order (`--merged`/`--no-merged` applied last, as git's reach_filter).
|
|
118
|
+
*
|
|
119
|
+
* @throws RefFilterError where git dies
|
|
120
|
+
*/
|
|
121
|
+
export declare function filterRefs(source: RefFilterSource, filter: RefFilterOptions): Promise<FilteredRefs>;
|
|
122
|
+
/**
|
|
123
|
+
* parse_ref_sorting over the keys as given on the command line (`--sort` in order): the
|
|
124
|
+
* last becomes the primary key, as git's.
|
|
125
|
+
*
|
|
126
|
+
* @throws RefFilterError for a key the format language refuses
|
|
127
|
+
*/
|
|
128
|
+
export declare function parseRefSorting(keys: readonly string[], format: RefFormat): RefSortKey[];
|
|
129
|
+
/**
|
|
130
|
+
* ref_array_sort: `items` sorted in place by the keys (primary first), ties by refname.
|
|
131
|
+
*
|
|
132
|
+
* @throws RefFilterError where a sort key's value cannot be computed
|
|
133
|
+
*/
|
|
134
|
+
export declare function sortRefs(items: RefFilterItem[], sorting: readonly RefSortKey[], format: RefFormat, source: RefFilterSource, warnings?: string[]): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* filter_ahead_behind: each `%(ahead-behind:<base>)` count of every ref that names a
|
|
137
|
+
* commit, `bases` resolved in the order the atoms come in the format.
|
|
138
|
+
*/
|
|
139
|
+
export declare function fillAheadBehind(items: RefFilterItem[], bases: readonly ObjectId[], source: RefFilterSource, warnings?: string[]): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* filter_is_base: for each `%(is-base:<tip>)`, the ref (among those naming commits) whose
|
|
142
|
+
* commit is the base of `tip`'s branch (commit-reach.c's get_branch_base_for_tip).
|
|
143
|
+
*/
|
|
144
|
+
export declare function fillIsBase(items: RefFilterItem[], tips: readonly {
|
|
145
|
+
name: string;
|
|
146
|
+
commit: ObjectId;
|
|
147
|
+
}[], source: RefFilterSource): Promise<void>;
|
|
148
|
+
/** What {@link filterAndFormatRefs} prints. */
|
|
149
|
+
export interface FormatRefsOptions {
|
|
150
|
+
/** `--count`: at most this many refs (0: all) */
|
|
151
|
+
count?: number;
|
|
152
|
+
/** `--omit-empty`: no line for a ref whose format expands to nothing */
|
|
153
|
+
omitEmpty?: boolean;
|
|
154
|
+
}
|
|
155
|
+
/** The output of {@link filterAndFormatRefs}. */
|
|
156
|
+
export interface FormattedRefs {
|
|
157
|
+
/** The refs shown, in order */
|
|
158
|
+
items: RefFilterItem[];
|
|
159
|
+
/** Each shown ref's expanded format, in order (an omitted empty one left out) */
|
|
160
|
+
lines: string[];
|
|
161
|
+
/** git's stdout: each line and its newline */
|
|
162
|
+
output: string;
|
|
163
|
+
warnings: string[];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* filter_and_format_refs: the refs filtered, their `%(ahead-behind)` and `%(is-base)`
|
|
167
|
+
* values computed, sorted, cut to `count`, and formatted.
|
|
168
|
+
*
|
|
169
|
+
* @throws RefFilterError where git dies
|
|
170
|
+
*/
|
|
171
|
+
export declare function filterAndFormatRefs(source: RefFilterSource, filter: RefFilterOptions, sorting: readonly RefSortKey[], format: RefFormat, options?: FormatRefsOptions & {
|
|
172
|
+
aheadBehindBases?: readonly ObjectId[];
|
|
173
|
+
isBaseTips?: readonly {
|
|
174
|
+
name: string;
|
|
175
|
+
commit: ObjectId;
|
|
176
|
+
}[];
|
|
177
|
+
}): Promise<FormattedRefs>;
|
|
178
|
+
//# sourceMappingURL=ref-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-filter.d.ts","sourceRoot":"","sources":["../../../src/commands/ref-filter/ref-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC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SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,EAAE,EACnD,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAkBf;AAsGD,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,iFAAiF;IACjF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,iBAAiB,GAAG;IAC3B,gBAAgB,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,CAAA;KAAE,EAAE,CAAC;CACvD,GACL,OAAO,CAAC,aAAa,CAAC,CAiBxB"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The format language of git's ref-filter.c: a format's atoms parsed once, each ref's values
|
|
3
|
+
* computed when first needed (its object read only if an atom needs it), and the format
|
|
4
|
+
* expanded with `%(if)`/`%(then)`/`%(else)`, `%(align)` and the quoting styles, byte for byte
|
|
5
|
+
* as `git for-each-ref --format` prints it.
|
|
6
|
+
*
|
|
7
|
+
* Values are text as vcs-utils' `decodeGitPath` gives bytes (UTF-8, other bytes as U+DC80 +
|
|
8
|
+
* byte), so `encodeGitPath` of the output is git's bytes.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const format = new RefFormat("%(refname:short) %(objectname:short)", source);
|
|
13
|
+
* const line = await format.format(item); // "main 1a2b3c4"
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
import type { ObjectId } from "@statewalker/vcs-core";
|
|
19
|
+
import { type ShowDateContext } from "../date-format.js";
|
|
20
|
+
import type { Mailmap } from "../mailmap.js";
|
|
21
|
+
import { type TrailerConfig } from "../trailers.js";
|
|
22
|
+
import { type AtomCmpType, type UsedAtom } from "./ref-atoms.js";
|
|
23
|
+
import { type RefQuoteStyle } from "./ref-quote.js";
|
|
24
|
+
/** The kinds of refs (ref-filter.h's `FILTER_REFS_*`). */
|
|
25
|
+
export declare const RefKind: {
|
|
26
|
+
readonly TAGS: 2;
|
|
27
|
+
readonly BRANCHES: 4;
|
|
28
|
+
readonly REMOTES: 8;
|
|
29
|
+
readonly OTHERS: 16;
|
|
30
|
+
readonly REGULAR: 30;
|
|
31
|
+
readonly DETACHED_HEAD: 32;
|
|
32
|
+
readonly PSEUDOREFS: 64;
|
|
33
|
+
readonly ROOT_REFS: 128;
|
|
34
|
+
};
|
|
35
|
+
/** A ref the filter kept (git's `struct ref_array_item`). */
|
|
36
|
+
export interface RefFilterItem {
|
|
37
|
+
/** The full name (`refs/heads/main`, `HEAD`) */
|
|
38
|
+
refname: string;
|
|
39
|
+
/** The object it names (a symbolic ref's target's) */
|
|
40
|
+
objectId: ObjectId;
|
|
41
|
+
/** What it peels to, when the ref store knows (packed-refs `^` lines) */
|
|
42
|
+
peeledId?: ObjectId;
|
|
43
|
+
/** A symbolic ref's target */
|
|
44
|
+
symref?: string;
|
|
45
|
+
/** git's REF_ISSYMREF / REF_ISPACKED */
|
|
46
|
+
flags: {
|
|
47
|
+
symref: boolean;
|
|
48
|
+
packed: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Its {@link RefKind} */
|
|
51
|
+
kind: number;
|
|
52
|
+
/** The commit it peels to, when a reachability filter asked for it */
|
|
53
|
+
commit?: ObjectId;
|
|
54
|
+
/** `%(rest)`'s text (none for for-each-ref) */
|
|
55
|
+
rest?: string;
|
|
56
|
+
/** `%(ahead-behind:...)` counts, one per such atom, for a ref that peels to a commit */
|
|
57
|
+
counts?: {
|
|
58
|
+
ahead: number;
|
|
59
|
+
behind: number;
|
|
60
|
+
}[];
|
|
61
|
+
/** `%(is-base:...)` names, one per such atom */
|
|
62
|
+
isBase?: (string | undefined)[];
|
|
63
|
+
/** The values of the format's atoms, once computed */
|
|
64
|
+
values?: AtomValue[];
|
|
65
|
+
}
|
|
66
|
+
/** A computed atom value (git's `struct atom_value`). */
|
|
67
|
+
export interface AtomValue {
|
|
68
|
+
s: string;
|
|
69
|
+
/** The value has a length of its own (`%(raw)`: NULs kept) */
|
|
70
|
+
sized?: boolean;
|
|
71
|
+
/** The number sorted on for numeric and date atoms */
|
|
72
|
+
value: number;
|
|
73
|
+
atom: UsedAtom;
|
|
74
|
+
}
|
|
75
|
+
/** An object as the format reads it. */
|
|
76
|
+
export interface RefFormatObject {
|
|
77
|
+
type: "commit" | "tree" | "blob" | "tag";
|
|
78
|
+
bytes: Uint8Array;
|
|
79
|
+
}
|
|
80
|
+
/** What the format reads of the repository; see {@link RefFormat}. */
|
|
81
|
+
export interface RefFormatSource {
|
|
82
|
+
/** The object (its replacement when a replace ref names one), undefined when missing */
|
|
83
|
+
readObject(id: ObjectId): Promise<RefFormatObject | undefined>;
|
|
84
|
+
/** `id` abbreviated as git prints it: its default length, or at least `minLength` */
|
|
85
|
+
abbreviate(id: ObjectId, minLength?: number): Promise<string>;
|
|
86
|
+
/** Whether a ref of this full name exists */
|
|
87
|
+
refExists(name: string): Promise<boolean>;
|
|
88
|
+
/** A configuration value (the last one) */
|
|
89
|
+
config(key: string): string | undefined;
|
|
90
|
+
/** The ref HEAD resolves to (`HEAD` when detached), undefined when unborn */
|
|
91
|
+
headRef(): Promise<string | undefined>;
|
|
92
|
+
/** `branch@{upstream}`'s full ref name, undefined when none */
|
|
93
|
+
upstreamOf(branch: string): Promise<string | undefined>;
|
|
94
|
+
/** `branch@{push}`'s full ref name, undefined when none */
|
|
95
|
+
pushOf(branch: string): Promise<string | undefined>;
|
|
96
|
+
/** `remote_for_branch` / `pushremote_for_branch` when configured (explicit), else "" */
|
|
97
|
+
remoteName(branch: string, push: boolean): string;
|
|
98
|
+
/** `remote_ref_for_branch`: the merge source, or the push refspec's destination */
|
|
99
|
+
remoteRef(branch: string, push: boolean): string | undefined;
|
|
100
|
+
/** The commit a ref names (tags peeled), undefined when it names none */
|
|
101
|
+
refCommit(ref: string): Promise<ObjectId | undefined>;
|
|
102
|
+
/** The commits only `ours` and only `theirs` reach */
|
|
103
|
+
aheadBehind(ours: ObjectId, theirs: ObjectId): Promise<{
|
|
104
|
+
ahead: number;
|
|
105
|
+
behind: number;
|
|
106
|
+
}>;
|
|
107
|
+
/** The worktree a branch is checked out in, undefined when none */
|
|
108
|
+
worktreePath(ref: string): Promise<string | undefined>;
|
|
109
|
+
/** The repository's mailmap */
|
|
110
|
+
mailmap(): Promise<Mailmap>;
|
|
111
|
+
/** `git describe <args> <id>`'s output, "" when it fails */
|
|
112
|
+
describe(id: ObjectId, options: NonNullable<UsedAtom["describe"]>): Promise<string>;
|
|
113
|
+
/** The trailer configuration */
|
|
114
|
+
trailerConfig(): TrailerConfig;
|
|
115
|
+
/** get_head_description: `(HEAD detached at ...)` for a detached HEAD listed as such */
|
|
116
|
+
headDescription?(): Promise<string>;
|
|
117
|
+
/** The clock and local zone dates are shown with */
|
|
118
|
+
dateContext?: ShowDateContext;
|
|
119
|
+
}
|
|
120
|
+
/** How {@link RefFormat} expands its format. */
|
|
121
|
+
export interface RefFormatOptions {
|
|
122
|
+
/** `--shell`, `--perl`, `--python`, `--tcl` */
|
|
123
|
+
quoteStyle?: RefQuoteStyle;
|
|
124
|
+
/** `--color`: `%(color:...)` atoms give their escapes */
|
|
125
|
+
useColor?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* The git version whose output to follow where versions differ (default 2.56). git 2.43's
|
|
128
|
+
* `%(*atom)` reads the object a tag names (a tag of a tag shows the inner tag), not what
|
|
129
|
+
* nested tags peel to, and its `%(trailers)` look for the trailer block in the message with
|
|
130
|
+
* its signature (a signed tag's trailers are not found), and a date atom with a format
|
|
131
|
+
* still sorts by time.
|
|
132
|
+
*/
|
|
133
|
+
compatibility?: "2.43" | "2.56";
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* refs.c's `refs_shorten_unambiguous_ref`: the shortest name a rule maps back to `ref`
|
|
137
|
+
* that no other rule (strict: any; else only the earlier ones) resolves to an existing ref.
|
|
138
|
+
*/
|
|
139
|
+
export declare function shortenRefName(ref: string, strict: boolean, exists: (name: string) => Promise<boolean>): Promise<string>;
|
|
140
|
+
/** lstrip_ref_components. */
|
|
141
|
+
export declare function lstripRef(name: string, len: number): string;
|
|
142
|
+
/** rstrip_ref_components. */
|
|
143
|
+
export declare function rstripRef(name: string, len: number): string;
|
|
144
|
+
/**
|
|
145
|
+
* The offset of a trailing signature in `text` (gpg-interface.c's `parse_signed_buffer`): the
|
|
146
|
+
* last line starting a PGP, X.509 or SSH signature block, else `text.length`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function signatureStart(text: string): number;
|
|
149
|
+
/**
|
|
150
|
+
* `s` without its trailing spaces, in one backwards pass (split_ident_line's trim). Never a
|
|
151
|
+
* `/ +$/` regex: V8 retries it from every space of a long run, quadratic on the hostile
|
|
152
|
+
* author names a fetched commit may carry.
|
|
153
|
+
*/
|
|
154
|
+
export declare function trimTrailingSpaces(s: string): string;
|
|
155
|
+
/** A tag's `object`, `type` and `tag` header values. */
|
|
156
|
+
export declare function tagHeader(buf: string): {
|
|
157
|
+
object?: string;
|
|
158
|
+
type?: string;
|
|
159
|
+
tag?: string;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* A format and the sort keys of one listing, with the atoms they use (git keeps one list
|
|
163
|
+
* for both), and each ref's values.
|
|
164
|
+
*/
|
|
165
|
+
export declare class RefFormat {
|
|
166
|
+
private readonly source;
|
|
167
|
+
/** The atoms parsed, in order (git's `used_atom`) */
|
|
168
|
+
readonly atoms: UsedAtom[];
|
|
169
|
+
private readonly pieces;
|
|
170
|
+
private needColorReset;
|
|
171
|
+
private needTagged;
|
|
172
|
+
private readonly quoteStyle;
|
|
173
|
+
private readonly useColor;
|
|
174
|
+
private readonly peelNested;
|
|
175
|
+
private headTarget?;
|
|
176
|
+
private mailmapLoad?;
|
|
177
|
+
private dateModes;
|
|
178
|
+
/**
|
|
179
|
+
* `format` verified as git's verify_ref_format does (atoms parsed, `%(rest)` refused,
|
|
180
|
+
* `%(raw)` refused with `--shell`/`--python`/`--tcl`).
|
|
181
|
+
*
|
|
182
|
+
* @throws RefFilterError with git's message
|
|
183
|
+
*/
|
|
184
|
+
constructor(format: string, source: RefFormatSource, options?: RefFormatOptions);
|
|
185
|
+
/**
|
|
186
|
+
* The index of an atom (parse_ref_filter_atom): one used before with the same text, else
|
|
187
|
+
* a new one; sort keys are parsed through this too.
|
|
188
|
+
*/
|
|
189
|
+
atomIndex(text: string): number;
|
|
190
|
+
/** The sort type an atom compares by (a date atom with a format compares as text). */
|
|
191
|
+
cmpTypeOf(index: number): AtomCmpType;
|
|
192
|
+
/** Whether an atom of this kind is used (`ahead-behind`, `is-base`, ...). */
|
|
193
|
+
uses(type: UsedAtom["type"]): boolean;
|
|
194
|
+
/** The value of atom `index` for `item`, its values computed first if needed. */
|
|
195
|
+
value(item: RefFilterItem, index: number): Promise<AtomValue>;
|
|
196
|
+
/**
|
|
197
|
+
* format_ref_array_item: the format expanded for `item`.
|
|
198
|
+
*
|
|
199
|
+
* @throws RefFilterError where git dies
|
|
200
|
+
*/
|
|
201
|
+
format(item: RefFilterItem): Promise<string>;
|
|
202
|
+
/** populate_value: every atom's value for `item`. */
|
|
203
|
+
private populate;
|
|
204
|
+
/** peel_object with PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE: undefined for a bad tag. */
|
|
205
|
+
private peel;
|
|
206
|
+
private showRef;
|
|
207
|
+
/** fill_remote_ref_details. */
|
|
208
|
+
private remoteDetails;
|
|
209
|
+
private oidText;
|
|
210
|
+
/** grab_values (and grab_common_values) of one object, the ref's own or the peeled one. */
|
|
211
|
+
private grabValues;
|
|
212
|
+
/** grab_sub_body_contents. */
|
|
213
|
+
private grabContents;
|
|
214
|
+
/** grab_person: `who`'s name, email, date, line, and the creator atoms. */
|
|
215
|
+
private grabPerson;
|
|
216
|
+
/** grab_date: the date of an identity line as the atom's format shows it. */
|
|
217
|
+
private grabDate;
|
|
218
|
+
/** grab_signature for an unsigned commit; a signed one cannot be verified here. */
|
|
219
|
+
private grabSignature;
|
|
220
|
+
private grabDescribe;
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=ref-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-format.d.ts","sourceRoot":"","sources":["../../../src/commands/ref-filter/ref-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,OAAO,EAAgC,KAAK,eAAe,EAAY,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAAa,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnE,0DAA0D;AAC1D,eAAO,MAAM,OAAO;aAClB,IAAI,EAAE,CAAM;aACZ,QAAQ,EAAE,CAAM;a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AI;YAqBJ,OAAO;IAgBrB,+BAA+B;YACjB,aAAa;YA6Cb,OAAO;IAWrB,2FAA2F;YAC7E,UAAU;IA6DxB,8BAA8B;YAChB,YAAY;IAsD1B,2EAA2E;YAC7D,UAAU;IAgCxB,6EAA6E;IAC7E,OAAO,CAAC,QAAQ;IAkChB,mFAAmF;IACnF,OAAO,CAAC,aAAa;YAaP,YAAY;CAY3B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base of the commands that list refs through git's ref-filter (`for-each-ref` now, the
|
|
3
|
+
* listings of `branch` and `tag` next): the repository as the filter and the format read it.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { type ObjectId } from "@statewalker/vcs-core";
|
|
8
|
+
import { GitCommand } from "../../git-command.js";
|
|
9
|
+
import type { RefFilterSource } from "./ref-filter.js";
|
|
10
|
+
import type { RefFormatObject, RefFormatSource } from "./ref-format.js";
|
|
11
|
+
/**
|
|
12
|
+
* A command listing refs through the ref-filter module: {@link filterSource} and
|
|
13
|
+
* {@link formatSource} read this command's repository (replace refs, the commit-graph, its
|
|
14
|
+
* configuration and worktrees).
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class RefListingCommand<T> extends GitCommand<T> {
|
|
17
|
+
private objectCache;
|
|
18
|
+
private replacements?;
|
|
19
|
+
private worktreeHeads?;
|
|
20
|
+
/** An object's type and content, through replace refs (git's OBJECT_INFO_LOOKUP_REPLACE). */
|
|
21
|
+
protected readObjectForFilter(id: ObjectId): Promise<RefFormatObject | undefined>;
|
|
22
|
+
private loadObject;
|
|
23
|
+
private config;
|
|
24
|
+
/** The ref a name finally resolves to through symbolic refs (`refs_resolve_refdup`). */
|
|
25
|
+
private resolveChain;
|
|
26
|
+
private listed;
|
|
27
|
+
/**
|
|
28
|
+
* The objects of `--points-at` and the commits of `--contains`, `--no-contains`,
|
|
29
|
+
* `--merged` and `--no-merged`, resolved as parse_options' callbacks do, with their
|
|
30
|
+
* refusals (`error: malformed object name x`, `error: object ... is a tree, not a commit`).
|
|
31
|
+
*
|
|
32
|
+
* @throws RefFilterError where git's option parsing fails (129) or dies (128)
|
|
33
|
+
*/
|
|
34
|
+
protected resolveFilterArgs(args: {
|
|
35
|
+
pointsAt: readonly string[];
|
|
36
|
+
contains: readonly string[];
|
|
37
|
+
noContains: readonly string[];
|
|
38
|
+
merged: readonly string[];
|
|
39
|
+
noMerged: readonly string[];
|
|
40
|
+
}): Promise<{
|
|
41
|
+
pointsAt: ObjectId[];
|
|
42
|
+
contains: ObjectId[];
|
|
43
|
+
noContains: ObjectId[];
|
|
44
|
+
merged: ObjectId[];
|
|
45
|
+
noMerged: ObjectId[];
|
|
46
|
+
}>;
|
|
47
|
+
/** The repository as git's ref filter reads it. */
|
|
48
|
+
protected filterSource(): RefFilterSource;
|
|
49
|
+
private countAheadBehind;
|
|
50
|
+
/** The repository as git's ref format reads it. */
|
|
51
|
+
protected formatSource(): RefFormatSource;
|
|
52
|
+
/** `git describe` over this repository's tags (`%(describe)`). */
|
|
53
|
+
private describer;
|
|
54
|
+
private loadWorktreeHeads;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=ref-listing-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-listing-command.d.ts","sourceRoot":"","sources":["../../../src/commands/ref-filter/ref-listing-command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAGL,KAAK,QAAQ,EAKd,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOlD,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAgBxE;;;;GAIG;AACH,8BAAsB,iBAAiB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IAC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escript
|
|
7
|
+
* quoteRefValue("it's", "shell"); // "'it'\\''s'"
|
|
8
|
+
* quoteRefValue("a\nb", "python"); // "'a\\nb'"
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
/** How `for-each-ref` quotes each atom's value. */
|
|
14
|
+
export type RefQuoteStyle = "none" | "shell" | "perl" | "python" | "tcl";
|
|
15
|
+
/**
|
|
16
|
+
* `value` quoted in `style`. C strings end at a NUL, so every style but `perl` with a
|
|
17
|
+
* known length (`sized`, git's `perl_quote_buf_with_len` for `%(raw)`) stops there.
|
|
18
|
+
*/
|
|
19
|
+
export declare function quoteRefValue(value: string, style: RefQuoteStyle, sized?: boolean): string;
|
|
20
|
+
//# sourceMappingURL=ref-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-quote.d.ts","sourceRoot":"","sources":["../../../src/commands/ref-filter/ref-quote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,UAAQ,GAAG,MAAM,CAgDxF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's versioncmp.c: the order `--sort=version:refname` (`v:`) and `tag.sort=version:...`
|
|
3
|
+
* give names, digits compared as numbers, with `versionsort.suffix` pre-release suffixes
|
|
4
|
+
* sorted before the release they precede.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* versionCompare("foo1.6", "foo1.10"); // < 0
|
|
9
|
+
* versionCompare("v1.0-rc1", "v1.0", ["-rc"]); // < 0: "-rc" sorts before the release
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* versioncmp.c's versioncmp: negative, zero or positive as `a` sorts before, with or after
|
|
16
|
+
* `b`. `suffixes` are `versionsort.suffix` (or the older `versionsort.prereleaseSuffix`) in
|
|
17
|
+
* configuration order.
|
|
18
|
+
*/
|
|
19
|
+
export declare function versionCompare(a: string, b: string, suffixes?: readonly string[]): number;
|
|
20
|
+
//# sourceMappingURL=version-compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-compare.d.ts","sourceRoot":"","sources":["../../../src/commands/ref-filter/version-compare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAyHH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,CAsC7F"}
|