@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,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sparse checkout's half of unpack-trees, shared by every command that writes the index
|
|
3
|
+
* and the worktree together (`checkout`, `switch`, `reset --hard/--merge/--keep`, the merge
|
|
4
|
+
* family through `switchTrees`, `clone --sparse`) and by `git sparse-checkout` itself.
|
|
5
|
+
*
|
|
6
|
+
* git marks the entries outside the sparse-checkout patterns before it merges
|
|
7
|
+
* (`mark_new_skip_worktree`, loop #1), so the merge functions neither check nor touch the
|
|
8
|
+
* files of entries that stay outside (`verify_uptodate` and `verify_absent` skip
|
|
9
|
+
* `CE_NEW_SKIP_WORKTREE`); new entries are marked once the merge is done (loop #2), then
|
|
10
|
+
* `apply_sparse_checkout` decides, entry by entry and before anything is written, which files
|
|
11
|
+
* leave the checkout (`verify_uptodate_sparse`) and which come back (`verify_absent_sparse`),
|
|
12
|
+
* and `check_updates` removes and writes. A command takes a {@link SparseUnpack} before it
|
|
13
|
+
* changes anything, asks it which paths it may check, write and remove
|
|
14
|
+
* ({@link SparseUnpack.leavesAlone}, {@link SparseUnpack.writes}), unlinks the files
|
|
15
|
+
* {@link SparseUnpack.leaving} returns with its own removals, and once its result is
|
|
16
|
+
* written lets {@link SparseUnpack.finish} set the flags and write the entries that came
|
|
17
|
+
* back. Nothing is written first and taken out again.
|
|
18
|
+
*/
|
|
19
|
+
import type { Blobs } from "@statewalker/vcs-core";
|
|
20
|
+
import { type ObjectId } from "@statewalker/vcs-core";
|
|
21
|
+
import { type SparseCheckoutPatterns, type Staging, type StagingEntry, type WorkingCopy, type Worktree, type WorktreeModeTrust } from "@statewalker/vcs-working-tree";
|
|
22
|
+
/** The sparse checkout's settings, as git reads them into its globals. */
|
|
23
|
+
export interface SparseCheckoutConfig {
|
|
24
|
+
/** `core.sparseCheckout` (git's `core_apply_sparse_checkout`) */
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
/** `core.sparseCheckoutCone` */
|
|
27
|
+
cone: boolean;
|
|
28
|
+
/** `core.ignoreCase` */
|
|
29
|
+
ignoreCase: boolean;
|
|
30
|
+
/** `sparse.expectFilesOutsideOfPatterns` */
|
|
31
|
+
expectFilesOutside: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** The sparse checkout's configuration of a working copy. */
|
|
34
|
+
export declare function sparseCheckoutConfig(workingCopy: WorkingCopy): SparseCheckoutConfig;
|
|
35
|
+
/** The sparse-checkout file's text (`$GIT_DIR/info/sparse-checkout`), undefined when there is none. */
|
|
36
|
+
export declare function readSparseCheckoutFile(workingCopy: WorkingCopy): Promise<string | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* The sparse checkout's patterns (`$GIT_DIR/info/sparse-checkout`, cone matching with
|
|
39
|
+
* `core.sparseCheckoutCone`, case folded with `core.ignoreCase`) for git's
|
|
40
|
+
* `path_in_sparse_checkout`, or undefined when `core.sparseCheckout` is off (every path
|
|
41
|
+
* is in the checkout).
|
|
42
|
+
*/
|
|
43
|
+
export declare function readSparseCheckoutPatterns(workingCopy: WorkingCopy): Promise<SparseCheckoutPatterns | undefined>;
|
|
44
|
+
/** What unpack-trees reports while it applies the patterns (its sparse warnings). */
|
|
45
|
+
type SparseReportKind = "notUptodate" | "unmerged" | "orphaned";
|
|
46
|
+
/** The paths unpack-trees reports while it applies the patterns, and what it changed. */
|
|
47
|
+
export interface SparseApplyOutcome {
|
|
48
|
+
/** Files out of the patterns kept for their changes (WARNING_SPARSE_NOT_UPTODATE_FILE) */
|
|
49
|
+
notUptodate: string[];
|
|
50
|
+
/** Unmerged paths left in the worktree (WARNING_SPARSE_UNMERGED_FILE) */
|
|
51
|
+
unmerged: string[];
|
|
52
|
+
/** Files back in the patterns not written over what stands there (WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN) */
|
|
53
|
+
orphaned: string[];
|
|
54
|
+
/** Every report in index order, as git prints them one by one without porcelain messages */
|
|
55
|
+
reports: {
|
|
56
|
+
kind: SparseReportKind;
|
|
57
|
+
path: string;
|
|
58
|
+
}[];
|
|
59
|
+
/** The files removed from the worktree, now skip-worktree */
|
|
60
|
+
removed: string[];
|
|
61
|
+
/** The files written into the worktree, no longer skip-worktree */
|
|
62
|
+
written: string[];
|
|
63
|
+
/** Whether the index was changed (and written) */
|
|
64
|
+
changed: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* check_updates' `unlink_or_warn` lines for files leaving the checkout that could not be
|
|
67
|
+
* removed ("warning: unable to unlink 'p': Is a directory"), printed after the sparse
|
|
68
|
+
* warnings by unpack-trees, before them by `update_sparsity`
|
|
69
|
+
*/
|
|
70
|
+
unlinkWarnings: string[];
|
|
71
|
+
}
|
|
72
|
+
/** The staging's entries in index order. */
|
|
73
|
+
export declare function entryList(staging: Staging): Promise<readonly StagingEntry[]>;
|
|
74
|
+
/** What {@link SparseUnpack.finish} needs of a command. */
|
|
75
|
+
export interface SparseApplyContext {
|
|
76
|
+
workingCopy: WorkingCopy;
|
|
77
|
+
worktree?: Worktree;
|
|
78
|
+
staging: Staging;
|
|
79
|
+
blobs: Blobs;
|
|
80
|
+
}
|
|
81
|
+
/** The stage-0 entry a command's result holds at a path, undefined when it removes the path. */
|
|
82
|
+
export type SparseResultLookup = (path: string) => {
|
|
83
|
+
objectId: ObjectId;
|
|
84
|
+
mode: number;
|
|
85
|
+
} | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* git's sparse checkout over one unpack-trees run (`unpack_trees` with `update`, or
|
|
88
|
+
* `update_sparsity`), taken by a command before it changes anything: the patterns, and the
|
|
89
|
+
* index as the command found it (git's `o->src_index`, with its time for the racy check).
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* const sparse = await SparseUnpack.start(ctx);
|
|
94
|
+
* // the merge's checks and writes skip what stays outside the checkout
|
|
95
|
+
* if (!sparse?.leavesAlone(path)) verifyUptodate(path);
|
|
96
|
+
* // before writing: the files that leave the checkout (verify_uptodate_sparse)
|
|
97
|
+
* const unlink = await sparse.leaving(worktree, (p) => result.get(p));
|
|
98
|
+
* await sparse.unlink(worktree, unlink);
|
|
99
|
+
* // ...the command's own removals and writes, only of paths sparse.writes() accepts...
|
|
100
|
+
* const outcome = await sparse.finish(ctx, { written });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare class SparseUnpack {
|
|
104
|
+
readonly patterns: SparseCheckoutPatterns;
|
|
105
|
+
/** The source index's time (`o->src_index->timestamp`), for `ie_match_stat`'s racy check */
|
|
106
|
+
readonly srcTime: number;
|
|
107
|
+
/** The source index's stage-0 entries */
|
|
108
|
+
private readonly src;
|
|
109
|
+
/** Paths unmerged in the source index (mark_new_skip_worktree: never skip-worktree) */
|
|
110
|
+
private readonly unmergedSrc;
|
|
111
|
+
/** The source entries in the checkout that its patterns put outside (copied, in index order) */
|
|
112
|
+
private readonly candidates;
|
|
113
|
+
/** Paths whose conflicts the command records */
|
|
114
|
+
private readonly conflicts;
|
|
115
|
+
private readonly inPatterns;
|
|
116
|
+
/** Files going out that were kept for their changes: they lose no flag */
|
|
117
|
+
private readonly kept;
|
|
118
|
+
/** Kept files changed behind a matching stat (racy): their entries are smudged */
|
|
119
|
+
private readonly smudge;
|
|
120
|
+
private readonly reports;
|
|
121
|
+
private readonly removed;
|
|
122
|
+
private readonly unlinkWarnings;
|
|
123
|
+
private constructor();
|
|
124
|
+
/**
|
|
125
|
+
* The run of an index-writing command in a sparse checkout (`core.sparseCheckout` on, a
|
|
126
|
+
* worktree to update), undefined otherwise: unpack-trees then has nothing to apply.
|
|
127
|
+
*/
|
|
128
|
+
static start(ctx: {
|
|
129
|
+
workingCopy: WorkingCopy;
|
|
130
|
+
worktree?: Worktree;
|
|
131
|
+
staging: Staging;
|
|
132
|
+
}): Promise<SparseUnpack | undefined>;
|
|
133
|
+
/** A run over the index as it is now, with `patterns`. */
|
|
134
|
+
static of(patterns: SparseCheckoutPatterns, staging: Staging): Promise<SparseUnpack>;
|
|
135
|
+
/**
|
|
136
|
+
* Paths whose conflicts the command records (merge-ort's `record_conflicted_index_entries`,
|
|
137
|
+
* whose stage entries are never skip-worktree). One whose source entry was skip-worktree,
|
|
138
|
+
* or that had none, has its file written whatever the patterns say (the stage-0 entry
|
|
139
|
+
* unpack-trees left skip-worktree is checked out). One whose source entry was in the
|
|
140
|
+
* checkout but is outside the patterns now leaves it as any other entry does:
|
|
141
|
+
* `apply_sparse_checkout` set `CE_WT_REMOVE`, which `checkout_entry` honours by unlinking,
|
|
142
|
+
* so its content is only in the index stages (a changed file is kept, as ever).
|
|
143
|
+
*/
|
|
144
|
+
conflict(paths: Iterable<string>): void;
|
|
145
|
+
/**
|
|
146
|
+
* `CE_NEW_SKIP_WORKTREE` of a stage-0 entry the result holds at `path`: outside the
|
|
147
|
+
* patterns, and neither unmerged in the source index (loop #1 of
|
|
148
|
+
* `mark_new_skip_worktree`) nor conflicted by the command where its file is written
|
|
149
|
+
* (see {@link conflict}).
|
|
150
|
+
*/
|
|
151
|
+
outside(path: string): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Whether the command leaves the worktree at `path` alone, its checks included: the path
|
|
154
|
+
* stays outside the patterns and its source entry is skip-worktree, or it has none (a new
|
|
155
|
+
* entry, which loop #2 marks skip-worktree). git's `verify_uptodate` and `verify_absent`
|
|
156
|
+
* skip such an entry, and `apply_sparse_checkout` drops its update and its removal
|
|
157
|
+
* (`was_skip_worktree && ce_skip_worktree`). Its index entry is changed all the same. Ask
|
|
158
|
+
* only for a path the command's source index or target holds.
|
|
159
|
+
*/
|
|
160
|
+
leavesAlone(path: string): boolean;
|
|
161
|
+
/** Whether the command writes the file of the entry its result holds at `path`. */
|
|
162
|
+
writes(path: string): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* `apply_sparse_checkout` for the source entries the patterns take out of the checkout
|
|
165
|
+
* (`!was_skip_worktree && ce_skip_worktree`), decided before anything is written: an
|
|
166
|
+
* entry the result removes is the command's own removal; one it changes, or any with
|
|
167
|
+
* `reset` (`o->reset`: the one-way merge flagged its changed file `CE_UPDATE`), is
|
|
168
|
+
* unlinked (the command checked it as git's merge functions do); an unchanged one is
|
|
169
|
+
* unlinked unless `verify_uptodate_sparse` finds its file changed (by its stat against
|
|
170
|
+
* the source index, racy entries read), in which case it stays, keeps no flag, and is
|
|
171
|
+
* reported. A file reached through a symlinked leading directory is reported, never
|
|
172
|
+
* unlinked: git's `lstat` finds what the link points to. Returns the files to unlink, for
|
|
173
|
+
* {@link unlink} with the command's own removals.
|
|
174
|
+
*/
|
|
175
|
+
leaving(worktree: Worktree | undefined, result: SparseResultLookup, options?: {
|
|
176
|
+
reset?: boolean;
|
|
177
|
+
trust?: WorktreeModeTrust;
|
|
178
|
+
}): Promise<string[]>;
|
|
179
|
+
/**
|
|
180
|
+
* `check_updates`' `unlink_entry` of the files {@link leaving} gave: a submodule's
|
|
181
|
+
* directory only when empty, the directories left empty after (`schedule_dir_for_removal`).
|
|
182
|
+
* Nothing beneath a symbolic link is touched.
|
|
183
|
+
*/
|
|
184
|
+
unlink(worktree: Worktree, paths: readonly string[]): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* The rest of `apply_sparse_checkout` once the command wrote its result: every stage-0
|
|
187
|
+
* entry outside the patterns becomes skip-worktree (but those {@link leaving} kept), every
|
|
188
|
+
* other loses the flag; a skip-worktree entry back in the patterns that the command did
|
|
189
|
+
* not write (`written`) is written unless something stands at its path
|
|
190
|
+
* (`verify_absent_sparse`: an untracked file, or a directory holding one, is kept and
|
|
191
|
+
* reported; an ignored one is replaced; with `overwrite`, `UNPACK_RESET_OVERWRITE_UNTRACKED`,
|
|
192
|
+
* anything is). A directory holding such a file keeps the entry unwritten without a report
|
|
193
|
+
* (verify_clean_subdirectory's ERROR_NOT_UPTODATE_DIR, which unpack-trees never prints with
|
|
194
|
+
* the sparse warnings). With `warnUnmerged` (`update_sparsity`) unmerged paths are reported.
|
|
195
|
+
* With `preserveIgnored` (`update_sparsity`, which runs without `o->internal.dir`) ignored
|
|
196
|
+
* files are no more expendable than untracked ones. The index is written when an entry
|
|
197
|
+
* changed.
|
|
198
|
+
*/
|
|
199
|
+
finish(ctx: SparseApplyContext, options?: {
|
|
200
|
+
written?: ReadonlySet<string>;
|
|
201
|
+
overwrite?: boolean;
|
|
202
|
+
warnUnmerged?: boolean;
|
|
203
|
+
preserveIgnored?: boolean;
|
|
204
|
+
}): Promise<SparseApplyOutcome>;
|
|
205
|
+
private outcome;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* git's `update_sparsity` (`git sparse-checkout set/add/reapply/init/disable`): the index as
|
|
209
|
+
* it is, every stage-0 entry outside `patterns` made skip-worktree and its file removed
|
|
210
|
+
* unless changed (kept, reported), every skip-worktree entry back inside written unless
|
|
211
|
+
* something stands there (reported), unmerged paths reported. The index is written when a
|
|
212
|
+
* flag changed.
|
|
213
|
+
*/
|
|
214
|
+
export declare function updateSparsity(ctx: SparseApplyContext, patterns: SparseCheckoutPatterns): Promise<SparseApplyOutcome>;
|
|
215
|
+
/**
|
|
216
|
+
* git's `clean_tracked_sparse_directories` after `update_sparsity` (cone mode only, an index
|
|
217
|
+
* without unmerged entries): each top-most directory outside the cone whose entries are all
|
|
218
|
+
* skip-worktree, none a submodule and none below a directory holding an intent-to-add entry
|
|
219
|
+
* (what `convert_to_sparse` collapses, `sparseDirectoriesOf`) is removed with what is left
|
|
220
|
+
* in it when that is only ignored files, else warned about. A directory reached through a
|
|
221
|
+
* symbolic link is never entered. Returns git's warning lines.
|
|
222
|
+
*/
|
|
223
|
+
export declare function cleanTrackedSparseDirectories(ctx: {
|
|
224
|
+
worktree?: Worktree;
|
|
225
|
+
staging: Staging;
|
|
226
|
+
}, patterns: SparseCheckoutPatterns): Promise<string>;
|
|
227
|
+
/**
|
|
228
|
+
* The sparse directories git's `convert_to_sparse` (`SPARSE_INDEX_MEMORY_ONLY` too) makes of
|
|
229
|
+
* a full index under cone-mode `patterns`: top-down, each directory outside the cone whose
|
|
230
|
+
* entries are all skip-worktree, merged and no gitlink, with a trailing slash, in index
|
|
231
|
+
* order. git converts over a cache-tree computed for the index itself (`cache_tree_update`
|
|
232
|
+
* unless fully valid), so the only invalid nodes are the directories holding an
|
|
233
|
+
* intent-to-add entry anywhere below them (`update_one` invalidates up to the root), and
|
|
234
|
+
* `convert_to_sparse_rec` copies an invalid node entry by entry without recursing: no
|
|
235
|
+
* directory at or below such a directory collapses (the root's own validity is never
|
|
236
|
+
* checked). Undefined where git does not convert: no entries, an unmerged entry, patterns
|
|
237
|
+
* not of the cone's shape.
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```typescript
|
|
241
|
+
* sparseDirectoriesOf(entries, patterns); // ["c/", "e/"]
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
export declare function sparseDirectoriesOf(entries: readonly StagingEntry[], patterns: SparseCheckoutPatterns): string[] | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* The lines git prints for the paths a sparse run reports, on stderr. With `porcelain`
|
|
247
|
+
* (`setup_unpack_trees_porcelain`: `checkout`, `switch`, the merge family,
|
|
248
|
+
* `sparse-checkout`) one `warning:` block per kind and git's reminder to reapply; without
|
|
249
|
+
* (`reset --merge`, `reset --keep`) one `error:` line per path in index order, as
|
|
250
|
+
* `add_rejected_path` prints them when it does not collect them.
|
|
251
|
+
*/
|
|
252
|
+
export declare function sparseWarningText(outcome: SparseApplyOutcome, porcelain: boolean): string;
|
|
253
|
+
/**
|
|
254
|
+
* What a command's sparse run printed (the patterns' warnings, then the sparse warnings),
|
|
255
|
+
* appended to `lines` one entry per line.
|
|
256
|
+
*/
|
|
257
|
+
export declare function pushSparseWarnings(lines: string[] | undefined, sparse: SparseUnpack | undefined, outcome: SparseApplyOutcome | undefined, porcelain: boolean): string;
|
|
258
|
+
/** git's `warning: ` lines for the patterns' own warnings (`add_pattern_to_hashsets`). */
|
|
259
|
+
export declare function patternWarningText(patterns: SparseCheckoutPatterns | undefined): string;
|
|
260
|
+
/**
|
|
261
|
+
* git's `advise_on_updating_sparse_paths` (`add`, `rm`): the elements that matched only
|
|
262
|
+
* entries outside the sparse checkout and, unless `advice.updateSparsePath` is off, the
|
|
263
|
+
* hint, its last line as the version words it (2.43: "git config advice...", 2.5x: "git
|
|
264
|
+
* config set advice...").
|
|
265
|
+
*/
|
|
266
|
+
export declare function sparsePathAdvice(elements: readonly string[], advice: boolean, compatibility?: "2.43" | "2.56"): string[];
|
|
267
|
+
export {};
|
|
268
|
+
//# sourceMappingURL=sparse-checkout-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparse-checkout-support.d.ts","sourceRoot":"","sources":["../../src/commands/sparse-checkout-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAML,KAAK,sBAAsB,EAC3B,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEb,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAA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AC/B,OAAO,CAAC,kBAAkB,CAAC,CAc7B;AAED;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,CACjD,GAAG,EAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC9C,QAAQ,EAAE,sBAAsB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,QAAQ,EAAE,sBAAsB,GAC/B,MAAM,EAAE,GAAG,SAAS,CAuCtB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CA+BzF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,EAC3B,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,SAAS,EAAE,OAAO,GACjB,MAAM,CAQR;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,SAAS,GAAG,MAAM,CAEvF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,MAAM,EAAE,OAAO,EACf,aAAa,GAAE,MAAM,GAAG,MAAe,GACtC,MAAM,EAAE,CAiBV"}
|
|
@@ -41,6 +41,9 @@ export declare class StashApplyCommand extends GitCommand<StashApplyResult> {
|
|
|
41
41
|
private restoreUntracked;
|
|
42
42
|
private strategy;
|
|
43
43
|
private contentStrategy?;
|
|
44
|
+
private labelOurs;
|
|
45
|
+
private labelTheirs;
|
|
46
|
+
private labelBase;
|
|
44
47
|
/**
|
|
45
48
|
* Set the stash reference to apply.
|
|
46
49
|
*
|
|
@@ -84,6 +87,22 @@ export declare class StashApplyCommand extends GitCommand<StashApplyResult> {
|
|
|
84
87
|
* @param _ignore true to ignore state
|
|
85
88
|
*/
|
|
86
89
|
setIgnoreRepositoryState(_ignore: boolean): this;
|
|
90
|
+
/**
|
|
91
|
+
* The conflict markers' labels (git 2.5x's `stash apply --label-ours=<label>`,
|
|
92
|
+
* `--label-theirs=<label>`, `--label-base=<label>`): default `Updated upstream` (the
|
|
93
|
+
* current index), `Stashed changes` (the stash) and `Stash base` (diff3's base).
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* // as `git checkout -m feat` applies its autostash
|
|
98
|
+
* await git.stashApply().setStashRef(id).setLabels({ ours: "feat", theirs: "local", base: "main" }).call();
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
setLabels(labels: {
|
|
102
|
+
ours?: string;
|
|
103
|
+
theirs?: string;
|
|
104
|
+
base?: string;
|
|
105
|
+
}): this;
|
|
87
106
|
/**
|
|
88
107
|
* Set the merge strategy to use.
|
|
89
108
|
*
|
|
@@ -111,22 +130,27 @@ export declare class StashApplyCommand extends GitCommand<StashApplyResult> {
|
|
|
111
130
|
*/
|
|
112
131
|
call(): Promise<StashApplyResult>;
|
|
113
132
|
private apply;
|
|
133
|
+
/**
|
|
134
|
+
* The rest of unpack-trees' sparse checkout once the merge's result is written: the
|
|
135
|
+
* skip-worktree flags of the entries outside the patterns, the entries that came back
|
|
136
|
+
* written. Returns the warnings it printed.
|
|
137
|
+
*/
|
|
138
|
+
private finishSparse;
|
|
114
139
|
/** Writes a blob to the worktree (a link as a link where the worktree has them). */
|
|
115
140
|
private writeBlob;
|
|
116
141
|
/**
|
|
117
142
|
* git's ort merge of a stash: `base` (the stash's parent) to `ours` (the current index)
|
|
118
|
-
* and to `theirs` (the stash)
|
|
119
|
-
*
|
|
120
|
-
* sides changed are merged line by line (`Updated upstream` / `Stashed changes` markers);
|
|
121
|
-
* binary files, modify/delete and file/directory collisions are conflicts as in git.
|
|
143
|
+
* and to `theirs` (the stash), with git's labels (`Updated upstream` / `Stashed changes`,
|
|
144
|
+
* `Stash base` for diff3), shared with `merge` ({@link ortMerge}).
|
|
122
145
|
*/
|
|
123
146
|
private mergeFlat;
|
|
124
147
|
/**
|
|
125
|
-
* The
|
|
126
|
-
*
|
|
127
|
-
*
|
|
148
|
+
* The stash's index change applied to the index as git's `do_apply_stash` does it:
|
|
149
|
+
* `git diff-tree --binary` of the stash's base and index trees, applied with
|
|
150
|
+
* `git apply --cached` (no merge: a hunk whose context the index no longer has fails).
|
|
151
|
+
* Errors as git's apply reports them.
|
|
128
152
|
*/
|
|
129
|
-
private
|
|
153
|
+
private applyCached;
|
|
130
154
|
/** Stores a flat path map as a tree. */
|
|
131
155
|
private storeFlat;
|
|
132
156
|
/** The blobs, links and gitlinks of a tree, by path. */
|
|
@@ -146,6 +170,16 @@ export declare class StashApplyCommand extends GitCommand<StashApplyResult> {
|
|
|
146
170
|
* @returns The plan, or undefined if there is nothing to restore
|
|
147
171
|
*/
|
|
148
172
|
private planUntrackedRestore;
|
|
173
|
+
/**
|
|
174
|
+
* The stashed untracked files written back after the merge, as git's
|
|
175
|
+
* `checkout-index --all` of their own index writes them (the worktree's attributes, then
|
|
176
|
+
* that index's; they stay untracked): in index order, a path something already stands at
|
|
177
|
+
* is skipped (`<path> already exists, no checkout`), a file on a leading component stops
|
|
178
|
+
* the restore there (`cannot create directory at '<dir>': File exists`). What could not
|
|
179
|
+
* be restored is reported (thrown) once the rest is written, as git exits with an error
|
|
180
|
+
* after applying the stash.
|
|
181
|
+
*/
|
|
182
|
+
private writeUntracked;
|
|
149
183
|
/**
|
|
150
184
|
* Resolve the stash reference to a commit ID.
|
|
151
185
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stash-apply-command.d.ts","sourceRoot":"","sources":["../../src/commands/stash-apply-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stash-apply-command.d.ts","source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;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAIzC;IAED;;OAEG;IACH,WAAW,IAAI,aAAa,CAE3B;IAED;;;;OAIG;IACH,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAI5D;IAED;;OAEG;IACH,uBAAuB,IAAI,oBAAoB,GAAG,SAAS,CAE1D;IAED;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAiBtC;YAEa,KAAK;IAsYnB;;;;OAIG;YACW,YAAY;IAe1B,oFAAoF;YACtE,SAAS;IAoBvB;;;;OAIG;YACW,SAAS;IAoBvB;;;;;OAKG;YACW,WAAW;IAyCzB,wCAAwC;YAC1B,SAAS;IA2BvB,wDAAwD;YAC1C,QAAQ;IAatB;;;;;;;;;;;;;OAaG;YACW,oBAAoB;IAuBlC;;;;;;;;OAQG;YACW,cAAc;IAoD5B;;OAEG;YACW,eAAe;CA0D9B"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ObjectId, type PersonIdent } from "@statewalker/vcs-core";
|
|
2
2
|
import { GitCommand } from "../git-command.js";
|
|
3
|
+
import { type PatchOptions, type PatchResult, type PatchSelector } from "./add-patch/index.js";
|
|
4
|
+
import { type PathspecOriginStyle } from "./pathspec.js";
|
|
3
5
|
/**
|
|
4
6
|
* What the reset after a stash covers, as `git stash push` options.
|
|
5
7
|
*/
|
|
@@ -46,6 +48,52 @@ export interface StashWorkingTreeProvider {
|
|
|
46
48
|
* Reset the working directory and index to HEAD after the stash, as `git stash push`.
|
|
47
49
|
*/
|
|
48
50
|
resetHard(options?: StashResetOptions): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Reset the index alone to HEAD, its entries' stat refreshed (`git reset -q --refresh`),
|
|
53
|
+
* as `git stash push --staged` does after taking the staged changes out of the worktree.
|
|
54
|
+
* Optional: a provider without it cannot stash `--staged`.
|
|
55
|
+
*/
|
|
56
|
+
resetIndexToHead?(): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
/** `git stash push --staged` found nothing staged ("No staged changes"): nothing was stashed. */
|
|
59
|
+
export declare class NoStagedChangesError extends Error {
|
|
60
|
+
constructor();
|
|
61
|
+
}
|
|
62
|
+
/** `git stash push -p` selected no hunk ("No changes selected"): nothing was stashed (exit 1). */
|
|
63
|
+
export declare class NoChangesSelectedError extends Error {
|
|
64
|
+
constructor();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* `git stash push --staged` saved the stash but could not take the staged changes out of
|
|
68
|
+
* the worktree (`git apply -R` failed): git's "Cannot remove worktree changes". The stash
|
|
69
|
+
* is kept (`stashCommit`); the index and the worktree are as they were.
|
|
70
|
+
*/
|
|
71
|
+
export declare class StashWorktreeRemovalError extends Error {
|
|
72
|
+
readonly stashCommit: ObjectId;
|
|
73
|
+
readonly errors: string;
|
|
74
|
+
constructor(stashCommit: ObjectId, errors: string);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `git stash push -- <pathspec>` saved the stash but could not take the stashed changes out
|
|
78
|
+
* of the index and the worktree: one of the commands git runs after saving failed (git's exit
|
|
79
|
+
* status 1 in 2.43, 128 in 2.5x). The stash is kept (`stashCommit`) and `errors` holds what
|
|
80
|
+
* that command printed:
|
|
81
|
+
*
|
|
82
|
+
* - `git add -- <pathspec>` (with `-u`/`-a`) died: an element matched no file ("fatal:
|
|
83
|
+
* pathspec ':(prefix:0)x' did not match any files", nothing changed), or one named ignored
|
|
84
|
+
* files ("The following paths are ignored by one of your .gitignore files", the other
|
|
85
|
+
* files added to the index all the same);
|
|
86
|
+
* - `git apply --index -R` refused the reverse of the stashed changes, the index updated by
|
|
87
|
+
* that `git add` and the worktree untouched: a path HEAD has and the index does not exists
|
|
88
|
+
* untracked in the worktree ("error: b.txt: already exists in working directory");
|
|
89
|
+
* - with `--keep-index`, `git checkout --no-overlay <index tree> -- <pathspec>` found an
|
|
90
|
+
* element that names nothing ("error: pathspec ':(prefix:0)u' did not match any file(s)
|
|
91
|
+
* known to git"): the paths are reset to HEAD, the index tree not checked out.
|
|
92
|
+
*/
|
|
93
|
+
export declare class StashPathspecResetError extends Error {
|
|
94
|
+
readonly stashCommit: ObjectId;
|
|
95
|
+
readonly errors: string;
|
|
96
|
+
constructor(stashCommit: ObjectId, errors: string);
|
|
49
97
|
}
|
|
50
98
|
/**
|
|
51
99
|
* Command to create a stash commit.
|
|
@@ -82,6 +130,15 @@ export declare class StashCreateCommand extends GitCommand<ObjectId | undefined>
|
|
|
82
130
|
private workingTreeProvider?;
|
|
83
131
|
private customMessage?;
|
|
84
132
|
private author?;
|
|
133
|
+
private readonly pathspec;
|
|
134
|
+
private staged;
|
|
135
|
+
private compatibility;
|
|
136
|
+
private quiet;
|
|
137
|
+
private keepIndexSet;
|
|
138
|
+
private patch;
|
|
139
|
+
private patchSelector?;
|
|
140
|
+
private patchOptions;
|
|
141
|
+
private patchResult?;
|
|
85
142
|
/**
|
|
86
143
|
* Set the message used when committing index changes.
|
|
87
144
|
*
|
|
@@ -131,6 +188,38 @@ export declare class StashCreateCommand extends GitCommand<ObjectId | undefined>
|
|
|
131
188
|
* `git stash push --keep-index`.
|
|
132
189
|
*/
|
|
133
190
|
setKeepIndex(keepIndex: boolean): this;
|
|
191
|
+
/**
|
|
192
|
+
* Stash only the paths a pathspec element matches (`git stash push -- <pathspec>`): the
|
|
193
|
+
* worktree tree takes the files' changes for those paths (the index tree is the whole
|
|
194
|
+
* index, as in git), `-u` the untracked files among them, and only those paths are reset
|
|
195
|
+
* to HEAD afterwards (ORIG_HEAD left alone: git resets them with `add` and `apply -R`).
|
|
196
|
+
* Without `-u` every element must match a path of the index, else the command throws
|
|
197
|
+
* git's "error: pathspec ':(prefix:0)<p>' did not match any file(s) known to git" (git
|
|
198
|
+
* names the elements as it hands them on, see {@link setCompatibility}). When git's reset
|
|
199
|
+
* of the paths fails after the stash is saved, the command throws
|
|
200
|
+
* {@link StashPathspecResetError} and leaves the index and the worktree as git does.
|
|
201
|
+
*/
|
|
202
|
+
addPath(path: string): this;
|
|
203
|
+
/**
|
|
204
|
+
* Stash only the staged changes (`git stash push --staged`): the stash's worktree tree is
|
|
205
|
+
* the index tree; afterwards the staged changes are taken out of the worktree (their
|
|
206
|
+
* diff applied in reverse) and the index is reset to HEAD (only the pathspec's paths, when
|
|
207
|
+
* one is given; unless `--keep-index`). Throws {@link NoStagedChangesError} when the index
|
|
208
|
+
* holds nothing beyond HEAD. Not with untracked files.
|
|
209
|
+
*/
|
|
210
|
+
setStaged(staged: boolean): this;
|
|
211
|
+
/**
|
|
212
|
+
* The git version whose messages are reproduced where versions differ (default 2.56): the
|
|
213
|
+
* pathspec elements git's errors name (`:(prefix:0)x` in 2.5x, `:(,prefix:0)x` in 2.43,
|
|
214
|
+
* see {@link prefixOriginElement}).
|
|
215
|
+
*/
|
|
216
|
+
setCompatibility(version: PathspecOriginStyle): this;
|
|
217
|
+
/**
|
|
218
|
+
* `git stash push -q`: git's closing "Cannot save the current worktree state" line is left
|
|
219
|
+
* out of the error when the worktree cannot be stashed (an intent-to-add entry, a path
|
|
220
|
+
* beyond a symbolic link), as git prints it only without `-q`.
|
|
221
|
+
*/
|
|
222
|
+
setQuiet(quiet: boolean): this;
|
|
134
223
|
/**
|
|
135
224
|
* Set the working tree provider for accessing uncommitted changes.
|
|
136
225
|
*
|
|
@@ -138,11 +227,50 @@ export declare class StashCreateCommand extends GitCommand<ObjectId | undefined>
|
|
|
138
227
|
*/
|
|
139
228
|
setWorkingTreeProvider(provider: StashWorkingTreeProvider): this;
|
|
140
229
|
/**
|
|
141
|
-
* Set the author/committer identity for the stash commits
|
|
230
|
+
* Set the author/committer identity for the stash commits (default: each resolved as git
|
|
231
|
+
* resolves it).
|
|
142
232
|
*
|
|
143
233
|
* @param author The author identity
|
|
144
234
|
*/
|
|
145
235
|
setAuthor(author: PersonIdent): this;
|
|
236
|
+
/**
|
|
237
|
+
* `git stash push -p`: the differences between HEAD and the worktree are offered hunk by
|
|
238
|
+
* hunk, as git's add-patch.c does ("Stash this hunk"); the stash's worktree tree is HEAD
|
|
239
|
+
* with the selected hunks, which are then taken out of the worktree. The index stays as
|
|
240
|
+
* it is (`--keep-index` is the default in patch mode; `setKeepIndex(false)` resets it to
|
|
241
|
+
* HEAD afterwards). Throws {@link NoChangesSelectedError} when no hunk was selected. Not
|
|
242
|
+
* with untracked files; it overrides `setStaged`. The prompts are answered by
|
|
243
|
+
* {@link setPatchSelector}; {@link getPatchResult} gives git's transcript.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```typescript
|
|
247
|
+
* const answers = ["y", "n"];
|
|
248
|
+
* const stash = git.stashCreate().setPatch(true).setPatchSelector(() => answers.shift());
|
|
249
|
+
* await stash.call();
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
setPatch(patch: boolean): this;
|
|
253
|
+
/** Answers the prompts of {@link setPatch}. */
|
|
254
|
+
setPatchSelector(selector: PatchSelector): this;
|
|
255
|
+
/** `-U<n>`, `--inter-hunk-context=<n>` and `--no-auto-advance` of {@link setPatch}. */
|
|
256
|
+
setPatchOptions(options: PatchOptions): this;
|
|
257
|
+
/** What {@link setPatch}'s selection printed; read after {@link call}. */
|
|
258
|
+
getPatchResult(): PatchResult | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* stash_patch: the selection run on a temporary index of HEAD's tree (`diff-index HEAD`,
|
|
261
|
+
* `apply --cached`); the tree of that index.
|
|
262
|
+
*/
|
|
263
|
+
private patchWorktreeState;
|
|
264
|
+
/**
|
|
265
|
+
* 2.5x's create_index_from_tree: HEAD's tree unpacked by `oneway_merge` with the
|
|
266
|
+
* repository's index as its source. An index entry of the tree's id and mode is kept as it
|
|
267
|
+
* is (`keep_entry`: stat data, skip-worktree, assume-unchanged); a tree entry the index
|
|
268
|
+
* holds at another id takes over its skip-worktree bit alone (`merged_entry`). Before that,
|
|
269
|
+
* `verify_uptodate` checks each index entry the merge replaces or drops whose flags cheat:
|
|
270
|
+
* its file must still match the entry's stat, else the stash fails ("Entry '<path>' not
|
|
271
|
+
* uptodate. Cannot merge.").
|
|
272
|
+
*/
|
|
273
|
+
private carryIndexEntries;
|
|
146
274
|
/**
|
|
147
275
|
* Execute the stash create command.
|
|
148
276
|
*
|
|
@@ -150,6 +278,32 @@ export declare class StashCreateCommand extends GitCommand<ObjectId | undefined>
|
|
|
150
278
|
*/
|
|
151
279
|
call(): Promise<ObjectId | undefined>;
|
|
152
280
|
private stash;
|
|
281
|
+
/** The stash's worktree tree; under `-q` without git's "Cannot save ..." line on failure. */
|
|
282
|
+
private worktreeState;
|
|
283
|
+
/**
|
|
284
|
+
* `:(attr:...)` elements: the attributes of every path the stash and its reset match (the
|
|
285
|
+
* index's, HEAD's and, with `-u`/`-a`, the worktree's files), read before they are matched.
|
|
286
|
+
* Returns the untracked files git's untracked walk never reaches: dir.c's
|
|
287
|
+
* `treat_directory` enters an untracked directory only when it matches the pathspec as a
|
|
288
|
+
* leading path (`DO_MATCH_LEADING_PATHSPEC`) by its own name and attributes.
|
|
289
|
+
*/
|
|
290
|
+
private loadPathspecAttributes;
|
|
291
|
+
/** The elements as git names them (`item->original` with prefix magic), the implicit "." too. */
|
|
292
|
+
private pathspecOriginals;
|
|
293
|
+
/**
|
|
294
|
+
* `git stash push -- <pathspec>` after the stash is saved: git's `git add [-u|--force] --
|
|
295
|
+
* <pathspec>`, `git diff-index -p --cached HEAD -- <pathspec> | git apply --index -R` and,
|
|
296
|
+
* with `--keep-index`, `git checkout --no-overlay <index tree> -- <pathspec>`. The paths
|
|
297
|
+
* are reset by the provider; where one of git's commands would fail, the state it leaves
|
|
298
|
+
* is reproduced and {@link StashPathspecResetError} thrown.
|
|
299
|
+
*/
|
|
300
|
+
private resetPaths;
|
|
301
|
+
/**
|
|
302
|
+
* `git stash push --staged` after the stash is saved: the staged changes (HEAD's tree
|
|
303
|
+
* against the index tree, `diff-tree -p --binary -U1`) applied in reverse to the worktree
|
|
304
|
+
* (`git apply -R`), then, unless `--keep-index`, the index reset to HEAD.
|
|
305
|
+
*/
|
|
306
|
+
private removeStagedChanges;
|
|
153
307
|
/** The built-in provider, for a working copy with an index and a worktree. */
|
|
154
308
|
private defaultProvider;
|
|
155
309
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stash-create-command.d.ts","sourceRoot":"","sources":["../../src/commands/stash-create-command.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"stash-create-command.d.ts","sourceRoot":"","sources":["../../src/commands/stash-create-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUvF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAInB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAKL,KAAK,mBAAmB,EAKzB,MAAM,eAAe,CAAC;AAuBvB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qDAAqD;IACrD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,QAAQ,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAElC;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpC;;OAEG;IACH,gBAAgB,CAAC,CAAC,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAEzF;;;OA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AAwB,GAAG,IAAI,CAI/D;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAInC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAI7B;IAED,+CAA+C;IAC/C,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAI9C;IAED,uFAAuF;IACvF,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAI3C;IAED,0EAA0E;IAC1E,cAAc,IAAI,WAAW,GAAG,SAAS,CAExC;IAED;;;OAGG;YACW,kBAAkB;IAyBhC;;;;;;;;OAQG;YACW,iBAAiB;IA0B/B;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAU1C;YAEa,KAAK;IA0MnB,6FAA6F;YAC/E,aAAa;IAY3B;;;;;;OAMG;YACW,sBAAsB;IAiCpC,iGAAiG;IACjG,OAAO,CAAC,iBAAiB;IAOzB;;;;;;OAMG;YACW,UAAU;IAmHxB;;;;OAIG;YACW,mBAAmB;IAmCjC,8EAA8E;IAC9E,OAAO,CAAC,eAAe;IAyBvB;;OAEG;IACH,OAAO,CAAC,aAAa;IASrB;;OAEG;YACW,oBAAoB;IASlC;;;;;OAKG;YACW,cAAc;CAgB7B"}
|
|
@@ -29,6 +29,8 @@ import { GitCommand } from "../git-command.js";
|
|
|
29
29
|
*/
|
|
30
30
|
export declare class StashDropCommand extends GitCommand<ObjectId | undefined> {
|
|
31
31
|
private stashRefEntry;
|
|
32
|
+
/** Whether a stash was named ({@link setStashRef}): git's message for a missing one differs */
|
|
33
|
+
private stashRefGiven;
|
|
32
34
|
private dropAll;
|
|
33
35
|
/**
|
|
34
36
|
* Set the stash reference to drop (0-based index).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stash-drop-command.d.ts","sourceRoot":"","sources":["../../src/commands/stash-drop-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC;IACpE,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,OAAO,CAAS;IAExB;;;;;;;;OAQG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"stash-drop-command.d.ts","sourceRoot":"","sources":["../../src/commands/stash-drop-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC;IACpE,OAAO,CAAC,aAAa,CAAK;IAC1B,+FAA+F;IAC/F,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,OAAO,CAAS;IAExB;;;;;;;;OAQG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAQlC;IAED;;OAEG;IACH,WAAW,IAAI,MAAM,CAEpB;IAED;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAIzB;IAED;;OAEG;IACH,MAAM,IAAI,OAAO,CAEhB;IAED;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAoE1C;IAED;;;OAGG;YACW,cAAc;CAa7B"}
|
|
@@ -21,6 +21,11 @@ export interface WorkingCopyStashContext {
|
|
|
21
21
|
worktree: Worktree;
|
|
22
22
|
/** HEAD's tree (undefined before the first commit) */
|
|
23
23
|
headTree: () => Promise<ObjectId | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* `git stash push -- <pathspec>`: the paths stashed and reset (the index tree is the whole
|
|
26
|
+
* index all the same); absent: every path
|
|
27
|
+
*/
|
|
28
|
+
pathFilter?: (path: string) => boolean;
|
|
24
29
|
}
|
|
25
30
|
/**
|
|
26
31
|
* The stash working-tree provider `git.stashCreate()` uses when none is set and the working
|
|
@@ -32,6 +37,8 @@ export declare class WorkingCopyStashProvider implements StashWorkingTreeProvide
|
|
|
32
37
|
private scanned?;
|
|
33
38
|
constructor(context: WorkingCopyStashContext);
|
|
34
39
|
private get source();
|
|
40
|
+
/** `core.ignorecase`: the untracked walks fold case asking the index (dir.c's name hashes) */
|
|
41
|
+
private get ignoreCase();
|
|
35
42
|
/** The index compared with the worktree, once. */
|
|
36
43
|
private scan;
|
|
37
44
|
getIndexTree(): Promise<ObjectId>;
|
|
@@ -51,6 +58,22 @@ export declare class WorkingCopyStashProvider implements StashWorkingTreeProvide
|
|
|
51
58
|
* that differ are written; untracked files are kept unless removed by the clean.
|
|
52
59
|
*/
|
|
53
60
|
resetHard(options?: StashResetOptions): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* `git stash push --staged` after the staged changes left the worktree: the index made to
|
|
63
|
+
* match HEAD (`git reset -q --refresh -- <pathspec>`, every path without one), each entry
|
|
64
|
+
* taken from HEAD given its file's stat where the file holds HEAD's content (the refresh).
|
|
65
|
+
*/
|
|
66
|
+
resetIndexToHead(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* The untracked files of a pathspec stash removed (git adds them and applies the stash's
|
|
69
|
+
* diff in reverse, `git apply --index -R`): each file, then the directories it leaves empty.
|
|
70
|
+
*
|
|
71
|
+
* A deliberate divergence under `core.ignorecase`: for `stash push -u -- A` with `A/y.txt`
|
|
72
|
+
* beside a tracked `a/`, git's `add` stages `a/y.txt` (adjust_dirname_case) and its
|
|
73
|
+
* reverse apply then fails ("No valid patches in input"), leaving the file on disk and
|
|
74
|
+
* staged after saving the stash; ours removes the file the stash saved, losing nothing.
|
|
75
|
+
*/
|
|
76
|
+
private removeUntracked;
|
|
54
77
|
/**
|
|
55
78
|
* `git clean -fd` (`-x` with `ignored`): the untracked files, then the untracked
|
|
56
79
|
* directories left empty, deepest first. A directory is removed only when nothing at all
|