@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
|
@@ -3,15 +3,32 @@ import { type Staging } from "@statewalker/vcs-working-tree";
|
|
|
3
3
|
import { GitCommand } from "../git-command.js";
|
|
4
4
|
import { ChangeType, type DiffEntry } from "../results/diff-entry.js";
|
|
5
5
|
import { type DiffOutputOptions, type DiffstatFile, type DiffstatOptions } from "../results/diff-output.js";
|
|
6
|
+
import { type DiffColorOptions, type DiffColorSettings } from "./diff-color-config.js";
|
|
6
7
|
import { type SubmoduleIgnoreMode } from "./submodule-config.js";
|
|
7
8
|
import { type SubmoduleDiffFormat } from "./submodule-summary.js";
|
|
8
|
-
export type DiffOutputFormat = "patch" | "stat" | "numstat" | "shortstat" | "summary" | "name-only" | "name-status"
|
|
9
|
+
export type DiffOutputFormat = "patch" | "stat" | "numstat" | "shortstat" | "summary" | "name-only" | "name-status"
|
|
10
|
+
/**
|
|
11
|
+
* `--check`: the whitespace errors and leftover conflict markers the change adds (see
|
|
12
|
+
* {@link writePairCheck}); it turns the other formats off, and {@link DiffCommand.exitCode}
|
|
13
|
+
* gets 2 when it found any
|
|
14
|
+
*/
|
|
15
|
+
| "check";
|
|
9
16
|
/** Options of the text output that `git diff` takes on its command line */
|
|
10
|
-
export interface DiffTextOptions extends Omit<DiffOutputOptions, "driver" | "algorithm" | "indentHeuristic"
|
|
17
|
+
export interface DiffTextOptions extends Omit<DiffOutputOptions, "driver" | "algorithm" | "indentHeuristic" | "ignoreRegex" | "colors" | "wsHighlight" | "whitespaceRule" | "defaultWordRegex">, DiffColorOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The builtin diff drivers (funcname and word regexes) of that git version (default 2.56):
|
|
20
|
+
* 2.43 has no `ini`, `r` and `swift` drivers and older `bash`, `csharp` and `scheme` ones
|
|
21
|
+
*/
|
|
22
|
+
driverCompatibility?: "2.43" | "2.56";
|
|
11
23
|
/** `--diff-algorithm` (default `diff.algorithm`, else myers) */
|
|
12
24
|
algorithm?: XdiffAlgorithm;
|
|
13
25
|
/** `--indent-heuristic` / `--no-indent-heuristic` (default `diff.indentHeuristic`, true) */
|
|
14
26
|
indentHeuristic?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* diff_options.stat_sep: text written after the blank line that separates a stat or
|
|
29
|
+
* summary from the patch (format-patch's MIME part header with `--attach`/`--inline`)
|
|
30
|
+
*/
|
|
31
|
+
statSep?: string;
|
|
15
32
|
/**
|
|
16
33
|
* `--abbrev=<n>`: the `index` lines' ids at least n digits, clamped as git clamps it (below
|
|
17
34
|
* 4, 0 too, is 4; above 40 is 40); the combined diffs of conflicted paths ignore it, as
|
|
@@ -77,7 +94,83 @@ export interface DiffTextOptions extends Omit<DiffOutputOptions, "driver" | "alg
|
|
|
77
94
|
* prefixes with them (`diff --git b/f a/f`). Combined diffs of conflicted paths are not swapped.
|
|
78
95
|
*/
|
|
79
96
|
reverse?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* `--diff-filter=<letters>`: only the pairs of these statuses (`A`dded, `C`opied,
|
|
99
|
+
* `D`eleted, `M`odified, `R`enamed, `T`ype changed, `U`nmerged, `X` unknown, `B`roken);
|
|
100
|
+
* a lowercase letter leaves its status out instead, and `*` keeps every pair as long as one
|
|
101
|
+
* of them matches (all or none). An unknown letter throws git's
|
|
102
|
+
* `error: unknown change class '<c>' in --diff-filter=<letters>` (exit 129). The combined
|
|
103
|
+
* diff (`diff --cc`) of a conflicted path is not filtered, as git's is not.
|
|
104
|
+
*/
|
|
105
|
+
diffFilter?: string;
|
|
106
|
+
/**
|
|
107
|
+
* `--relative=<path>`: only the paths that start with `<path>` (a string prefix, as git's
|
|
108
|
+
* `strncmp`: `sub` takes `subdir/` too), shown without it (and the `/` after it);
|
|
109
|
+
* `--no-relative` is `false`. The commands run at the top of the worktree, so `true`
|
|
110
|
+
* (`--relative` without a path, or `diff.relative`) shows every path as it is.
|
|
111
|
+
*/
|
|
112
|
+
relative?: string | boolean;
|
|
113
|
+
/**
|
|
114
|
+
* `--rotate-to=<path>`: the output starts at this path, the ones before it moved to the end;
|
|
115
|
+
* `git diff` throws `fatal: No such path '<path>' in the diff` when no pair has it, `git
|
|
116
|
+
* log` starts at the first path after it
|
|
117
|
+
*/
|
|
118
|
+
rotateTo?: string;
|
|
119
|
+
/** `--skip-to=<path>`: as {@link rotateTo}, the paths before it left out */
|
|
120
|
+
skipTo?: string;
|
|
121
|
+
/**
|
|
122
|
+
* `-I<regex>` (`--ignore-matching-lines`): changes whose lines all match one of these POSIX
|
|
123
|
+
* extended regexes are not shown (xdiff's `xdl_mark_ignorable_regex`); an invalid one
|
|
124
|
+
* throws git's `error: invalid regex given to -I: '<regex>'` (exit 129)
|
|
125
|
+
*/
|
|
126
|
+
ignoreMatchingLines?: readonly string[];
|
|
127
|
+
/**
|
|
128
|
+
* `--quiet` still detects renames and copies (git 2.43; default false: git 2.5x's
|
|
129
|
+
* diff_setup_done turns `detect_rename` off under `quick`, so `--quiet --diff-filter=R`
|
|
130
|
+
* finds nothing there)
|
|
131
|
+
*/
|
|
132
|
+
quietDetectsRenames?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* `--exit-code` and `--quiet` count only the pairs an output shows (default true, git 2.5x,
|
|
135
|
+
* whose porcelain diff turns `diff_from_contents` on with an exit status: `--summary` alone
|
|
136
|
+
* then exits 0, a pair whose patch shows nothing does not count); false counts every queued
|
|
137
|
+
* pair unless a whitespace option or `-I` is given, as git 2.43
|
|
138
|
+
*/
|
|
139
|
+
exitCodeFromContents?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* `-S<string>`: only the pairs whose two sides hold the string a different number of
|
|
142
|
+
* times (diffcore-pickaxe.c), read through textconv unless `textconv: false`. An empty
|
|
143
|
+
* string throws git's `error: -S requires a non-empty argument` (exit 129).
|
|
144
|
+
*/
|
|
145
|
+
pickaxeString?: string;
|
|
146
|
+
/**
|
|
147
|
+
* `-G<regex>`: only the pairs whose added or removed lines match this POSIX extended
|
|
148
|
+
* regex; binary pairs are passed over unless `text` (or textconv makes them text). An
|
|
149
|
+
* empty one throws `error: -G requires a non-empty argument` (exit 129), an invalid one
|
|
150
|
+
* `fatal: invalid regex: <message>` (exit 128).
|
|
151
|
+
*/
|
|
152
|
+
pickaxeGrep?: string;
|
|
153
|
+
/**
|
|
154
|
+
* `--find-object=<object>` (each a revision naming an object): only the pairs with one of
|
|
155
|
+
* them on either side; a diff of two trees also lists the subtrees that changed, so a tree
|
|
156
|
+
* can be found too (`tree_in_recursive`). One that names nothing throws `error: unable to
|
|
157
|
+
* resolve '<object>'` (exit 129).
|
|
158
|
+
*/
|
|
159
|
+
findObjects?: readonly string[];
|
|
160
|
+
/** `--pickaxe-regex`: `-S` takes a POSIX extended regex */
|
|
161
|
+
pickaxeRegex?: boolean;
|
|
162
|
+
/** `--pickaxe-all`: when one pair matches, every pair is kept; when none, none */
|
|
163
|
+
pickaxeAll?: boolean;
|
|
164
|
+
/** `-i` / `--regexp-ignore-case` of `-S`/`-G` (ASCII case folded) */
|
|
165
|
+
pickaxeIgnoreCase?: boolean;
|
|
80
166
|
}
|
|
167
|
+
/** Whether options ask for a pickaxe (git's `DIFF_PICKAXE_KINDS_MASK`) */
|
|
168
|
+
export declare function hasPickaxe(o: DiffTextOptions): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* diff.c's checks of the pickaxe options (the option callbacks' empty-argument errors, then
|
|
171
|
+
* diff_setup_done's combinations), before anything is read
|
|
172
|
+
*/
|
|
173
|
+
export declare function checkPickaxeOptions(o: DiffTextOptions): void;
|
|
81
174
|
/**
|
|
82
175
|
* Show changes between commits, trees, the index and the worktree.
|
|
83
176
|
*
|
|
@@ -141,6 +234,15 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
141
234
|
private dirtySubmodules?;
|
|
142
235
|
/** `diff.submodule` (its last value git knows), read by the text outputs */
|
|
143
236
|
private configuredSubmoduleFormat?;
|
|
237
|
+
/** The colors of the output, read with the diff configuration (or given by `git log`) */
|
|
238
|
+
private colorSettings?;
|
|
239
|
+
/**
|
|
240
|
+
* The colors already read (`readDiffColorSettings`): `git log` reads them once for all its
|
|
241
|
+
* commits' diffs
|
|
242
|
+
*
|
|
243
|
+
* @internal
|
|
244
|
+
*/
|
|
245
|
+
setColorSettings(settings: DiffColorSettings): this;
|
|
144
246
|
private readonly configWarnings;
|
|
145
247
|
/** {@link dirtySubmodules} for the comparison being collected */
|
|
146
248
|
private dirtyThisCall;
|
|
@@ -157,6 +259,68 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
157
259
|
private temporaryIndex?;
|
|
158
260
|
/** Intent-to-add entries are in the index as empty files (plumbing's `diff-index --cached`) */
|
|
159
261
|
private intentToAddVisible;
|
|
262
|
+
/** The index stands for a tree (see {@link setIndexAsTree}) */
|
|
263
|
+
private indexAsTree;
|
|
264
|
+
/** `--exit-code` */
|
|
265
|
+
private exitWithStatus;
|
|
266
|
+
/** `--quiet` */
|
|
267
|
+
private quiet;
|
|
268
|
+
/** `--merge-base` */
|
|
269
|
+
private mergeBase;
|
|
270
|
+
/** Whether `--rotate-to`/`--skip-to` need their exact path (`git diff`; not `git log`) */
|
|
271
|
+
private rotateStrict;
|
|
272
|
+
/** git's `has_changes` of the last call */
|
|
273
|
+
private changesFound;
|
|
274
|
+
/** git's `check_failed`: `--check` found an error in the last call */
|
|
275
|
+
private checkFailed;
|
|
276
|
+
/** The revisions given resolved (ranges, `--merge-base`) */
|
|
277
|
+
private sidesResolved;
|
|
278
|
+
/** The compiled pickaxe (`-S`, `-G`, `--find-object`), once the options are checked */
|
|
279
|
+
private pickaxe?;
|
|
280
|
+
/**
|
|
281
|
+
* `--find-object`'s `tree_in_recursive`: the subtrees of a diff of two trees, by the side
|
|
282
|
+
* map their blobs go to
|
|
283
|
+
*/
|
|
284
|
+
private treeSides?;
|
|
285
|
+
/**
|
|
286
|
+
* `--exit-code`: {@link exitCode} is 1 when the diff found differences, as git's status
|
|
287
|
+
* (`diff_result_code`). With whitespace options or `-I`, only pairs whose patch shows a
|
|
288
|
+
* change count (git's `diff_from_contents`).
|
|
289
|
+
*/
|
|
290
|
+
setExitCode(exitCode: boolean): this;
|
|
291
|
+
/**
|
|
292
|
+
* `--quiet`: {@link callText} and {@link callBytes} print nothing and {@link exitCode} is
|
|
293
|
+
* 1 when anything differs (`--exit-code`). As git's `quick` flag, the diff stops at its
|
|
294
|
+
* first difference: no rename detection (git 2.5x; see
|
|
295
|
+
* {@link DiffTextOptions.quietDetectsRenames}), no content read past the first pair that
|
|
296
|
+
* shows a change.
|
|
297
|
+
*/
|
|
298
|
+
setQuiet(quiet: boolean): this;
|
|
299
|
+
/**
|
|
300
|
+
* `--merge-base`: diff from the merge base of the old tree and the new one (`git diff
|
|
301
|
+
* --merge-base A B`), or of the old tree and HEAD against the index (`--cached`) or the
|
|
302
|
+
* worktree (`git diff --merge-base A`). Both must be commits with exactly one merge base,
|
|
303
|
+
* else git's `fatal: no merge base found` / `fatal: multiple merge bases found`; a range
|
|
304
|
+
* throws `fatal: --merge-base does not work with ranges`.
|
|
305
|
+
*/
|
|
306
|
+
setMergeBase(mergeBase: boolean): this;
|
|
307
|
+
/**
|
|
308
|
+
* `--rotate-to`/`--skip-to` take the first path after a missing one, as `git log` does,
|
|
309
|
+
* instead of failing as `git diff` does.
|
|
310
|
+
*
|
|
311
|
+
* @internal
|
|
312
|
+
*/
|
|
313
|
+
setRotateStrict(strict: boolean): this;
|
|
314
|
+
/**
|
|
315
|
+
* The exit status `git diff` ends with (`diff_result_code`): bit 1 when `--exit-code` or
|
|
316
|
+
* `--quiet` is set and the last call found differences, bit 2 when its `--check` (the
|
|
317
|
+
* `check` format) found errors.
|
|
318
|
+
*/
|
|
319
|
+
get exitCode(): number;
|
|
320
|
+
/** Whether the last call's `--check` found errors (git's `check_failed`) */
|
|
321
|
+
get checkFoundErrors(): boolean;
|
|
322
|
+
/** Whether the last call found differences (git's `has_changes`) */
|
|
323
|
+
get hasChanges(): boolean;
|
|
160
324
|
/**
|
|
161
325
|
* Show intent-to-add entries in a `--cached` comparison as the empty files they name, as
|
|
162
326
|
* plumbing's `diff-index --cached` does (porcelain `git diff` sets `ita_invisible_in_index`).
|
|
@@ -168,9 +332,11 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
168
332
|
* Set the old (base) tree/commit for comparison.
|
|
169
333
|
*
|
|
170
334
|
* Can be a commit ID, branch name, tag name, or tree ID.
|
|
171
|
-
* If not set, defaults to HEAD (or the index, for the worktree diff).
|
|
335
|
+
* If not set, defaults to HEAD (or the index, for the worktree diff). Without a new tree, a
|
|
336
|
+
* range compares two commits as `git diff` does: `A..B` is `A B`, `A...B` diffs B from the
|
|
337
|
+
* merge base of A and B (an empty side is HEAD).
|
|
172
338
|
*
|
|
173
|
-
* @param refOrId Commit-ish or tree ID
|
|
339
|
+
* @param refOrId Commit-ish or tree ID, or a range
|
|
174
340
|
*/
|
|
175
341
|
setOldTree(refOrId: string): this;
|
|
176
342
|
/**
|
|
@@ -241,6 +407,14 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
241
407
|
*/
|
|
242
408
|
setTemporaryIndex(index: Staging): this;
|
|
243
409
|
protected get staging(): Staging;
|
|
410
|
+
/**
|
|
411
|
+
* Compares the old tree with `index` taken as a tree, as git's `do_diff_cache` of an index
|
|
412
|
+
* built in memory (`stash show -u`'s worktree and untracked trees): `--cached` against
|
|
413
|
+
* it, with the prefixes of two trees (no mnemonic `c/` and `i/`).
|
|
414
|
+
*
|
|
415
|
+
* @internal
|
|
416
|
+
*/
|
|
417
|
+
setIndexAsTree(index: Staging): this;
|
|
244
418
|
/**
|
|
245
419
|
* Filter results to only paths starting with this prefix.
|
|
246
420
|
*
|
|
@@ -281,6 +455,14 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
281
455
|
callText(format?: DiffOutputFormat): Promise<string>;
|
|
282
456
|
/** {@link callText} as bytes (file content that is not UTF-8 kept as it is). */
|
|
283
457
|
callBytes(format?: DiffOutputFormat): Promise<Uint8Array>;
|
|
458
|
+
/**
|
|
459
|
+
* `--quiet` (git's `quick` flag, `DIFF_FORMAT_NO_OUTPUT`): whether anything differs, stopping
|
|
460
|
+
* early. Without `--diff-filter` and content options the first queued pair answers
|
|
461
|
+
* (diff_can_quit_early): no renames are detected and no content is read; with content
|
|
462
|
+
* options (`-w`, `-I`, ...) pairs are diffed until one shows a change (diff_flush's
|
|
463
|
+
* `diff_flush_patch_quietly` loop).
|
|
464
|
+
*/
|
|
465
|
+
private quietCheck;
|
|
284
466
|
/**
|
|
285
467
|
* The diffstat of the comparison, one file per pair in git's order (`compute_diffstat` of
|
|
286
468
|
* the diff queue, as a `DIFF_FORMAT_CALLBACK` consumer sees it): an unmerged path as a
|
|
@@ -328,9 +510,19 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
328
510
|
* as they are (the entry's `readNew`, which reads it cleaned)
|
|
329
511
|
*/
|
|
330
512
|
private withTextconvInputs;
|
|
513
|
+
/**
|
|
514
|
+
* diff.c's textconv_object, as `git show --textconv <rev>:<path>` runs it: the output of
|
|
515
|
+
* the path's `diff.<driver>.textconv` over the blob as checkout writes it, or undefined
|
|
516
|
+
* when no textconv applies (not a regular file, no driver, no command or no runner
|
|
517
|
+
* installed, `textconv: false`). The attributes are the worktree's alone (git show reads
|
|
518
|
+
* no index).
|
|
519
|
+
*/
|
|
520
|
+
textconvBlob(path: string, mode: number, read: () => Promise<Uint8Array>): Promise<Uint8Array | undefined>;
|
|
331
521
|
/** A blob's content as checkout writes it to the worktree (the worktree's smudge filter) */
|
|
332
522
|
private smudged;
|
|
333
|
-
/**
|
|
523
|
+
/** git 2.5x's names from contents (see {@link DiffTextOptions.namesFromContents}) */
|
|
524
|
+
private get namesFromContents();
|
|
525
|
+
/** The pairs `--name-only` lists: with whitespace options or `-I`, those whose patch shows a change */
|
|
334
526
|
private shownNames;
|
|
335
527
|
private get config();
|
|
336
528
|
/** What this diff compares */
|
|
@@ -357,6 +549,38 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
357
549
|
private get worktreeIfAny();
|
|
358
550
|
/** The output options: the setters', else the configuration's */
|
|
359
551
|
private outputOptions;
|
|
552
|
+
/** `ll_merge_marker_size`: each path's `conflict-marker-size` attribute */
|
|
553
|
+
private conflictMarkerSizeOf;
|
|
554
|
+
/**
|
|
555
|
+
* ws.c's `whitespace_rule`: the `whitespace` attribute of a path over `core.whitespace`
|
|
556
|
+
* (git 2.43 knows no `incomplete-line` rule)
|
|
557
|
+
*/
|
|
558
|
+
private whitespaceRuleOf;
|
|
559
|
+
/** `-I<regex>` compiled as git's `regcomp(REG_EXTENDED | REG_NEWLINE)` */
|
|
560
|
+
private ignoreRegex;
|
|
561
|
+
/**
|
|
562
|
+
* git's `diff_from_contents`: whitespace options and `-I` (and, in git 2.5x, an exit status
|
|
563
|
+
* asked for) make a pair count as a change only when its output shows one
|
|
564
|
+
*/
|
|
565
|
+
private get fromContents();
|
|
566
|
+
/**
|
|
567
|
+
* The queue diffcore_std leaves of the collected entries: in `-O` order, swapped by `-R`,
|
|
568
|
+
* rotated (`--rotate-to`, `--skip-to`), filtered (`--diff-filter`)
|
|
569
|
+
*/
|
|
570
|
+
private selected;
|
|
571
|
+
/**
|
|
572
|
+
* diffcore_std's prefetch condition: any pickaxe kind (`DIFF_PICKAXE_KINDS_MASK`,
|
|
573
|
+
* `--find-object` included) fetches a partial clone's absent blobs of the queue in one
|
|
574
|
+
* batch before rename detection
|
|
575
|
+
*/
|
|
576
|
+
private get pickaxeReads();
|
|
577
|
+
/** diffcore_pickaxe over the queue (after rename detection, before `-O` and the filter) */
|
|
578
|
+
private picked;
|
|
579
|
+
/**
|
|
580
|
+
* The pickaxe of the options (checked, compiled, `--find-object`'s revisions resolved),
|
|
581
|
+
* before anything else is read
|
|
582
|
+
*/
|
|
583
|
+
private preparePickaxe;
|
|
360
584
|
/**
|
|
361
585
|
* The changed paths (and renames, when asked), in git's order, and the conflicted paths
|
|
362
586
|
* `git diff` shows as combined diffs (`patch`: the patch format, where a path with both
|
|
@@ -364,6 +588,25 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
364
588
|
* against the worktree, as `diff-files` does).
|
|
365
589
|
*/
|
|
366
590
|
private collect;
|
|
591
|
+
/**
|
|
592
|
+
* `--find-object`'s tree_in_recursive: the changed subtrees of a diff of two trees among
|
|
593
|
+
* the blob pairs, each before what lies below it (the tree walk's order: `a/` sorts after
|
|
594
|
+
* `a.txt`); they take no part in rename detection
|
|
595
|
+
*/
|
|
596
|
+
private withTreeEntries;
|
|
597
|
+
/**
|
|
598
|
+
* builtin/diff.c's revision handling: `A..B` is `A B`, `A...B` the merge base of A and B
|
|
599
|
+
* against B (symdiff_prepare: the first base, with git's warning when there are several),
|
|
600
|
+
* `--merge-base` the merge base of the two sides (diff_get_merge_base); an empty side of a
|
|
601
|
+
* range is HEAD.
|
|
602
|
+
*/
|
|
603
|
+
private resolveRevisions;
|
|
604
|
+
/**
|
|
605
|
+
* lookup_commit_reference of a revision: the commit it names (tags peeled); for another
|
|
606
|
+
* object git's `error: object <id> is a <type>, not a commit` goes to `errors`. A name that
|
|
607
|
+
* resolves to nothing throws git's `ambiguous argument` (of the whole `argument`).
|
|
608
|
+
*/
|
|
609
|
+
private commitOf;
|
|
367
610
|
/**
|
|
368
611
|
* What the submodule at a path ignores (git's `set_diffopt_flags_from_submodule_config`
|
|
369
612
|
* over `diff.ignoreSubmodules`): its `submodule.<name>.ignore` (the configuration, else
|
|
@@ -374,6 +617,8 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
374
617
|
private submoduleIgnores;
|
|
375
618
|
/** diff-files on a conflicted path's stage 2 (`--ours`): its entry against the worktree */
|
|
376
619
|
private againstStage;
|
|
620
|
+
/** The `--relative=<path>` prefix paths are limited to and shown without */
|
|
621
|
+
private get relativePrefix();
|
|
377
622
|
private matches;
|
|
378
623
|
/**
|
|
379
624
|
* The entries of both sides in path order; an unmerged path is listed as such, followed by
|
|
@@ -412,6 +657,8 @@ export declare class DiffCommand extends GitCommand<DiffEntry[]> {
|
|
|
412
657
|
private addRawSide;
|
|
413
658
|
/** A tree entry on one side: a blob as itself, a subtree as its blobs */
|
|
414
659
|
private addSide;
|
|
660
|
+
/** A subtree on one side, kept for `--find-object` (see {@link withTreeEntries}) */
|
|
661
|
+
private addTreeSide;
|
|
415
662
|
/**
|
|
416
663
|
* The index's stage-0 entries (intent-to-add ones left out: not in the index yet), and the
|
|
417
664
|
* stages of its conflicted paths
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diff-command.d.ts","sourceRoot":"","sources":["../../src/commands/diff-command.ts"],"names":[],"mappings":"AAMA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAOL,KAAK,OAAO,EAKb,MAAM,+BAA+B,CAAC;AAQvC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAW/C,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,eAAe,EASrB,MAAM,2BAA2B,CAAC;AAWnC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAGvB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,wBAAwB,CAAC;AAwChC,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,MAAM,GACN,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,GACX,aAAa;AACf;;;;GAIG;GACD,OAAO,CAAC;AAEZ,2EAA2E;AAC3E,MAAM,WAAW,eACf,SAAQ,IAAI,CACR,iBAAiB,EACf,QAAQ,G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wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAaxD"}
|
|
@@ -81,6 +81,7 @@ export declare class FetchCommand extends TransportCommand<FetchResult> {
|
|
|
81
81
|
/** `--filter=<spec>` (a string), `--no-filter` (false), or neither */
|
|
82
82
|
private filterSpec?;
|
|
83
83
|
private refetch;
|
|
84
|
+
private setUpstream;
|
|
84
85
|
/**
|
|
85
86
|
* Set the remote to fetch from.
|
|
86
87
|
*
|
|
@@ -200,6 +201,18 @@ export declare class FetchCommand extends TransportCommand<FetchResult> {
|
|
|
200
201
|
* use: how a partial clone changes its filter.
|
|
201
202
|
*/
|
|
202
203
|
setRefetch(refetch: boolean): this;
|
|
204
|
+
/**
|
|
205
|
+
* `git fetch --set-upstream`: once the refs are written, the one ref fetched only into
|
|
206
|
+
* `FETCH_HEAD` (a branch, or `HEAD`) becomes the current branch's upstream,
|
|
207
|
+
* `branch.<name>.remote` the remote as named (a URL for a URL) and `branch.<name>.merge`
|
|
208
|
+
* the ref, written as `git branch -u` writes them (`branch.autoSetupRebase` included).
|
|
209
|
+
* Nothing is set, with git's warning in {@link FetchResult.messages}, when several refs or
|
|
210
|
+
* none are fetched that way, HEAD is detached, or the ref is a tag or a remote-tracking
|
|
211
|
+
* ref; nor when an update was refused. A dry run sets it too, as git's does.
|
|
212
|
+
*/
|
|
213
|
+
setSetUpstream(setUpstream: boolean): this;
|
|
214
|
+
/** Whether the fetch sets the current branch's upstream (`--set-upstream`). */
|
|
215
|
+
isSetUpstream(): boolean;
|
|
203
216
|
/**
|
|
204
217
|
* Set thin-pack preference.
|
|
205
218
|
*
|
|
@@ -386,6 +399,13 @@ export declare class FetchCommand extends TransportCommand<FetchResult> {
|
|
|
386
399
|
* @throws InvalidRemoteError if remote cannot be resolved
|
|
387
400
|
*/
|
|
388
401
|
call(): Promise<FetchResult>;
|
|
402
|
+
/**
|
|
403
|
+
* git's `--set-upstream` (do_fetch): the ref map's one ref without a local ref (fetched
|
|
404
|
+
* only into FETCH_HEAD; a ref add_merge_config marked among those the refspecs took has
|
|
405
|
+
* one) becomes the current branch's upstream through {@link installTracking}, or git's
|
|
406
|
+
* warning is added to `messages`.
|
|
407
|
+
*/
|
|
408
|
+
private setUpstreamOf;
|
|
389
409
|
/**
|
|
390
410
|
* git's check_not_current_branch: the first branch of the ref map (the refs the refspecs
|
|
391
411
|
* took, then their opportunistic updates) that a worktree has checked out makes the fetch
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-command.d.ts","sourceRoot":"","sources":["../../src/commands/fetch-command.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"fetch-command.d.ts","sourceRoot":"","sources":["../../src/commands/fetch-command.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,QAAQ,EAMd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EASL,KAAK,cAAc,EAWnB,KAAK,OAAO,EAGb,MAAM,4BAA4B,CAAC;AAWpC,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAa3D;;;;GAIG;AACH,oBAAY,SAAS;IACnB,8DAA8D;IAC9D,WAAW,gBAAgB;IAC3B,qBAAqB;IACrB,UAAU,eAAe;IACzB,2BAA2B;IAC3B,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,YAAa,SAAQ,gBAAgB,CAAC,WAAW,CAAC;IAC7D,OAAO,CAAC,MAAM,CAAY;IAC1B,gGAAgG;IAChG,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAU;IACpC,OAAO,CAAC,SAAS,CAAC,CAAU;IAC5B,OAAO,CAA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IACH,gBAAgB,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,CAI7C;IAED;;OAEG;IACH,WAAW,IAAI,OAAO,CAErB;IAED;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAwB1B;;;;;;;;;;;OAWG;IACG,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,CA6SjC;IAED;;;;;OAKG;YACW,aAAa;IAsD3B;;;;OAIG;YACW,sBAAsB;IAoBpC;;;;;;;;;OASG;YACW,YAAY;IAuG1B;;;;;;OAMG;YACW,0BAA0B;IAuBxC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;;;;OAOG;YACW,aAAa;IAsE3B,wFAAwF;IACxF,OAAO,CAAC,kBAAkB;IAQ1B;;;;OAIG;YACW,cAAc;IAU5B;;;;;;;OAOG;YACW,gBAAgB;IA2E9B,gGAAgG;YAClF,aAAa;IAa3B;;;;OAIG;YACW,gBAAgB;IAI9B;;;;;;;;;OASG;YACW,gBAAgB;IA4D9B,4FAA4F;YAC9E,eAAe;CAc9B;AASD,wDAAwD;AACxD,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CASpD;AAED,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAsB7E"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git fmt-merge-msg` (fmt-merge-msg.c) as a library command: the message git's merge and
|
|
3
|
+
* pull write for a merge, from FETCH_HEAD-style lines or from the names of merged heads.
|
|
4
|
+
*
|
|
5
|
+
* ```typescript
|
|
6
|
+
* // the lines `git fetch` wrote, as `git fmt-merge-msg <.git/FETCH_HEAD`
|
|
7
|
+
* const message = await git.fmtMergeMsg().setInput(fetchHeadText).setLog(true).call();
|
|
8
|
+
* // "Merge branch 'left'\n\n# By A U Thor\n* left:\n Left #2\n Left #1\n"
|
|
9
|
+
*
|
|
10
|
+
* // the heads a `git merge left v1` names
|
|
11
|
+
* await git.fmtMergeMsg().addHead("left").addHead("v1").call();
|
|
12
|
+
* // "Merge branch 'left', tag 'v1'\n"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import type { ObjectId } from "@statewalker/vcs-core";
|
|
16
|
+
import { GitCommand } from "../git-command.js";
|
|
17
|
+
import { RemoteConfigStore } from "../remote-config/index.js";
|
|
18
|
+
/** git's `DEFAULT_MERGE_LOG_LEN`: `--log` and `merge.log=true` list at most this many commits. */
|
|
19
|
+
export declare const DEFAULT_MERGE_LOG_LENGTH = 20;
|
|
20
|
+
/**
|
|
21
|
+
* The message for a merge, as `git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log]
|
|
22
|
+
* [--into-name <name>]` writes it on its stdout.
|
|
23
|
+
*
|
|
24
|
+
* The input is FETCH_HEAD's format ({@link setInput}: `<id>\t\t<description>` per merged
|
|
25
|
+
* head, `<id>\tnot-for-merge\t...` lines skipped) or the heads `git merge` is given
|
|
26
|
+
* ({@link addHead}), each described as builtin/merge.c's `merge_name` describes it (`branch
|
|
27
|
+
* 'x' of .`, `tag 'v1' of .`, `remote-tracking branch 'o/x' of .`, `branch 'x' (early part)
|
|
28
|
+
* of .`, `tag '<id>'`, `commit '<name>'`). Heads HEAD or another head already contains are
|
|
29
|
+
* left out (reduce_heads). The title (`Merge branches 'a' and 'b' into topic`) leaves out
|
|
30
|
+
* the target branch when `merge.suppressDest` matches it (default `main` and `master`); an
|
|
31
|
+
* annotated tag's message follows it; with a log length (`--log`, `merge.log`, or its old
|
|
32
|
+
* name `merge.summary`), each head's shortlog follows: `* <name>:` and the subjects of the
|
|
33
|
+
* commits HEAD lacks, newest first, at most that many (`* <name>: (<n> commits)` and `...`
|
|
34
|
+
* when there are more), the branch's description first under `merge.branchdesc`, and
|
|
35
|
+
* (unless {@link setCreditPeople} turns it off, as `git merge` without an editor does)
|
|
36
|
+
* `# By` / `# Via` lines naming the authors and committers who are not you.
|
|
37
|
+
*
|
|
38
|
+
* Not done: a signed tag's signature is not verified, so its `# gpg: ...` lines are missing.
|
|
39
|
+
*/
|
|
40
|
+
export declare class FmtMergeMsgCommand extends GitCommand<string> {
|
|
41
|
+
private input;
|
|
42
|
+
private heads;
|
|
43
|
+
private message?;
|
|
44
|
+
private log?;
|
|
45
|
+
private intoName?;
|
|
46
|
+
private creditPeople;
|
|
47
|
+
private headId?;
|
|
48
|
+
/** FETCH_HEAD-style input (git's stdin or `-F <file>`). */
|
|
49
|
+
setInput(input: string): this;
|
|
50
|
+
/**
|
|
51
|
+
* A head as `git merge` names it (a branch, tag, remote-tracking branch, `x~2`, an object
|
|
52
|
+
* id): described as git's merge describes it, after the input's lines.
|
|
53
|
+
*/
|
|
54
|
+
addHead(name: string): this;
|
|
55
|
+
/** `-m <message>`: the start of the message, given instead of the title. */
|
|
56
|
+
setMessage(message: string | undefined): this;
|
|
57
|
+
/**
|
|
58
|
+
* `--log[=<n>]` (true: {@link DEFAULT_MERGE_LOG_LENGTH}), `--no-log` (false or 0); undefined
|
|
59
|
+
* (the default) takes `merge.log` / `merge.summary`.
|
|
60
|
+
*/
|
|
61
|
+
setLog(log: boolean | number | undefined): this;
|
|
62
|
+
/** `--into-name <name>`: the title names this branch instead of HEAD's. */
|
|
63
|
+
setIntoName(name: string | undefined): this;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the shortlog credits people (`# By`, `# Via`): `git fmt-merge-msg` does (the
|
|
66
|
+
* default), `git merge` only when it runs an editor.
|
|
67
|
+
*/
|
|
68
|
+
setCreditPeople(credit: boolean): this;
|
|
69
|
+
/**
|
|
70
|
+
* The commit the merge goes into (default: HEAD's).
|
|
71
|
+
*
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
setHead(id: ObjectId): this;
|
|
75
|
+
/**
|
|
76
|
+
* The message, ended by a newline (empty when nothing is left to merge).
|
|
77
|
+
*
|
|
78
|
+
* @throws GitApiError git's `fatal: error in line <n>: <line>` for a line that is not
|
|
79
|
+
* FETCH_HEAD's format, `fatal: No current branch` without a HEAD commit, and the
|
|
80
|
+
* configuration's deaths (a negative `merge.log`, a valueless `merge.suppressDest`)
|
|
81
|
+
*/
|
|
82
|
+
call(): Promise<string>;
|
|
83
|
+
private format;
|
|
84
|
+
/** find_merge_parents: each line's (given, commit) pair, kept when reduce_heads keeps the commit. */
|
|
85
|
+
private findMergeParents;
|
|
86
|
+
/** fmt_merge_msg_sigs: the messages of the annotated tags merged. */
|
|
87
|
+
private tagMessages;
|
|
88
|
+
/** fmt-merge-msg.c's shortlog: `* <name>:` and the subjects of `<head> ^HEAD`. */
|
|
89
|
+
private shortlog;
|
|
90
|
+
/** add_people_info: `# By <authors>` and `# Via <committers>`, unless only you. */
|
|
91
|
+
private creditLines;
|
|
92
|
+
/**
|
|
93
|
+
* `rev-list <tip> ^<head>` in git's default order (limit_list): a queue by committer date,
|
|
94
|
+
* newest first, ties in the order queued; a commit HEAD reaches is left out, also when
|
|
95
|
+
* that is found only after it was queued.
|
|
96
|
+
*/
|
|
97
|
+
private walk;
|
|
98
|
+
/** builtin/merge.c's merge_name: the FETCH_HEAD-style line describing a merged head. */
|
|
99
|
+
private mergeName;
|
|
100
|
+
}
|
|
101
|
+
/** The `merge.*` settings fmt-merge-msg reads (fmt_merge_msg_config). */
|
|
102
|
+
export interface FmtMergeMsgConfig {
|
|
103
|
+
/** `merge.log` / `merge.summary`, whichever comes last: a length, 0 for none */
|
|
104
|
+
log: number;
|
|
105
|
+
/** `merge.branchdesc` */
|
|
106
|
+
branchDesc: boolean;
|
|
107
|
+
/** `merge.suppressDest` patterns (an empty value clears them; default main, master) */
|
|
108
|
+
suppressDest: string[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* fmt_merge_msg_config over a repository's configuration, in its order: what `git merge` and
|
|
112
|
+
* `git fmt-merge-msg` read as they load their configuration (git_merge_config), before they
|
|
113
|
+
* do anything.
|
|
114
|
+
*
|
|
115
|
+
* @throws InvalidConfigError with git's lines (exit 128) for the first value git refuses: a
|
|
116
|
+
* negative `merge.log`/`merge.summary` (`error: merge.log: negative length -1`, then `fatal:
|
|
117
|
+
* bad config variable 'merge.log' in file '.git/config' at line 4`), one that is no boolean
|
|
118
|
+
* or number (`fatal: bad numeric config value 'abc' for 'merge.log' in file .git/config:
|
|
119
|
+
* invalid unit`), a `merge.suppressDest` without a value (`error: missing value for
|
|
120
|
+
* 'merge.suppressdest'` and the `bad config variable` line), a `merge.branchdesc` that is no
|
|
121
|
+
* boolean (`fatal: bad boolean config value 'abc' for 'merge.branchdesc'`)
|
|
122
|
+
*/
|
|
123
|
+
export declare function fmtMergeMsgConfigOf(config: RemoteConfigStore): FmtMergeMsgConfig;
|
|
124
|
+
//# sourceMappingURL=fmt-merge-msg-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fmt-merge-msg-command.d.ts","sourceRoot":"","sources":["../../src/commands/fmt-merge-msg-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAU,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAK9D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAK9D,kGAAkG;AAClG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,kBAAmB,SAAQ,UAAU,CAAC,MAAM,CAAC;IACxD,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,GAAG,CAAC,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,MAAM,CAAC,CAAW;IAE1B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAI5B;IAED;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI1B;IAED,4EAA4E;IAC5E,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAI5C;IAED;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAI9C;IAED,2EAA2E;IAC3E,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAI1C;IAED;;;OAGG;IACH,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAIrC;IAED;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAI1B;IAED;;;;;;OAMG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAS5B;YAEa,MAAM;IAmCpB,qGAAqG;YACvF,gBAAgB;IAkC9B,qEAAqE;YACvD,WAAW;IAyBzB,kFAAkF;YACpE,QAAQ;IAqDtB,mFAAmF;IACnF,OAAO,CAAC,WAAW;IAsCnB;;;;OAIG;YACW,IAAI;IA+DlB,wFAAwF;YAC1E,SAAS;CAyDxB;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,uFAAuF;IACvF,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAYD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAsDhF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's get_fork_point (commit.c), shared by `git merge-base --fork-point` and
|
|
3
|
+
* `git rebase --fork-point`: the commit a branch forked from, found in the reflog of the
|
|
4
|
+
* ref it was built on.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // main was rewound after `side` forked from its old tip C: the fork point is C
|
|
9
|
+
* const fork = await findForkPoint(source, "main", sideTip); // C's id
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
import type { ObjectId } from "@statewalker/vcs-core";
|
|
13
|
+
import { type MergeBaseGraph } from "./merge-bases.js";
|
|
14
|
+
/** What the search reads of the repository. */
|
|
15
|
+
export interface ForkPointSource {
|
|
16
|
+
/** git's repo_dwim_ref: every ref the name may stand for, with its value */
|
|
17
|
+
dwimRef(name: string): Promise<{
|
|
18
|
+
id: ObjectId;
|
|
19
|
+
ref: string;
|
|
20
|
+
}[]>;
|
|
21
|
+
/** The ref's reflog, oldest entry first (empty or undefined when it has none) */
|
|
22
|
+
reflog(ref: string): Promise<{
|
|
23
|
+
oldId: ObjectId;
|
|
24
|
+
newId: ObjectId;
|
|
25
|
+
}[] | undefined>;
|
|
26
|
+
/** Whether `id` names a commit that can be read (git's lookup_commit + parse_commit) */
|
|
27
|
+
isCommit(id: ObjectId): Promise<boolean>;
|
|
28
|
+
/** The merge-base walk */
|
|
29
|
+
graph: MergeBaseGraph;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The fork point of `commit` from `refname`'s reflog, or undefined when there is none
|
|
33
|
+
* (no single merge base among the logged values).
|
|
34
|
+
*
|
|
35
|
+
* @throws GitApiError `fatal: No such ref: '<name>'` / `fatal: Ambiguous refname: '<name>'`
|
|
36
|
+
*/
|
|
37
|
+
export declare function findForkPoint(source: ForkPointSource, refname: string, commit: ObjectId): Promise<ObjectId | undefined>;
|
|
38
|
+
//# sourceMappingURL=fork-point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fork-point.d.ts","sourceRoot":"","sources":["../../src/commands/fork-point.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;IAChE,iFAAiF;IACjF,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,QAAQ,CAAA;KAAE,EAAE,GAAG,SAAS,CAAC,CAAC;IACjF,wFAAwF;IACxF,QAAQ,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,0BAA0B;IAC1B,KAAK,EAAE,cAAc,CAAC;CACvB;AAID;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,GACf,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAqB/B"}
|