@statewalker/vcs-commands 0.5.0 → 0.6.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/README.md +123 -8
- package/dist/commands/add-command.d.ts +265 -34
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/add-patch/add-interactive.d.ts +46 -0
- package/dist/commands/add-patch/add-interactive.d.ts.map +1 -0
- package/dist/commands/add-patch/add-patch.d.ts +139 -0
- package/dist/commands/add-patch/add-patch.d.ts.map +1 -0
- package/dist/commands/add-patch/index.d.ts +6 -0
- package/dist/commands/add-patch/index.d.ts.map +1 -0
- package/dist/commands/add-patch/patch-backend.d.ts +80 -0
- package/dist/commands/add-patch/patch-backend.d.ts.map +1 -0
- package/dist/commands/add-patch/patch-modes.d.ts +71 -0
- package/dist/commands/add-patch/patch-modes.d.ts.map +1 -0
- package/dist/commands/add-patch/patch-session.d.ts +49 -0
- package/dist/commands/add-patch/patch-session.d.ts.map +1 -0
- package/dist/commands/am/am-command.d.ts +175 -0
- package/dist/commands/am/am-command.d.ts.map +1 -0
- package/dist/commands/am/index.d.ts +3 -0
- package/dist/commands/am/index.d.ts.map +1 -0
- package/dist/commands/am/mailinfo.d.ts +58 -0
- package/dist/commands/am/mailinfo.d.ts.map +1 -0
- package/dist/commands/am/patch-format.d.ts +24 -0
- package/dist/commands/am/patch-format.d.ts.map +1 -0
- package/dist/commands/apply/apply-command.d.ts +153 -0
- package/dist/commands/apply/apply-command.d.ts.map +1 -0
- package/dist/commands/apply/apply-engine.d.ts +195 -0
- package/dist/commands/apply/apply-engine.d.ts.map +1 -0
- package/dist/commands/apply/apply-parse.d.ts +86 -0
- package/dist/commands/apply/apply-parse.d.ts.map +1 -0
- package/dist/commands/apply/apply-types.d.ts +70 -0
- package/dist/commands/apply/apply-types.d.ts.map +1 -0
- package/dist/commands/apply/index.d.ts +6 -0
- package/dist/commands/apply/index.d.ts.map +1 -0
- package/dist/commands/apply/latin1.d.ts +32 -0
- package/dist/commands/apply/latin1.d.ts.map +1 -0
- package/dist/commands/apply/whitespace.d.ts +58 -0
- package/dist/commands/apply/whitespace.d.ts.map +1 -0
- package/dist/commands/attributes-source.d.ts +26 -0
- package/dist/commands/attributes-source.d.ts.map +1 -0
- package/dist/commands/backfill-command.d.ts +110 -0
- package/dist/commands/backfill-command.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-checkout.d.ts +64 -0
- package/dist/commands/bisect/bisect-checkout.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-command.d.ts +201 -0
- package/dist/commands/bisect/bisect-command.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-engine.d.ts +219 -0
- package/dist/commands/bisect/bisect-engine.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-graph.d.ts +127 -0
- package/dist/commands/bisect/bisect-graph.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-quote.d.ts +27 -0
- package/dist/commands/bisect/bisect-quote.d.ts.map +1 -0
- package/dist/commands/bisect/index.d.ts +5 -0
- package/dist/commands/bisect/index.d.ts.map +1 -0
- package/dist/commands/blame-command.d.ts +122 -131
- package/dist/commands/blame-command.d.ts.map +1 -1
- package/dist/commands/branch-command.d.ts +52 -2
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/branch-tracking.d.ts +98 -0
- package/dist/commands/branch-tracking.d.ts.map +1 -0
- package/dist/commands/checkout-command.d.ts +300 -18
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/checkout-paths.d.ts +124 -0
- package/dist/commands/checkout-paths.d.ts.map +1 -0
- package/dist/commands/cherry-pick-command.d.ts +50 -42
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +49 -16
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +117 -0
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +311 -17
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/core-config.d.ts +78 -1
- package/dist/commands/core-config.d.ts.map +1 -1
- package/dist/commands/date-format.d.ts +58 -0
- package/dist/commands/date-format.d.ts.map +1 -0
- package/dist/commands/describe-command.d.ts.map +1 -1
- package/dist/commands/diff-command.d.ts +377 -30
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/diff-textconv.d.ts +40 -0
- package/dist/commands/diff-textconv.d.ts.map +1 -0
- package/dist/commands/fetch-command.d.ts +149 -10
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/format-patch-command.d.ts +164 -0
- package/dist/commands/format-patch-command.d.ts.map +1 -0
- package/dist/commands/fsck/fetch-fsck.d.ts +60 -0
- package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-command.d.ts +225 -0
- package/dist/commands/fsck/fsck-command.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-loose.d.ts +68 -0
- package/dist/commands/fsck/fsck-loose.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-msg-ids.d.ts +122 -0
- package/dist/commands/fsck/fsck-msg-ids.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-object-checks.d.ts +148 -0
- package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-object-table.d.ts +132 -0
- package/dist/commands/fsck/fsck-object-table.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-pack.d.ts +115 -0
- package/dist/commands/fsck/fsck-pack.d.ts.map +1 -0
- package/dist/commands/fsck/index.d.ts +6 -0
- package/dist/commands/fsck/index.d.ts.map +1 -0
- package/dist/commands/fsck/verify-pack-command.d.ts +81 -0
- package/dist/commands/fsck/verify-pack-command.d.ts.map +1 -0
- package/dist/commands/gc-command.d.ts +43 -0
- package/dist/commands/gc-command.d.ts.map +1 -1
- package/dist/commands/git-date.d.ts +66 -0
- package/dist/commands/git-date.d.ts.map +1 -0
- package/dist/commands/git-describe.d.ts +67 -0
- package/dist/commands/git-describe.d.ts.map +1 -0
- package/dist/commands/git-hooks.d.ts +416 -0
- package/dist/commands/git-hooks.d.ts.map +1 -0
- package/dist/commands/git-ident.d.ts +128 -0
- package/dist/commands/git-ident.d.ts.map +1 -0
- package/dist/commands/hook-command.d.ts +96 -0
- package/dist/commands/hook-command.d.ts.map +1 -0
- package/dist/commands/index-adder.d.ts +231 -0
- package/dist/commands/index-adder.d.ts.map +1 -0
- package/dist/commands/index-host.d.ts +86 -0
- package/dist/commands/index-host.d.ts.map +1 -0
- package/dist/commands/index.d.ts +54 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +3 -2
- package/dist/commands/init-command.d.ts +12 -1
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/local-clone.d.ts +60 -0
- package/dist/commands/local-clone.d.ts.map +1 -0
- package/dist/commands/local-transport.d.ts +117 -0
- package/dist/commands/local-transport.d.ts.map +1 -0
- package/dist/commands/log-command.d.ts +216 -24
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-graph.d.ts +120 -0
- package/dist/commands/log-graph.d.ts.map +1 -0
- package/dist/commands/log-output.d.ts +323 -0
- package/dist/commands/log-output.d.ts.map +1 -0
- package/dist/commands/ls-remote-command.d.ts +23 -7
- package/dist/commands/ls-remote-command.d.ts.map +1 -1
- package/dist/commands/mailmap.d.ts +31 -0
- package/dist/commands/mailmap.d.ts.map +1 -0
- package/dist/commands/merge-bases.d.ts +85 -0
- package/dist/commands/merge-bases.d.ts.map +1 -0
- package/dist/commands/merge-command.d.ts +209 -74
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-config.d.ts +13 -0
- package/dist/commands/merge-config.d.ts.map +1 -0
- package/dist/commands/merge-drivers.d.ts +130 -0
- package/dist/commands/merge-drivers.d.ts.map +1 -0
- package/dist/commands/merge-support.d.ts +252 -0
- package/dist/commands/merge-support.d.ts.map +1 -0
- package/dist/commands/message-cleanup.d.ts +86 -0
- package/dist/commands/message-cleanup.d.ts.map +1 -0
- package/dist/commands/mv-command.d.ts +94 -0
- package/dist/commands/mv-command.d.ts.map +1 -0
- package/dist/commands/notes-command.d.ts +256 -0
- package/dist/commands/notes-command.d.ts.map +1 -0
- package/dist/commands/notes-commands.d.ts +41 -0
- package/dist/commands/notes-commands.d.ts.map +1 -0
- package/dist/commands/notes-merge-command.d.ts +105 -0
- package/dist/commands/notes-merge-command.d.ts.map +1 -0
- package/dist/commands/notes-support.d.ts +125 -0
- package/dist/commands/notes-support.d.ts.map +1 -0
- package/dist/commands/notes-tree.d.ts +106 -0
- package/dist/commands/notes-tree.d.ts.map +1 -0
- package/dist/commands/object-id-input.d.ts +20 -0
- package/dist/commands/object-id-input.d.ts.map +1 -0
- package/dist/commands/octopus-merge.d.ts +59 -0
- package/dist/commands/octopus-merge.d.ts.map +1 -0
- package/dist/commands/ort-merge.d.ts +126 -0
- package/dist/commands/ort-merge.d.ts.map +1 -0
- package/dist/commands/ort-recursive.d.ts +53 -0
- package/dist/commands/ort-recursive.d.ts.map +1 -0
- package/dist/commands/pack-refs-command.d.ts +20 -0
- package/dist/commands/pack-refs-command.d.ts.map +1 -1
- package/dist/commands/patch-id.d.ts +41 -0
- package/dist/commands/patch-id.d.ts.map +1 -0
- package/dist/commands/pathspec-attributes.d.ts +64 -0
- package/dist/commands/pathspec-attributes.d.ts.map +1 -0
- package/dist/commands/pathspec.d.ts +324 -0
- package/dist/commands/pathspec.d.ts.map +1 -0
- package/dist/commands/post-index-change.d.ts +33 -0
- package/dist/commands/post-index-change.d.ts.map +1 -0
- package/dist/commands/pretty-format.d.ts +222 -0
- package/dist/commands/pretty-format.d.ts.map +1 -0
- package/dist/commands/promisor-remote.d.ts +80 -0
- package/dist/commands/promisor-remote.d.ts.map +1 -0
- package/dist/commands/pull-command.d.ts +41 -8
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +24 -8
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/read-tree-command.d.ts +112 -0
- package/dist/commands/read-tree-command.d.ts.map +1 -0
- package/dist/commands/rebase-command.d.ts +507 -75
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/rebase-todo.d.ts +130 -0
- package/dist/commands/rebase-todo.d.ts.map +1 -0
- package/dist/commands/ref-decoration-filter.d.ts +53 -0
- package/dist/commands/ref-decoration-filter.d.ts.map +1 -0
- package/dist/commands/reflog-messages.d.ts +98 -0
- package/dist/commands/reflog-messages.d.ts.map +1 -0
- package/dist/commands/remote-command.d.ts +31 -0
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/remote-transport.d.ts +120 -0
- package/dist/commands/remote-transport.d.ts.map +1 -0
- package/dist/commands/reset-command.d.ts +161 -7
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts +103 -0
- package/dist/commands/restore-command.d.ts.map +1 -0
- package/dist/commands/rev-list-command.d.ts +78 -0
- package/dist/commands/rev-list-command.d.ts.map +1 -0
- package/dist/commands/rev-parse-command.d.ts +80 -0
- package/dist/commands/rev-parse-command.d.ts.map +1 -0
- package/dist/commands/revert-command.d.ts +46 -38
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-filenames.d.ts +95 -0
- package/dist/commands/revision-filenames.d.ts.map +1 -0
- package/dist/commands/revision-range.d.ts +67 -0
- package/dist/commands/revision-range.d.ts.map +1 -0
- package/dist/commands/revision-resolver.d.ts +321 -0
- package/dist/commands/revision-resolver.d.ts.map +1 -0
- package/dist/commands/rm-command.d.ts +69 -7
- package/dist/commands/rm-command.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +191 -0
- package/dist/commands/sequencer-pick.d.ts.map +1 -0
- package/dist/commands/sequencer-support.d.ts +125 -0
- package/dist/commands/sequencer-support.d.ts.map +1 -0
- package/dist/commands/serve-repository.d.ts +52 -0
- package/dist/commands/serve-repository.d.ts.map +1 -0
- package/dist/commands/sparse-checkout-command.d.ts +190 -0
- package/dist/commands/sparse-checkout-command.d.ts.map +1 -0
- package/dist/commands/sparse-checkout-support.d.ts +268 -0
- package/dist/commands/sparse-checkout-support.d.ts.map +1 -0
- package/dist/commands/stash-apply-command.d.ts +42 -8
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-create-command.d.ts +155 -1
- package/dist/commands/stash-create-command.d.ts.map +1 -1
- package/dist/commands/stash-drop-command.d.ts +2 -0
- package/dist/commands/stash-drop-command.d.ts.map +1 -1
- package/dist/commands/stash-working-tree.d.ts +23 -0
- package/dist/commands/stash-working-tree.d.ts.map +1 -1
- package/dist/commands/status-command.d.ts +300 -15
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-format.d.ts +155 -0
- package/dist/commands/status-format.d.ts.map +1 -0
- package/dist/commands/status-header.d.ts +64 -0
- package/dist/commands/status-header.d.ts.map +1 -0
- package/dist/commands/strerror.d.ts +7 -0
- package/dist/commands/strerror.d.ts.map +1 -0
- package/dist/commands/submodule-config.d.ts +38 -0
- package/dist/commands/submodule-config.d.ts.map +1 -0
- package/dist/commands/submodule-summary-command.d.ts +80 -0
- package/dist/commands/submodule-summary-command.d.ts.map +1 -0
- package/dist/commands/submodule-summary.d.ts +150 -0
- package/dist/commands/submodule-summary.d.ts.map +1 -0
- package/dist/commands/switch-command.d.ts +132 -0
- package/dist/commands/switch-command.d.ts.map +1 -0
- package/dist/commands/tag-command.d.ts +23 -2
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/tracking-info.d.ts +64 -0
- package/dist/commands/tracking-info.d.ts.map +1 -0
- package/dist/commands/trailers.d.ts +73 -0
- package/dist/commands/trailers.d.ts.map +1 -0
- package/dist/commands/tree-restore.d.ts +85 -1
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/untracked-cache-support.d.ts +53 -0
- package/dist/commands/untracked-cache-support.d.ts.map +1 -0
- package/dist/commands/worktree-add-command.d.ts +108 -0
- package/dist/commands/worktree-add-command.d.ts.map +1 -0
- package/dist/commands/worktree-list-command.d.ts +69 -0
- package/dist/commands/worktree-list-command.d.ts.map +1 -0
- package/dist/commands/worktree-lock-command.d.ts +44 -0
- package/dist/commands/worktree-lock-command.d.ts.map +1 -0
- package/dist/commands/worktree-overwrite-checks.d.ts +146 -6
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
- package/dist/commands/worktree-prune-command.d.ts +48 -0
- package/dist/commands/worktree-prune-command.d.ts.map +1 -0
- package/dist/commands/worktree-remove-command.d.ts +59 -0
- package/dist/commands/worktree-remove-command.d.ts.map +1 -0
- package/dist/commands/worktree-repair-command.d.ts +35 -0
- package/dist/commands/worktree-repair-command.d.ts.map +1 -0
- package/dist/commands/worktree-support.d.ts +64 -0
- package/dist/commands/worktree-support.d.ts.map +1 -0
- package/dist/commands-DnmlfwGV.js +61620 -0
- package/dist/core-commands/add.command.impl.d.ts.map +1 -1
- package/dist/errors/add-errors.d.ts +55 -0
- package/dist/errors/add-errors.d.ts.map +1 -1
- package/dist/errors/checkout-errors.d.ts +16 -0
- package/dist/errors/checkout-errors.d.ts.map +1 -1
- package/dist/errors/command-errors.d.ts +77 -0
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/commit-errors.d.ts +9 -0
- package/dist/errors/commit-errors.d.ts.map +1 -1
- package/dist/errors/git-api-error.d.ts +59 -2
- package/dist/errors/git-api-error.d.ts.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +354 -19
- package/dist/errors/rebase-errors.d.ts +9 -0
- package/dist/errors/rebase-errors.d.ts.map +1 -1
- package/dist/errors/ref-errors.d.ts +32 -0
- package/dist/errors/ref-errors.d.ts.map +1 -1
- package/dist/errors/transport-errors.d.ts +12 -2
- package/dist/errors/transport-errors.d.ts.map +1 -1
- package/dist/errors/worktree-errors.d.ts +35 -0
- package/dist/errors/worktree-errors.d.ts.map +1 -0
- package/dist/git-command-DxvwPrPB.js +7612 -0
- package/dist/git-command.d.ts +413 -32
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +306 -3
- package/dist/git.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/remote-config/remote-config-store.d.ts +105 -3
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/remote-config/remote-refs.d.ts +7 -3
- package/dist/remote-config/remote-refs.d.ts.map +1 -1
- package/dist/rename/detect-renames.d.ts +148 -0
- package/dist/rename/detect-renames.d.ts.map +1 -0
- package/dist/rename/git-similarity.d.ts +44 -0
- package/dist/rename/git-similarity.d.ts.map +1 -0
- package/dist/rename/index.d.ts +2 -0
- package/dist/rename/index.d.ts.map +1 -1
- package/dist/results/binary-patch.d.ts +11 -0
- package/dist/results/binary-patch.d.ts.map +1 -0
- package/dist/results/blame-format.d.ts +55 -0
- package/dist/results/blame-format.d.ts.map +1 -0
- package/dist/results/cherry-pick-result.d.ts +10 -0
- package/dist/results/cherry-pick-result.d.ts.map +1 -1
- package/dist/results/clone-result.d.ts +10 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/combined-diff.d.ts +77 -0
- package/dist/results/combined-diff.d.ts.map +1 -0
- package/dist/results/diff-entry.d.ts +32 -0
- package/dist/results/diff-entry.d.ts.map +1 -1
- package/dist/results/diff-formatter.d.ts +34 -60
- package/dist/results/diff-formatter.d.ts.map +1 -1
- package/dist/results/diff-order.d.ts +25 -0
- package/dist/results/diff-order.d.ts.map +1 -0
- package/dist/results/diff-output.d.ts +249 -0
- package/dist/results/diff-output.d.ts.map +1 -0
- package/dist/results/fetch-result.d.ts +15 -0
- package/dist/results/fetch-result.d.ts.map +1 -1
- package/dist/results/index.d.ts +5 -0
- package/dist/results/index.d.ts.map +1 -1
- package/dist/results/index.js +2 -252
- package/dist/results/merge-result.d.ts +15 -1
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/pull-result.d.ts +12 -3
- package/dist/results/pull-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +42 -0
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/quote-path.d.ts +27 -0
- package/dist/results/quote-path.d.ts.map +1 -0
- package/dist/results/rebase-result.d.ts +28 -1
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/revert-result.d.ts +10 -0
- package/dist/results/revert-result.d.ts.map +1 -1
- package/dist/results/stash-result.d.ts +5 -0
- package/dist/results/stash-result.d.ts.map +1 -1
- package/dist/results/status-result.d.ts +60 -6
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/results-BZGa2Z3I.js +2934 -0
- package/dist/transport-command.d.ts +44 -1
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +15 -11
- package/src/commands/add-command.ts +1291 -226
- package/src/commands/add-patch/add-interactive.ts +941 -0
- package/src/commands/add-patch/add-patch.ts +1169 -0
- package/src/commands/add-patch/index.ts +5 -0
- package/src/commands/add-patch/patch-backend.ts +239 -0
- package/src/commands/add-patch/patch-modes.ts +249 -0
- package/src/commands/add-patch/patch-session.ts +159 -0
- package/src/commands/am/am-command.ts +1111 -0
- package/src/commands/am/index.ts +2 -0
- package/src/commands/am/mailinfo.ts +1015 -0
- package/src/commands/am/patch-format.ts +121 -0
- package/src/commands/apply/apply-command.ts +832 -0
- package/src/commands/apply/apply-engine.ts +1603 -0
- package/src/commands/apply/apply-parse.ts +1209 -0
- package/src/commands/apply/apply-types.ts +112 -0
- package/src/commands/apply/index.ts +5 -0
- package/src/commands/apply/latin1.ts +171 -0
- package/src/commands/apply/whitespace.ts +260 -0
- package/src/commands/attributes-source.ts +96 -0
- package/src/commands/backfill-command.ts +694 -0
- package/src/commands/bisect/bisect-checkout.ts +217 -0
- package/src/commands/bisect/bisect-command.ts +788 -0
- package/src/commands/bisect/bisect-engine.ts +1079 -0
- package/src/commands/bisect/bisect-graph.ts +595 -0
- package/src/commands/bisect/bisect-quote.ts +92 -0
- package/src/commands/bisect/index.ts +4 -0
- package/src/commands/blame-command.ts +711 -986
- package/src/commands/branch-command.ts +354 -32
- package/src/commands/branch-tracking.ts +331 -0
- package/src/commands/checkout-command.ts +1290 -243
- package/src/commands/checkout-paths.ts +784 -0
- package/src/commands/cherry-pick-command.ts +156 -396
- package/src/commands/clean-command.ts +504 -156
- package/src/commands/clone-command.ts +634 -67
- package/src/commands/commit-command.ts +1781 -166
- package/src/commands/core-config.ts +161 -6
- package/src/commands/date-format.ts +668 -0
- package/src/commands/describe-command.ts +2 -0
- package/src/commands/diff-command.ts +1898 -110
- package/src/commands/diff-textconv.ts +50 -0
- package/src/commands/fetch-command.ts +606 -66
- package/src/commands/format-patch-command.ts +969 -0
- package/src/commands/fsck/fetch-fsck.ts +229 -0
- package/src/commands/fsck/fsck-command.ts +3347 -0
- package/src/commands/fsck/fsck-loose.ts +287 -0
- package/src/commands/fsck/fsck-msg-ids.ts +176 -0
- package/src/commands/fsck/fsck-object-checks.ts +1044 -0
- package/src/commands/fsck/fsck-object-table.ts +363 -0
- package/src/commands/fsck/fsck-pack.ts +604 -0
- package/src/commands/fsck/index.ts +5 -0
- package/src/commands/fsck/verify-pack-command.ts +249 -0
- package/src/commands/gc-command.ts +147 -1
- package/src/commands/git-date.ts +895 -0
- package/src/commands/git-describe.ts +316 -0
- package/src/commands/git-hooks.ts +1472 -0
- package/src/commands/git-ident.ts +344 -0
- package/src/commands/hook-command.ts +247 -0
- package/src/commands/index-adder.ts +706 -0
- package/src/commands/index-host.ts +291 -0
- package/src/commands/index.ts +82 -0
- package/src/commands/init-command.ts +28 -4
- package/src/commands/local-clone.ts +183 -0
- package/src/commands/local-transport.ts +762 -0
- package/src/commands/log-command.ts +1915 -170
- package/src/commands/log-graph.ts +671 -0
- package/src/commands/log-output.ts +1359 -0
- package/src/commands/ls-remote-command.ts +101 -58
- package/src/commands/mailmap.ts +129 -0
- package/src/commands/merge-bases.ts +296 -0
- package/src/commands/merge-command.ts +1386 -491
- package/src/commands/merge-config.ts +25 -0
- package/src/commands/merge-drivers.ts +306 -0
- package/src/commands/merge-support.ts +1198 -0
- package/src/commands/message-cleanup.ts +275 -0
- package/src/commands/mv-command.ts +976 -0
- package/src/commands/notes-command.ts +890 -0
- package/src/commands/notes-commands.ts +87 -0
- package/src/commands/notes-merge-command.ts +768 -0
- package/src/commands/notes-support.ts +402 -0
- package/src/commands/notes-tree.ts +602 -0
- package/src/commands/object-id-input.ts +27 -0
- package/src/commands/octopus-merge.ts +377 -0
- package/src/commands/ort-merge.ts +1660 -0
- package/src/commands/ort-recursive.ts +160 -0
- package/src/commands/pack-refs-command.ts +39 -22
- package/src/commands/patch-id.ts +196 -0
- package/src/commands/pathspec-attributes.ts +162 -0
- package/src/commands/pathspec.ts +1199 -0
- package/src/commands/post-index-change.ts +62 -0
- package/src/commands/pretty-format.ts +1431 -0
- package/src/commands/promisor-remote.ts +298 -0
- package/src/commands/pull-command.ts +207 -22
- package/src/commands/push-command.ts +236 -23
- package/src/commands/read-tree-command.ts +857 -0
- package/src/commands/rebase-command.ts +3808 -371
- package/src/commands/rebase-todo.ts +584 -0
- package/src/commands/ref-decoration-filter.ts +118 -0
- package/src/commands/reflog-messages.ts +177 -0
- package/src/commands/remote-command.ts +93 -22
- package/src/commands/remote-transport.ts +383 -0
- package/src/commands/reset-command.ts +827 -103
- package/src/commands/restore-command.ts +350 -0
- package/src/commands/rev-list-command.ts +167 -0
- package/src/commands/rev-parse-command.ts +277 -0
- package/src/commands/revert-command.ts +152 -399
- package/src/commands/revision-filenames.ts +254 -0
- package/src/commands/revision-range.ts +222 -0
- package/src/commands/revision-resolver.ts +1379 -0
- package/src/commands/rm-command.ts +613 -67
- package/src/commands/sequencer-pick.ts +869 -0
- package/src/commands/sequencer-support.ts +869 -0
- package/src/commands/serve-repository.ts +125 -0
- package/src/commands/sparse-checkout-command.ts +1389 -0
- package/src/commands/sparse-checkout-support.ts +793 -0
- package/src/commands/stash-apply-command.ts +376 -343
- package/src/commands/stash-create-command.ts +625 -42
- package/src/commands/stash-drop-command.ts +15 -2
- package/src/commands/stash-working-tree.ts +168 -24
- package/src/commands/status-command.ts +1328 -105
- package/src/commands/status-format.ts +775 -0
- package/src/commands/status-header.ts +330 -0
- package/src/commands/strerror.ts +29 -0
- package/src/commands/submodule-config.ts +94 -0
- package/src/commands/submodule-summary-command.ts +334 -0
- package/src/commands/submodule-summary.ts +446 -0
- package/src/commands/switch-command.ts +402 -0
- package/src/commands/tag-command.ts +129 -41
- package/src/commands/tracking-info.ts +201 -0
- package/src/commands/trailers.ts +417 -0
- package/src/commands/tree-restore.ts +204 -4
- package/src/commands/untracked-cache-support.ts +194 -0
- package/src/commands/worktree-add-command.ts +458 -0
- package/src/commands/worktree-list-command.ts +208 -0
- package/src/commands/worktree-lock-command.ts +96 -0
- package/src/commands/worktree-overwrite-checks.ts +452 -26
- package/src/commands/worktree-prune-command.ts +99 -0
- package/src/commands/worktree-remove-command.ts +186 -0
- package/src/commands/worktree-repair-command.ts +59 -0
- package/src/commands/worktree-support.ts +214 -0
- package/src/core-commands/add.command.impl.ts +7 -1
- package/src/errors/add-errors.ts +45 -0
- package/src/errors/checkout-errors.ts +26 -2
- package/src/errors/command-errors.ts +101 -1
- package/src/errors/commit-errors.ts +18 -2
- package/src/errors/git-api-error.ts +82 -2
- package/src/errors/index.ts +1 -0
- package/src/errors/merge-errors.ts +2 -2
- package/src/errors/rebase-errors.ts +12 -0
- package/src/errors/ref-errors.ts +56 -2
- package/src/errors/remote-errors.ts +2 -2
- package/src/errors/stash-errors.ts +1 -1
- package/src/errors/transport-errors.ts +20 -4
- package/src/errors/worktree-errors.ts +49 -0
- package/src/git-command.ts +1177 -118
- package/src/git.ts +523 -10
- package/src/index.ts +1 -1
- package/src/remote-config/remote-config-store.ts +242 -8
- package/src/remote-config/remote-refs.ts +22 -6
- package/src/rename/detect-renames.ts +711 -0
- package/src/rename/git-similarity.ts +116 -0
- package/src/rename/index.ts +2 -0
- package/src/results/binary-patch.ts +401 -0
- package/src/results/blame-format.ts +239 -0
- package/src/results/cherry-pick-result.ts +10 -0
- package/src/results/clone-result.ts +12 -0
- package/src/results/combined-diff.ts +585 -0
- package/src/results/diff-entry.ts +35 -0
- package/src/results/diff-formatter.ts +152 -288
- package/src/results/diff-order.ts +64 -0
- package/src/results/diff-output.ts +1051 -0
- package/src/results/fetch-result.ts +15 -0
- package/src/results/index.ts +5 -0
- package/src/results/merge-result.ts +15 -1
- package/src/results/pull-result.ts +12 -3
- package/src/results/push-result.ts +43 -0
- package/src/results/quote-path.ts +103 -0
- package/src/results/rebase-result.ts +37 -0
- package/src/results/revert-result.ts +10 -0
- package/src/results/stash-result.ts +6 -0
- package/src/results/status-result.ts +123 -45
- package/src/transport-command.ts +121 -2
- package/dist/commands-CsLNyvZ1.js +0 -12587
- package/dist/status-result-BpyUK1Sg.js +0 -519
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Blobs, ObjectId } from "@statewalker/vcs-core";
|
|
2
|
+
import type { CommandTrees } from "../git-command.js";
|
|
3
|
+
/** How a note added over an existing one combines with it (notes.h's combine_notes_fn). */
|
|
4
|
+
export type CombineNotes = (stores: NotesStores, cur: ObjectId, next: ObjectId) => Promise<ObjectId>;
|
|
5
|
+
/** The object stores a notes tree reads and writes. */
|
|
6
|
+
export interface NotesStores {
|
|
7
|
+
blobs: Blobs;
|
|
8
|
+
trees: CommandTrees;
|
|
9
|
+
}
|
|
10
|
+
/** combine_notes_overwrite: the new note replaces the one there. */
|
|
11
|
+
export declare const combineNotesOverwrite: CombineNotes;
|
|
12
|
+
/** combine_notes_ignore: the note there stays. */
|
|
13
|
+
export declare const combineNotesIgnore: CombineNotes;
|
|
14
|
+
/**
|
|
15
|
+
* combine_notes_concatenate: the two notes joined by a blank line (the current one's final
|
|
16
|
+
* newline dropped); an empty or missing side gives the other.
|
|
17
|
+
*/
|
|
18
|
+
export declare const combineNotesConcatenate: CombineNotes;
|
|
19
|
+
/**
|
|
20
|
+
* combine_notes_cat_sort_uniq: the lines of both notes, empty ones dropped, sorted (byte
|
|
21
|
+
* order) and unique, each ended by a newline.
|
|
22
|
+
*/
|
|
23
|
+
export declare const combineNotesCatSortUniq: CombineNotes;
|
|
24
|
+
/** notes-utils.c's parse_combine_notes_fn (case-insensitive), undefined for another name. */
|
|
25
|
+
export declare function parseCombineNotes(name: string): CombineNotes | undefined;
|
|
26
|
+
/** for_each_note flags (notes.h). */
|
|
27
|
+
export declare const FOR_EACH_NOTE_DONT_UNPACK_SUBTREES = 1;
|
|
28
|
+
export declare const FOR_EACH_NOTE_YIELD_SUBTREES = 2;
|
|
29
|
+
/** A for_each_note callback: true stops the walk. */
|
|
30
|
+
export type EachNote = (object: string, note: ObjectId, path: string) => Promise<boolean | undefined>;
|
|
31
|
+
/** notes.c's in-memory notes tree (struct notes_tree). */
|
|
32
|
+
export declare class NotesTree {
|
|
33
|
+
private readonly stores;
|
|
34
|
+
/** The tree's combine function (t->combine_notes) */
|
|
35
|
+
readonly combine: CombineNotes;
|
|
36
|
+
private readonly root;
|
|
37
|
+
private readonly nonNotes;
|
|
38
|
+
/** A change was made since loading (t->dirty) */
|
|
39
|
+
dirty: boolean;
|
|
40
|
+
private constructor();
|
|
41
|
+
/**
|
|
42
|
+
* init_notes's load: the stored tree `treeId` as an unread subtree of the root (read
|
|
43
|
+
* one level now); an empty tree without `treeId`.
|
|
44
|
+
*/
|
|
45
|
+
static load(stores: NotesStores, treeId: ObjectId | undefined, combine?: CombineNotes): Promise<NotesTree>;
|
|
46
|
+
/** get_note: the note of `object`, undefined when it has none. */
|
|
47
|
+
get(object: ObjectId): Promise<ObjectId | undefined>;
|
|
48
|
+
/** add_note: `note` for `object`, combined with one there (default: the tree's). */
|
|
49
|
+
add(object: ObjectId, note: ObjectId, combine?: CombineNotes): Promise<void>;
|
|
50
|
+
/** remove_note: whether `object` had a note (then removed). */
|
|
51
|
+
remove(object: ObjectId): Promise<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* copy_note: the note of `from` copied to `to` (`to`'s removed when `from` has none);
|
|
54
|
+
* false when `to` has one and `force` is not set.
|
|
55
|
+
*/
|
|
56
|
+
copy(from: ObjectId, to: ObjectId, force: boolean, combine?: CombineNotes): Promise<boolean>;
|
|
57
|
+
/** for_each_note: the notes (and with the flags, subtrees) in id order. */
|
|
58
|
+
forEach(flags: number, fn: EachNote): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* write_notes_tree: the tree objects written, the root's id.
|
|
61
|
+
*
|
|
62
|
+
* The non-notes are woven in as git weaves them: after the last one written (nn_prev),
|
|
63
|
+
* those up to each note's path. A subtree the walk reads meanwhile (one deeper than the
|
|
64
|
+
* fanout) can bring a non-note that sorts before the last one written: git never goes
|
|
65
|
+
* back for it, so it is dropped from the tree written, here too.
|
|
66
|
+
*
|
|
67
|
+
* Known difference: git writes each tree's entries in the order it weaves them, and that
|
|
68
|
+
* order is not always git's tree order (`x` and `x-y` beside a directory `x`, or a
|
|
69
|
+
* non-note of a subtree read late that sorts before an entry already written); git then
|
|
70
|
+
* writes an unsorted tree. Trees here go through the tree store, which writes its entries
|
|
71
|
+
* sorted (there is no writer of raw entry order), so such a tree gets another id.
|
|
72
|
+
*/
|
|
73
|
+
write(): Promise<ObjectId>;
|
|
74
|
+
/**
|
|
75
|
+
* prune_notes's walk: the objects whose notes `exists` refuses, in the order git lists them
|
|
76
|
+
* (the walk's, reversed).
|
|
77
|
+
*/
|
|
78
|
+
unreachableObjects(exists: (id: ObjectId) => Promise<boolean>): Promise<ObjectId[]>;
|
|
79
|
+
/** note_tree_search: the slot for `key` (subtrees on the way read). */
|
|
80
|
+
private search;
|
|
81
|
+
/** note_tree_consolidate: an int_node of one note (or none) replaced by it. */
|
|
82
|
+
private consolidate;
|
|
83
|
+
/** note_tree_remove: the note of `key` removed, its value; undefined when none. */
|
|
84
|
+
private removeLeaf;
|
|
85
|
+
/** note_tree_insert */
|
|
86
|
+
private insert;
|
|
87
|
+
/** add_non_note: sorted by path, a path given again replacing the entry. */
|
|
88
|
+
private addNonNote;
|
|
89
|
+
/** load_subtree: the entries of a stored (sub)tree inserted at `node`, level `n`. */
|
|
90
|
+
private loadSubtree;
|
|
91
|
+
/** determine_fanout */
|
|
92
|
+
private determineFanout;
|
|
93
|
+
/** for_each_note_helper */
|
|
94
|
+
private forEachHelper;
|
|
95
|
+
/** tree_write_stack_finish_subtree */
|
|
96
|
+
private finishSubtree;
|
|
97
|
+
/** write_each_note_helper */
|
|
98
|
+
private writeEntry;
|
|
99
|
+
}
|
|
100
|
+
/** notes.c's GIT_NOTES_DEFAULT_REF */
|
|
101
|
+
export declare const NOTES_DEFAULT_REF = "refs/notes/commits";
|
|
102
|
+
/** The null object id, which adding as a note removes one. */
|
|
103
|
+
export declare const NOTES_NULL_ID: string;
|
|
104
|
+
/** Reads a note blob's bytes (undefined for a missing one). */
|
|
105
|
+
export declare function readNoteBytes(blobs: Blobs, id: ObjectId): Promise<Uint8Array | undefined>;
|
|
106
|
+
//# sourceMappingURL=notes-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes-tree.d.ts","sourceRoot":"","sources":["../../src/commands/notes-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAa,MAAM,uBAAuB,CAAC;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAkDtD,2FAA2F;AAC3F,MAAM,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,QAAQ,KACX,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACrB;AA0CD,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,EAAE,YAA6C,CAAC;AAElF,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,EAAE,Y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in the form stores and refs hold it: lowercase, as git's
|
|
8
|
+
* `get_oid_hex` reads either case (`ABCD...` names the object `abcd...`). Anything else is
|
|
9
|
+
* returned as given.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* canonicalObjectId("D90F7D2AD59FC2F2D12C4A4BAEA96C445B5E625D"); // "d90f7d2a..."
|
|
14
|
+
* canonicalObjectId("main"); // "main"
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function canonicalObjectId<T extends string>(id: T): T;
|
|
18
|
+
/** Whether `id` is a full hexadecimal object id, in either case. */
|
|
19
|
+
export declare function isFullHexObjectId(id: string): boolean;
|
|
20
|
+
//# sourceMappingURL=object-id-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-id-input.d.ts","sourceRoot":"","sources":["../../src/commands/object-id-input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAE5D;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's octopus strategy (`git merge A B C`, git-merge-octopus.sh): the heads merged one
|
|
3
|
+
* after the other into the running result, each first as a trivial merge
|
|
4
|
+
* (`read-tree -m --aggressive` against its merge bases), the paths that are not trivial
|
|
5
|
+
* then merged file by file (`merge-index -o git-merge-one-file -a`). Only the last head may
|
|
6
|
+
* leave conflicts to resolve by hand; a conflict with an earlier head makes the octopus give
|
|
7
|
+
* up ("Should not be doing an octopus."), as does a dirty index.
|
|
8
|
+
*
|
|
9
|
+
* Computed in memory: the caller writes the outcome (index, worktree, MERGE_HEAD) or, when
|
|
10
|
+
* the strategy gave up, leaves everything as it was (git's restore_state).
|
|
11
|
+
*/
|
|
12
|
+
import { type Blobs, type ObjectId } from "@statewalker/vcs-core";
|
|
13
|
+
import { type ConflictStyle } from "@statewalker/vcs-utils";
|
|
14
|
+
import type { CommandCommits, CommandTrees } from "../git-command.js";
|
|
15
|
+
import { type OrtConflict } from "./ort-merge.js";
|
|
16
|
+
import type { CheckedEntry } from "./worktree-overwrite-checks.js";
|
|
17
|
+
/** A head to merge and the name git's messages give it (as the user named it). */
|
|
18
|
+
export interface OctopusHead {
|
|
19
|
+
id: ObjectId;
|
|
20
|
+
name: string;
|
|
21
|
+
}
|
|
22
|
+
/** What the octopus did. */
|
|
23
|
+
export interface OctopusOutcome {
|
|
24
|
+
/** git-merge-octopus's exit: 0 merged, 1 conflicts left (last head), 2 gave up */
|
|
25
|
+
status: 0 | 1 | 2;
|
|
26
|
+
/** What it printed on stdout */
|
|
27
|
+
output: string[];
|
|
28
|
+
/** What it printed on stderr */
|
|
29
|
+
errors: string[];
|
|
30
|
+
/** The index's stage-0 entries */
|
|
31
|
+
index: Map<string, CheckedEntry>;
|
|
32
|
+
/** The worktree where it differs from the index (files with conflict markers) */
|
|
33
|
+
worktree: Map<string, CheckedEntry>;
|
|
34
|
+
/** The conflicts left, staged 1-3 */
|
|
35
|
+
conflicts: OrtConflict[];
|
|
36
|
+
/**
|
|
37
|
+
* Per head merged (not already up to date): how much of `output` the script had printed
|
|
38
|
+
* once it went for that head, and the paths that head changed in the index or worktree.
|
|
39
|
+
* The script writes the worktree head by head, so a local change in the way stops it at
|
|
40
|
+
* the first head that touches it.
|
|
41
|
+
*/
|
|
42
|
+
steps: {
|
|
43
|
+
output: number;
|
|
44
|
+
paths: Set<string>;
|
|
45
|
+
}[];
|
|
46
|
+
}
|
|
47
|
+
/** What the octopus needs. */
|
|
48
|
+
export interface OctopusContext {
|
|
49
|
+
commits: CommandCommits;
|
|
50
|
+
trees: CommandTrees;
|
|
51
|
+
blobs: Blobs;
|
|
52
|
+
style?: ConflictStyle;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Runs git-merge-octopus for `heads` on top of `headId` (the index matching HEAD's tree,
|
|
56
|
+
* `indexDiffers` listing the paths where it does not).
|
|
57
|
+
*/
|
|
58
|
+
export declare function octopusMerge(ctx: OctopusContext, headId: ObjectId, heads: OctopusHead[], indexDiffers: string[]): Promise<OctopusOutcome>;
|
|
59
|
+
//# sourceMappingURL=octopus-merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"octopus-merge.d.ts","sourceRoot":"","sources":["../../src/commands/octopus-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAiB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItE,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,4BAA4B;AAC5B,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClB,gCAAgC;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gCAAgC;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kCAAkC;IAClC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACjC,iFAAiF;IACjF,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,qCAAqC;IACrC,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB;;;;;OAKG;IACH,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE,EAAE,CAAC;CACjD;AAED,8BAA8B;AAC9B,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AA0CD;;;GAGG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,WAAW,EAAE,EACpB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,cAAc,CAAC,CAuHzB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's merge-ort on flat trees (path -> blob, link or gitlink): the merge `merge`,
|
|
3
|
+
* `cherry-pick`, `revert`, `rebase` and `stash apply` run, without writing anything but the
|
|
4
|
+
* blobs of content merges.
|
|
5
|
+
*
|
|
6
|
+
* A port of merge-ort.c's structure: every path (file or directory) of the three trees gets
|
|
7
|
+
* an entry with its three versions (`collect_merge_info`); renames are detected on each side
|
|
8
|
+
* (exact, by basename, then by similarity, for the paths the merge needs), directory renames
|
|
9
|
+
* derived from them move what the other side added into the new directory
|
|
10
|
+
* (`merge.directoryRenames`); then each entry is resolved (`process_entry`), children before
|
|
11
|
+
* their directory, so that a file meeting a directory moves aside only when the directory
|
|
12
|
+
* stays. The result is merge-ort's tree, the conflicted index entries and the messages,
|
|
13
|
+
* sorted by path as git prints them.
|
|
14
|
+
*
|
|
15
|
+
* With `callDepth` > 0 it is one of the inner merges of merge bases that build a virtual
|
|
16
|
+
* merge base (`merge_ort_internal`): longer conflict markers, no messages, conflicts
|
|
17
|
+
* resolved to the base's version where git does, no directory renames.
|
|
18
|
+
*/
|
|
19
|
+
import { type Blobs, type ObjectId } from "@statewalker/vcs-core";
|
|
20
|
+
import type { ConflictStyle } from "@statewalker/vcs-utils";
|
|
21
|
+
import { type MergeAttributeValue, type MergeDriverRegistry } from "./merge-drivers.js";
|
|
22
|
+
import type { CheckedEntry } from "./worktree-overwrite-checks.js";
|
|
23
|
+
/** A path the merge could not resolve, as merge-ort leaves it in the index. */
|
|
24
|
+
export interface OrtConflict {
|
|
25
|
+
base?: CheckedEntry;
|
|
26
|
+
ours?: CheckedEntry;
|
|
27
|
+
theirs?: CheckedEntry;
|
|
28
|
+
/** Where the stages (and the worktree file) go: the path, or `<path>~<side>` */
|
|
29
|
+
stagePath: string;
|
|
30
|
+
/** The file with conflict markers, for a text conflict (unused: see `tree`) */
|
|
31
|
+
content?: Uint8Array;
|
|
32
|
+
/** What the worktree gets at `stagePath` where it differs from our side's version */
|
|
33
|
+
write?: CheckedEntry;
|
|
34
|
+
/** The path a file/directory or distinct-types conflict moves ours away from */
|
|
35
|
+
moveFrom?: string;
|
|
36
|
+
/** What merge-ort's result tree holds at `stagePath` (none: nothing there) */
|
|
37
|
+
tree?: CheckedEntry;
|
|
38
|
+
mode: number;
|
|
39
|
+
}
|
|
40
|
+
/** `merge.directoryRenames`: apply them, leave paths as they are, or apply with a conflict. */
|
|
41
|
+
export type DirectoryRenames = "true" | "false" | "conflict";
|
|
42
|
+
/** The attributes a content merge reads for a path (`merge`, `conflict-marker-size`). */
|
|
43
|
+
export interface MergeAttributes {
|
|
44
|
+
merge?: MergeAttributeValue;
|
|
45
|
+
conflictMarkerSize?: MergeAttributeValue;
|
|
46
|
+
}
|
|
47
|
+
/** Options of {@link ortMerge}. */
|
|
48
|
+
export interface OrtMergeOptions {
|
|
49
|
+
/** Our side's name in markers and messages (git's branch1, e.g. `HEAD`) */
|
|
50
|
+
oursLabel: string;
|
|
51
|
+
/** Their side's name (git's branch2: the branch, or `<abbrev> (<subject>)`) */
|
|
52
|
+
theirsLabel: string;
|
|
53
|
+
/** The base's name after `|||||||` (diff3, zdiff3) */
|
|
54
|
+
baseLabel?: string;
|
|
55
|
+
/** Names a file moved aside gets (`<path>~<name>`); default the labels */
|
|
56
|
+
oursName?: string;
|
|
57
|
+
theirsName?: string;
|
|
58
|
+
/** merge.conflictStyle */
|
|
59
|
+
style?: ConflictStyle;
|
|
60
|
+
/** `-X ours`, `-X theirs`: conflicting hunks (and binary files) resolved to a side */
|
|
61
|
+
favor?: "ours" | "theirs" | "union";
|
|
62
|
+
/** A case-folding worktree (core.ignorecase): names taken in another case are taken */
|
|
63
|
+
ignoreCase?: boolean;
|
|
64
|
+
/** Detect renames (default true) */
|
|
65
|
+
renames?: boolean;
|
|
66
|
+
/** merge.directoryRenames (default `conflict`, as git) */
|
|
67
|
+
directoryRenames?: DirectoryRenames;
|
|
68
|
+
/** merge.renameLimit (default 7000, as merge-ort) */
|
|
69
|
+
renameLimit?: number;
|
|
70
|
+
/** Files above this size are binary to the merge (core.bigFileThreshold) */
|
|
71
|
+
bigFileThreshold?: number;
|
|
72
|
+
/** The recursion level of a merge of merge bases (merge-ort's call_depth; default 0) */
|
|
73
|
+
callDepth?: number;
|
|
74
|
+
/** merge.renormalize / `-X renormalize`: content compared and merged as checked in afresh */
|
|
75
|
+
renormalize?: boolean;
|
|
76
|
+
/** The `merge` and `conflict-marker-size` attributes of a path (none: unspecified) */
|
|
77
|
+
attributes?: (path: string) => Promise<MergeAttributes>;
|
|
78
|
+
/** git's renormalize_buffer for a path (with `renormalize`) */
|
|
79
|
+
renormalizeContent?: (path: string, content: Uint8Array) => Promise<Uint8Array>;
|
|
80
|
+
/** Merge drivers by name (the `merge` attribute, `merge.default`) */
|
|
81
|
+
drivers?: MergeDriverRegistry;
|
|
82
|
+
/** merge.default: the driver of a path without a `merge` attribute */
|
|
83
|
+
defaultDriver?: string;
|
|
84
|
+
/** merge.<driver>.recursive: the driver used in merges of merge bases */
|
|
85
|
+
recursiveDriver?: (name: string) => string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The trees given as {@link prunedFlatTrees} reads them (directories all three hold alike
|
|
88
|
+
* stand as one TREE entry): per tree (base, ours, theirs), the id of each directory, so a
|
|
89
|
+
* directory taken whole from a side is the side's tree, never read.
|
|
90
|
+
*/
|
|
91
|
+
dirTrees?: Map<string, ObjectId>[];
|
|
92
|
+
}
|
|
93
|
+
/** What {@link ortMerge} found. */
|
|
94
|
+
export interface OrtMergeResult {
|
|
95
|
+
/** The cleanly merged entries */
|
|
96
|
+
result: Map<string, CheckedEntry>;
|
|
97
|
+
/** The conflicts, by the path they are staged at */
|
|
98
|
+
conflicts: Map<string, OrtConflict>;
|
|
99
|
+
/** Whether merge-ort calls the merge clean (no conflicts, no directory rename trouble) */
|
|
100
|
+
clean: boolean;
|
|
101
|
+
/** merge-ort's messages (`Auto-merging x`, `CONFLICT (...)`), in git's order */
|
|
102
|
+
messages: string[];
|
|
103
|
+
/** Whether directory renames were found (paths may move into any directory) */
|
|
104
|
+
directoryRenames?: boolean;
|
|
105
|
+
}
|
|
106
|
+
/** Reads a blob whole. */
|
|
107
|
+
export declare function readBlob(blobs: Blobs, id: ObjectId): Promise<Uint8Array>;
|
|
108
|
+
/**
|
|
109
|
+
* How often merges took merge-ort's paths that leave no trace in their result, for tests:
|
|
110
|
+
* `redos` counts the merges redone with the renames the first pass found
|
|
111
|
+
* (redo_after_renames). Not part of the package's API.
|
|
112
|
+
*/
|
|
113
|
+
export declare const ortMergeCounters: {
|
|
114
|
+
redos: number;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Merges `theirs` into `ours` against `base`, as git's merge-ort
|
|
118
|
+
* (`merge_ort_nonrecursive_internal`). Content-merged blobs are stored in `blobs`.
|
|
119
|
+
*/
|
|
120
|
+
export declare function ortMerge(blobs: Blobs, baseIn: Map<string, CheckedEntry>, oursIn: Map<string, CheckedEntry>, theirsIn: Map<string, CheckedEntry>, options: OrtMergeOptions): Promise<OrtMergeResult>;
|
|
121
|
+
/**
|
|
122
|
+
* merge-ort's result tree as a flat map: the merged entries, and at each conflict's path
|
|
123
|
+
* what git's result tree holds there (the file with markers, the surviving side, ours).
|
|
124
|
+
*/
|
|
125
|
+
export declare function ortResultEntries(blobs: Blobs, merge: OrtMergeResult): Promise<Map<string, CheckedEntry>>;
|
|
126
|
+
//# sourceMappingURL=ort-merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ort-merge.d.ts","sourceRoot":"","sources":["../../src/commands/ort-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAY,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,qFAAqF;IACrF,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+FAA+F;AAC/F,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAE7D,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,kBAAkB,CAAC,EAAE,m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,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;CACpC;AAED,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAClC,oDAAoD;IACpD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpC,0FAA0F;IAC1F,KAAK,EAAE,OAAO,CAAC;IACf,gFAAgF;IAChF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAuBD,0BAA0B;AAC1B,wBAAsB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAI9E;AAiID;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IAAK,KAAK;CAAK,CAAC;AAE7C;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACjC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACnC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAEzB;AA2zCD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAapC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* merge-ort's virtual merge base (`merge_ort_internal`): with several merge bases, git
|
|
3
|
+
* merges them pairwise (the oldest first, "Temporary merge branch 1" and "2" in the
|
|
4
|
+
* markers, their own merge bases merged the same way) and uses the result as the base of the
|
|
5
|
+
* real merge, named "merged common ancestors". The virtual commits and their trees stay in
|
|
6
|
+
* memory; only the blobs of content merges are stored, as git stores them.
|
|
7
|
+
*/
|
|
8
|
+
import type { Blobs, ObjectId } from "@statewalker/vcs-core";
|
|
9
|
+
import type { CommandCommits, CommandTrees } from "../git-command.js";
|
|
10
|
+
import { type OrtMergeOptions, type OrtMergeResult } from "./ort-merge.js";
|
|
11
|
+
import type { CheckedEntry } from "./worktree-overwrite-checks.js";
|
|
12
|
+
/** The base a merge runs against, and its name after `|||||||`. */
|
|
13
|
+
export interface MergeBaseTree {
|
|
14
|
+
/** The base as a flat map (read on demand for a stored tree) */
|
|
15
|
+
tree(): Promise<Map<string, CheckedEntry>>;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the base is a stored tree, `treeId` (undefined: the empty tree), rather than a
|
|
18
|
+
* virtual merge base held in memory
|
|
19
|
+
*/
|
|
20
|
+
stored: boolean;
|
|
21
|
+
treeId?: ObjectId;
|
|
22
|
+
label: string;
|
|
23
|
+
}
|
|
24
|
+
/** What the virtual base needs of a command. */
|
|
25
|
+
export interface VirtualBaseContext {
|
|
26
|
+
commits: CommandCommits;
|
|
27
|
+
trees: CommandTrees;
|
|
28
|
+
blobs: Blobs;
|
|
29
|
+
/**
|
|
30
|
+
* A single merge base's label: git's `strbuf_add_unique_abbrev(..., DEFAULT_ABBREV)`
|
|
31
|
+
* (the command's `abbreviateObjectId`)
|
|
32
|
+
*/
|
|
33
|
+
abbreviate: (id: ObjectId) => Promise<string>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The base tree of a merge of `h1` and `h2` with merge bases `bases` (as merge-ort's
|
|
37
|
+
* merge_incore_recursive computes it): the empty tree ("empty tree") without a base, the
|
|
38
|
+
* base itself (its abbreviated id) with one, the virtual merge base ("merged common
|
|
39
|
+
* ancestors") with several.
|
|
40
|
+
*/
|
|
41
|
+
export declare function mergeBaseTree(ctx: VirtualBaseContext, h1: ObjectId, h2: ObjectId, bases: ObjectId[], options: Omit<OrtMergeOptions, "oursLabel" | "theirsLabel" | "baseLabel">): Promise<MergeBaseTree>;
|
|
42
|
+
/**
|
|
43
|
+
* merge-ort over stored trees: `ours` and `theirs` (tree ids) against `base`. A stored base
|
|
44
|
+
* merges the trees as merge-ort reads them (directories all three hold alike are never
|
|
45
|
+
* read, {@link prunedFlatTrees}); a virtual base, or a merge that finds directory renames
|
|
46
|
+
* (which may move a path into any directory), merges the whole trees.
|
|
47
|
+
*/
|
|
48
|
+
export declare function mergeStoredTrees(ctx: Pick<VirtualBaseContext, "trees" | "blobs">, base: MergeBaseTree, ours: ObjectId | undefined, theirs: ObjectId | undefined, options: OrtMergeOptions, flat?: (id: ObjectId | undefined) => Promise<Map<string, CheckedEntry>>): Promise<OrtMergeResult & {
|
|
49
|
+
ours: Map<string, CheckedEntry>;
|
|
50
|
+
}>;
|
|
51
|
+
/** A stored tree (undefined: the empty tree) as the base of {@link mergeStoredTrees}. */
|
|
52
|
+
export declare function storedBase(treeId: ObjectId | undefined, label: string, flat: () => Promise<Map<string, CheckedEntry>>): MergeBaseTree;
|
|
53
|
+
//# sourceMappingURL=ort-recursive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ort-recursive.d.ts","sourceRoot":"","sources":["../../src/commands/ort-recursive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAGpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC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GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,GAC7C,aAAa,CAEf"}
|
|
@@ -7,6 +7,12 @@ export interface PackRefsResult {
|
|
|
7
7
|
refsPacked: number;
|
|
8
8
|
/** Whether operation succeeded */
|
|
9
9
|
success: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* git's error lines (stderr), also in the hook output: a loose ref whose object is missing
|
|
12
|
+
* stays loose (`error: <ref> does not point to a valid object!`), a ref changed before its
|
|
13
|
+
* prune keeps its loose file (`error: cannot lock ref ...`)
|
|
14
|
+
*/
|
|
15
|
+
errors: string[];
|
|
10
16
|
}
|
|
11
17
|
/**
|
|
12
18
|
* Pack loose references into packed-refs.
|
|
@@ -16,6 +22,12 @@ export interface PackRefsResult {
|
|
|
16
22
|
* This command packs loose reference files (.git/refs/*) into the
|
|
17
23
|
* single .git/packed-refs file for efficiency.
|
|
18
24
|
*
|
|
25
|
+
* Without {@link setAll} or refs named, the loose tags are packed (git's default
|
|
26
|
+
* `refs/tags/*`). The reference-transaction hook runs as in git: once for the packed-refs
|
|
27
|
+
* transaction (every loose ref packed, as `<zero> <id> <ref>`), then once per loose ref
|
|
28
|
+
* pruned; a refusal throws `RefTransactionAbortedError` (git dies there). {@link setAuto} is
|
|
29
|
+
* git 2.5x's `--auto`: nothing happens unless enough loose refs wait.
|
|
30
|
+
*
|
|
19
31
|
* Based on JGit's PackRefsCommand.
|
|
20
32
|
*
|
|
21
33
|
* @example
|
|
@@ -34,6 +46,7 @@ export interface PackRefsResult {
|
|
|
34
46
|
*/
|
|
35
47
|
export declare class PackRefsCommand extends GitCommand<PackRefsResult> {
|
|
36
48
|
private all;
|
|
49
|
+
private auto;
|
|
37
50
|
private refs;
|
|
38
51
|
/**
|
|
39
52
|
* Pack all loose refs.
|
|
@@ -41,6 +54,13 @@ export declare class PackRefsCommand extends GitCommand<PackRefsResult> {
|
|
|
41
54
|
* @param all Whether to pack all refs
|
|
42
55
|
*/
|
|
43
56
|
setAll(all: boolean): this;
|
|
57
|
+
/**
|
|
58
|
+
* git 2.5x's `pack-refs --auto` (files-backend.c `should_pack_refs`): pack only when at
|
|
59
|
+
* least `max(16, log2(<packed-refs size> / 100) * 5)` loose refs could be packed.
|
|
60
|
+
*
|
|
61
|
+
* @param auto Whether to pack only when needed
|
|
62
|
+
*/
|
|
63
|
+
setAuto(auto: boolean): this;
|
|
44
64
|
/**
|
|
45
65
|
* Add a specific ref to pack.
|
|
46
66
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-refs-command.d.ts","sourceRoot":"","sources":["../../src/commands/pack-refs-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED
|
|
1
|
+
{"version":3,"file":"pack-refs-command.d.ts","sourceRoot":"","sources":["../../src/commands/pack-refs-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,eAAgB,SAAQ,UAAU,CAAC,cAAc,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAgB;IAE5B;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAIzB;IAED;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAI3B;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI5B;IAED;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,CAwBpC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's patch-id of a commit (`commit_patch_id`, `diff_get_patch_id`): the diff against its
|
|
3
|
+
* parent (no rename detection), each file's header and diff lines with whitespace removed,
|
|
4
|
+
* hashed per file and summed, so the order of the files does not matter. Two commits with
|
|
5
|
+
* the same patch-id make the same change: `rebase` leaves out the commits whose change
|
|
6
|
+
* upstream already has (`--cherry-mark`).
|
|
7
|
+
*/
|
|
8
|
+
import { type Blobs, type ObjectId } from "@statewalker/vcs-core";
|
|
9
|
+
import type { CommandTrees } from "../git-command.js";
|
|
10
|
+
/** The trees a patch-id reads (a cache of them serves as well). */
|
|
11
|
+
export type PatchIdTrees = Pick<CommandTrees, "loadTree">;
|
|
12
|
+
/**
|
|
13
|
+
* The patch-id of the change from `parentTree` to `tree` (hex), or undefined when nothing
|
|
14
|
+
* changes. With `headerOnly` (git's `diff_header_only`), only the files' names and modes
|
|
15
|
+
* are hashed, no content read: equal patch-ids have equal header ids, so the cheap id sorts
|
|
16
|
+
* out candidates and the full one is computed only where they collide (patch-ids.c).
|
|
17
|
+
*/
|
|
18
|
+
export declare function patchId(trees: PatchIdTrees, blobs: Blobs, parentTree: ObjectId | undefined, tree: ObjectId, options?: {
|
|
19
|
+
headerOnly?: boolean;
|
|
20
|
+
}): Promise<string | undefined>;
|
|
21
|
+
/** A changed file for {@link patchIdOfChanges}; `oldPath` differs from `path` for a rename. */
|
|
22
|
+
export interface PatchIdChange {
|
|
23
|
+
path: string;
|
|
24
|
+
oldPath?: string;
|
|
25
|
+
old?: {
|
|
26
|
+
mode: number;
|
|
27
|
+
id: ObjectId;
|
|
28
|
+
};
|
|
29
|
+
new?: {
|
|
30
|
+
mode: number;
|
|
31
|
+
id: ObjectId;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The patch-id of a list of changed files as the diff queue has them (renames and copies
|
|
36
|
+
* found by the caller, as `git format-patch --base` finds them).
|
|
37
|
+
*/
|
|
38
|
+
export declare function patchIdOfChanges(blobs: Blobs, changes: PatchIdChange[], options?: {
|
|
39
|
+
headerOnly?: boolean;
|
|
40
|
+
}): Promise<string>;
|
|
41
|
+
//# sourceMappingURL=patch-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-id.d.ts","sourceRoot":"","sources":["../../src/commands/patch-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAgC,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAIhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AA0E1D;;;;;GAKG;AACH,wBAAsB,OAAO,CAC3B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,QAAQ,GAAG,SAAS,EAChC,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACrC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI7B;AAED,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,QAAQ,CAAA;KAAE,CAAC;IACrC,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,QAAQ,CAAA;KAAE,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,aAAa,EAAE,EACxB,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACrC,OAAO,CAAC,MAAM,CAAC,CAoEjB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `:(attr:...)` pathspec magic for the commands that match index and worktree paths
|
|
3
|
+
* (pathspec.c `parse_pathspec_attr_match`, dir.c `match_pathspec_item` calling
|
|
4
|
+
* `match_pathspec_attrs`): the attributes of the paths a command is about to match, read
|
|
5
|
+
* through the worktree's attribute stack (`.gitattributes` in the worktree, else the index
|
|
6
|
+
* entry, `$GIT_DIR/info/attributes`, `core.attributesFile`, the system file), then looked up
|
|
7
|
+
* synchronously while the paths are matched.
|
|
8
|
+
*/
|
|
9
|
+
import type { AttributesResolver, Worktree } from "@statewalker/vcs-working-tree";
|
|
10
|
+
import { type PathspecAttributeValue, type PathspecItem } from "./pathspec.js";
|
|
11
|
+
/** Reads the attributes `names` of a path (a directory's with its trailing `/`). */
|
|
12
|
+
export type PathspecAttributeReader = (path: string, names: readonly string[]) => Promise<ReadonlyMap<string, PathspecAttributeValue>>;
|
|
13
|
+
/**
|
|
14
|
+
* The attributes of the paths a pathspec with `:(attr:...)` elements matches: bound to its
|
|
15
|
+
* elements (`attrLookup`), loaded for a batch of candidate paths before they are matched.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const items = parsePathspec([":(attr:text)"], { attr: true });
|
|
20
|
+
* const attributes = PathspecAttributes.forWorktree(items, worktree);
|
|
21
|
+
* await attributes?.load(indexPaths);
|
|
22
|
+
* const wanted = indexPaths.filter((p) => matchPathspec(items, p, 0) > 0);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class PathspecAttributes {
|
|
26
|
+
private readonly read;
|
|
27
|
+
private readonly values;
|
|
28
|
+
private readonly names;
|
|
29
|
+
private readonly attrItems;
|
|
30
|
+
constructor(items: PathspecItem[], read: PathspecAttributeReader);
|
|
31
|
+
/**
|
|
32
|
+
* The attributes of `items` bound to the worktree's attribute stack (the check-in
|
|
33
|
+
* direction: the worktree's `.gitattributes` first, then the index's); undefined when no
|
|
34
|
+
* element has `:(attr:...)`.
|
|
35
|
+
*
|
|
36
|
+
* @throws GitApiError without a worktree, or when it reads no attributes
|
|
37
|
+
*/
|
|
38
|
+
static forWorktree(items: PathspecItem[], worktree: Worktree | undefined): PathspecAttributes | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The attributes of `items` read by an attributes resolver (a bare repository's, without
|
|
41
|
+
* a worktree: builtin, system, global, `info/attributes` and an attribute source);
|
|
42
|
+
* undefined when no element has `:(attr:...)`.
|
|
43
|
+
*/
|
|
44
|
+
static forResolver(items: PathspecItem[], resolver: AttributesResolver): PathspecAttributes | undefined;
|
|
45
|
+
/** Loads the attributes of the paths some element may match by its path. */
|
|
46
|
+
load(paths: Iterable<string>): Promise<void>;
|
|
47
|
+
/** Whether `path` may match an element by its path and its attributes are not loaded yet. */
|
|
48
|
+
needs(path: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether dir.c's untracked walk reaches the untracked `path` (its attributes loaded on
|
|
51
|
+
* the way): each untracked directory above it (one holding no index entry, so not in
|
|
52
|
+
* `trackedDirs`) must match `items` as a leading path by its own name and attributes
|
|
53
|
+
* (`treat_directory` with `DO_MATCH_LEADING_PATHSPEC`).
|
|
54
|
+
*/
|
|
55
|
+
reachable(items: PathspecItem[], path: string, trackedDirs: Set<string>): Promise<boolean>;
|
|
56
|
+
/** Loads the attributes of `path` (whether an element may match it or not). */
|
|
57
|
+
loadOne(path: string): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The attributes of `items` for the worktree, loaded for `paths` (none: the pathspec has no
|
|
61
|
+
* `:(attr:...)` element).
|
|
62
|
+
*/
|
|
63
|
+
export declare function loadPathspecAttributes(items: PathspecItem[], worktree: Worktree | undefined, paths: Iterable<string>): Promise<PathspecAttributes | undefined>;
|
|
64
|
+
//# sourceMappingURL=pathspec-attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathspec-attributes.d.ts","sourceRoot":"","sources":["../../src/commands/pathspec-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAElB,MAAM,eAAe,CAAC;AAEvB,oFAAoF;AACpF,MAAM,MAAM,uBAAuB,GAAG,CACpC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,MAAM,EAAE,KACrB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAO3B,OAAO,CAAC,QAAQ,CAAC,IAAI;IANvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkE;IACzF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAE3C,YACE,KAAK,EAAE,YAAY,EAAE,EACJ,IAAI,EAAE,uBAAuB,EAQ/C;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAChB,KAAK,EAAE,YAAY,EAAE,EACrB,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAC7B,kBAAkB,GAAG,SAAS,CAyBhC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAChB,KAAK,EAAE,YAAY,EAAE,EACrB,QAAQ,EAAE,kBAAkB,GAC3B,kBAAkB,GAAG,SAAS,CAOhC;IAED,4EAA4E;IACtE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAA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