@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,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's interactive hunk selection (add-patch.c) as a library: the per-file diff is split
|
|
3
|
+
* into git's hunks, a selector callback answers each prompt as a user would answer git on
|
|
4
|
+
* standard input, and the selected hunks are reassembled into a patch and applied. What git
|
|
5
|
+
* prints (the file headers, hunks, prompts, help and errors) is gathered as text, so a
|
|
6
|
+
* terminal host can show it exactly as git does.
|
|
7
|
+
*
|
|
8
|
+
* The diff and the patch are "binary strings" (one byte per character); the texts given to
|
|
9
|
+
* the selector and gathered in the output are decoded as paths are (`decodeGitPath`).
|
|
10
|
+
*/
|
|
11
|
+
import type { PatchApplyArgs, PatchMode, PatchPromptKind } from "./patch-modes.js";
|
|
12
|
+
/** The git version whose prompts and behaviour are reproduced. */
|
|
13
|
+
export type PatchCompatibility = "2.43" | "2.56";
|
|
14
|
+
/** One read git makes from standard input (or its editor) while selecting hunks. */
|
|
15
|
+
export type PatchRequest = {
|
|
16
|
+
/** The prompt after a hunk: answered with git's commands (`y`, `n`, `s`, `g3`, `/re`...) */
|
|
17
|
+
type: "hunk";
|
|
18
|
+
mode: PatchMode["name"];
|
|
19
|
+
/** The file's path (the diff's `a/` side) */
|
|
20
|
+
path: string;
|
|
21
|
+
kind: PatchPromptKind;
|
|
22
|
+
/** Index of the hunk in the file (0-based) */
|
|
23
|
+
hunkIndex: number;
|
|
24
|
+
hunkCount: number;
|
|
25
|
+
/** The hunk as git shows it (the header hunk of a file without hunks: empty) */
|
|
26
|
+
hunk: string;
|
|
27
|
+
/** The prompt as git prints it, e.g. `(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? ` */
|
|
28
|
+
prompt: string;
|
|
29
|
+
/** The commands the prompt offers, in its order (`y`, `n`, `q`, `a`, `d`, ..., `?`) */
|
|
30
|
+
choices: string[];
|
|
31
|
+
/** The earlier decision on this hunk (2.5x shows it as " (was: y)") */
|
|
32
|
+
decision?: "y" | "n";
|
|
33
|
+
/** What git would have printed so far */
|
|
34
|
+
output: string;
|
|
35
|
+
} | {
|
|
36
|
+
/** The edit of a hunk (`e`): the buffer git hands its editor; answer the edited buffer */
|
|
37
|
+
type: "edit";
|
|
38
|
+
mode: PatchMode["name"];
|
|
39
|
+
path: string;
|
|
40
|
+
text: string;
|
|
41
|
+
} | {
|
|
42
|
+
/** A yes/no question ("Your edited hunk does not apply. Edit again ...", "Apply them to the worktree anyway? ") */
|
|
43
|
+
type: "yesno";
|
|
44
|
+
prompt: string;
|
|
45
|
+
} | {
|
|
46
|
+
/** `g` without a number: "go to which hunk? " */
|
|
47
|
+
type: "goto";
|
|
48
|
+
prompt: string;
|
|
49
|
+
} | {
|
|
50
|
+
/** `/` without a pattern: "search for regex? " */
|
|
51
|
+
type: "search";
|
|
52
|
+
prompt: string;
|
|
53
|
+
} | {
|
|
54
|
+
/**
|
|
55
|
+
* `git add -i`'s menus (add-interactive.c's `list_and_choose`): the main loop's
|
|
56
|
+
* "What now> " (one item), or a selection of files ("Update>> ", "Revert>> ", "Add
|
|
57
|
+
* untracked>> ", "Patch update>> ", "Review diff>> "), answered with numbers, ranges
|
|
58
|
+
* (`1-3`, `3-`), unique prefixes, `*`, `-` to deselect, `?` for help, an empty line to
|
|
59
|
+
* finish
|
|
60
|
+
*/
|
|
61
|
+
type: "choose";
|
|
62
|
+
/** The prompt as git prints it (`What now> `, `Update>> `) */
|
|
63
|
+
prompt: string;
|
|
64
|
+
/** One item is chosen (the main menu), not several */
|
|
65
|
+
singleton: boolean;
|
|
66
|
+
/** The items listed, in their order (numbered from 1) */
|
|
67
|
+
items: string[];
|
|
68
|
+
/** What `git add -i` would have printed so far */
|
|
69
|
+
output: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Answers git's reads: the line typed (without its line end), or undefined for the end of
|
|
73
|
+
* input (EOF; for `edit`: the editor failed). An `edit` request is answered with the whole
|
|
74
|
+
* edited buffer.
|
|
75
|
+
*/
|
|
76
|
+
export type PatchSelector = (request: PatchRequest) => string | undefined | Promise<string | undefined>;
|
|
77
|
+
/** What a patch selection printed and did. */
|
|
78
|
+
export interface PatchResult {
|
|
79
|
+
/** Standard output, as git prints it: headers, hunks, prompts, help and messages */
|
|
80
|
+
output: string;
|
|
81
|
+
/** Standard error: git apply's errors and add-patch's `error:` lines (2.43's messages too) */
|
|
82
|
+
errors: string;
|
|
83
|
+
/** Paths whose selected hunks were applied */
|
|
84
|
+
applied: string[];
|
|
85
|
+
/** Whether the selection ended with `q` (or the end of input) */
|
|
86
|
+
quit: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** How the engine reaches the repository. */
|
|
89
|
+
export interface PatchBackend {
|
|
90
|
+
/** The diff to select from (`diff-files -p`, `diff-index -p ...`), as a binary string */
|
|
91
|
+
diff(): Promise<string>;
|
|
92
|
+
/**
|
|
93
|
+
* Runs `git apply` with the patch (a binary string); true when it applied (or, with
|
|
94
|
+
* `check`, would apply). Its standard error goes to `errors`.
|
|
95
|
+
*/
|
|
96
|
+
apply(patch: string, args: PatchApplyArgs & {
|
|
97
|
+
check?: boolean;
|
|
98
|
+
}): Promise<{
|
|
99
|
+
ok: boolean;
|
|
100
|
+
errors: string;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* `repo_refresh_and_write_index` of the index the selection works on: refreshed and
|
|
104
|
+
* written, what it prints on standard output (`<path>: needs merge`) handed back. None for
|
|
105
|
+
* an index whose refresh shows nothing (`stash -p`'s temporary one).
|
|
106
|
+
*/
|
|
107
|
+
refresh?(): Promise<string>;
|
|
108
|
+
}
|
|
109
|
+
/** Options of {@link runAddPatch}. */
|
|
110
|
+
export interface AddPatchOptions {
|
|
111
|
+
mode: PatchMode;
|
|
112
|
+
backend: PatchBackend;
|
|
113
|
+
selector: PatchSelector;
|
|
114
|
+
/** Default 2.56 */
|
|
115
|
+
compatibility?: PatchCompatibility;
|
|
116
|
+
/** `--no-auto-advance` (2.5x): stay in a file until `q`, apply after the last file */
|
|
117
|
+
autoAdvance?: boolean;
|
|
118
|
+
/** `core.commentChar` / `core.commentString` (default `#`) */
|
|
119
|
+
commentString?: string;
|
|
120
|
+
/** `add -p` run from a command that disallows `e` (ADD_P_DISALLOW_EDIT) */
|
|
121
|
+
disallowEdit?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Runs git's interactive hunk selection: the backend's diff is split into hunks, each
|
|
125
|
+
* prompt goes to the selector, and the selected hunks are applied through the backend.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* const answers = ["y", "n", "s", "y", "q"];
|
|
130
|
+
* const result = await runAddPatch({
|
|
131
|
+
* mode: PATCH_MODES.stage,
|
|
132
|
+
* backend,
|
|
133
|
+
* selector: () => answers.shift(),
|
|
134
|
+
* });
|
|
135
|
+
* process.stdout.write(result.output);
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export declare function runAddPatch(options: AddPatchOptions): Promise<PatchResult>;
|
|
139
|
+
//# sourceMappingURL=add-patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-patch.d.ts","sourceR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AM,CAAC;IACvB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAq/BD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAEhF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The repository side of a patch selection: the diff add-patch.c asks git for (`diff-files
|
|
3
|
+
* -p`, `diff-index -p [--cached] [-R] <rev>`, with its options) and the `git apply` runs
|
|
4
|
+
* that apply the selected hunks, both in-process through `DiffCommand` and `ApplyCommand`.
|
|
5
|
+
*/
|
|
6
|
+
import type { XdiffAlgorithm } from "@statewalker/vcs-utils";
|
|
7
|
+
import { type StagingEntry } from "@statewalker/vcs-working-tree";
|
|
8
|
+
import { GitCommand } from "../../git-command.js";
|
|
9
|
+
import type { WorkingCopy } from "../../types.js";
|
|
10
|
+
import type { PatchBackend } from "./add-patch.js";
|
|
11
|
+
import type { PatchMode } from "./patch-modes.js";
|
|
12
|
+
/** An entry of a {@link TemporaryIndex}. */
|
|
13
|
+
export interface TemporaryIndexEntry {
|
|
14
|
+
mode: number;
|
|
15
|
+
objectId: string;
|
|
16
|
+
/**
|
|
17
|
+
* What the entry took over from the repository's index besides its id: its stat data and
|
|
18
|
+
* flags (skip-worktree, assume-unchanged), kept while the entry holds the same id and mode
|
|
19
|
+
*/
|
|
20
|
+
carried?: Omit<StagingEntry, "path" | "mode" | "objectId" | "stage">;
|
|
21
|
+
}
|
|
22
|
+
/** An index held in memory (`GIT_INDEX_FILE` pointing at a temporary index). */
|
|
23
|
+
export type TemporaryIndex = Map<string, TemporaryIndexEntry>;
|
|
24
|
+
/** Options of {@link createPatchBackend}. */
|
|
25
|
+
export interface PatchBackendOptions {
|
|
26
|
+
workingCopy: WorkingCopy;
|
|
27
|
+
mode: PatchMode;
|
|
28
|
+
/** The revision the diff compares with (`diff-index <rev>`); the empty tree for none */
|
|
29
|
+
revision?: string;
|
|
30
|
+
/** The pathspec elements */
|
|
31
|
+
paths?: string[];
|
|
32
|
+
/** `-U<n>` / `diff.context` (add-patch passes it on) */
|
|
33
|
+
context?: number;
|
|
34
|
+
/** `--inter-hunk-context` / `diff.interHunkContext` */
|
|
35
|
+
interHunkContext?: number;
|
|
36
|
+
/** `diff.algorithm` (add-patch passes it on as `--diff-algorithm`) */
|
|
37
|
+
algorithm?: XdiffAlgorithm;
|
|
38
|
+
/**
|
|
39
|
+
* `stash -p`'s temporary index (HEAD's tree): the diff shows only its paths, and the
|
|
40
|
+
* selected hunks are applied to it (`apply --cached` with `GIT_INDEX_FILE`)
|
|
41
|
+
*/
|
|
42
|
+
temporaryIndex?: TemporaryIndex;
|
|
43
|
+
/**
|
|
44
|
+
* The command running the selection: the index refresh and `git apply` run their hooks
|
|
45
|
+
* (post-index-change) in its hook session, so its `getHookOutput()` gathers their output
|
|
46
|
+
*/
|
|
47
|
+
hookSource?: GitCommand<unknown>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The backend add-patch.c's child processes are: the diff as git prints it for patch mode
|
|
51
|
+
* (`--no-color --ignore-submodules=dirty -p`, no renames, plumbing's prefixes and no
|
|
52
|
+
* textconv), and `git apply` with the mode's arguments.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createPatchBackend(options: PatchBackendOptions): PatchBackend;
|
|
55
|
+
/**
|
|
56
|
+
* `repo_refresh_and_write_index(r, REFRESH_QUIET, ...)` as add-patch.c runs it: the stage-0
|
|
57
|
+
* entries whose files still hold their content take the files' stat, the index is written
|
|
58
|
+
* (racily clean entries smudged), and each unmerged path is reported as `<path>: needs
|
|
59
|
+
* merge` on standard output, which is what the call returns.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export declare class IndexRefresh extends GitCommand<string> {
|
|
64
|
+
private gentle;
|
|
65
|
+
/**
|
|
66
|
+
* git's `gentle`: an index lock another process holds is no failure (the index refreshed
|
|
67
|
+
* in memory, nothing written, no message)
|
|
68
|
+
*/
|
|
69
|
+
setGentle(gentle?: boolean): this;
|
|
70
|
+
call(): Promise<string>;
|
|
71
|
+
/**
|
|
72
|
+
* The refresh, telling whether `refresh_index` found errors (an unmerged entry remains:
|
|
73
|
+
* `has_errors`, which makes `repo_refresh_and_write_index` return 1).
|
|
74
|
+
*/
|
|
75
|
+
refresh(): Promise<{
|
|
76
|
+
output: string;
|
|
77
|
+
hasErrors: boolean;
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=patch-backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-backend.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/patch-backend.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAIL,KAAK,YAAY,EAGlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;CACtE;AAED,gFAAgF;AAChF,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAE9D,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAkF7E;AAED;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,UAAU,CAAC,MAAM,CAAC;IAClD,OAAO,CAAC,MAAM,CAAS;IAEvB;;;OAGG;IACH,SAAS,CAAC,MAAM,UAAO,GAAG,IAAI,CAG7B;IAEK,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAE5B;IAED;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAqD/D;CACF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The patch modes of git's interactive hunk selection (add-patch.c's `patch_mode_*`
|
|
3
|
+
* tables): which diff each mode shows, how the selected hunks are applied, and the texts
|
|
4
|
+
* git prints for them.
|
|
5
|
+
*/
|
|
6
|
+
/** The patch mode git picks for a command (add-patch.c's `patch_mode_*`). */
|
|
7
|
+
export type PatchModeName =
|
|
8
|
+
/** `add -p` */
|
|
9
|
+
"stage"
|
|
10
|
+
/** `stash push -p` */
|
|
11
|
+
| "stash"
|
|
12
|
+
/** `reset -p [HEAD]`, `restore -p --staged` */
|
|
13
|
+
| "reset_head"
|
|
14
|
+
/** `reset -p <tree-ish>`, `restore -p --staged --source=<tree-ish>` */
|
|
15
|
+
| "reset_nothead"
|
|
16
|
+
/** `checkout -p`, `restore -p` (from the index) */
|
|
17
|
+
| "checkout_index"
|
|
18
|
+
/** `checkout -p HEAD`, `restore -p --staged --worktree` */
|
|
19
|
+
| "checkout_head"
|
|
20
|
+
/** `checkout -p <tree-ish>`, `restore -p -SW --source=<tree-ish>` */
|
|
21
|
+
| "checkout_nothead"
|
|
22
|
+
/** `restore -p --source=HEAD` */
|
|
23
|
+
| "worktree_head"
|
|
24
|
+
/** `restore -p --source=<tree-ish>` */
|
|
25
|
+
| "worktree_nothead";
|
|
26
|
+
/** The diff a mode shows (add-patch.c's `diff_cmd`). */
|
|
27
|
+
export type PatchDiffKind =
|
|
28
|
+
/** `diff-files`: the index against the worktree */
|
|
29
|
+
"files"
|
|
30
|
+
/** `diff-index <rev>`: the revision against the worktree */
|
|
31
|
+
| "index"
|
|
32
|
+
/** `diff-index --cached <rev>`: the revision against the index */
|
|
33
|
+
| "index-cached";
|
|
34
|
+
/** How `git apply` is run (`--cached`, `-R`). */
|
|
35
|
+
export interface PatchApplyArgs {
|
|
36
|
+
cached: boolean;
|
|
37
|
+
reverse: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** A patch mode: its diff, how it applies, and its texts. */
|
|
40
|
+
export interface PatchMode {
|
|
41
|
+
readonly name: PatchModeName;
|
|
42
|
+
readonly diff: PatchDiffKind;
|
|
43
|
+
/** `-R` given to the diff */
|
|
44
|
+
readonly diffReverse: boolean;
|
|
45
|
+
/** `apply_args`; undefined for the checkout modes (`apply_for_checkout`) */
|
|
46
|
+
readonly applyArgs?: PatchApplyArgs;
|
|
47
|
+
/** `apply_check_args` */
|
|
48
|
+
readonly applyCheckArgs: PatchApplyArgs;
|
|
49
|
+
readonly isReverse: boolean;
|
|
50
|
+
readonly indexOnly: boolean;
|
|
51
|
+
readonly applyForCheckout: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The prompts (mode change, deletion, addition, hunk), with git's `%s` placeholders: 2.5x
|
|
54
|
+
* takes the earlier decision (" (was: y)") and then the choices, 2.43 only the choices
|
|
55
|
+
*/
|
|
56
|
+
readonly promptMode: readonly [string, string, string, string];
|
|
57
|
+
readonly editHunkHint: string;
|
|
58
|
+
readonly helpPatchText: string;
|
|
59
|
+
}
|
|
60
|
+
/** The kind of a prompt (add-patch.c's `prompt_mode_type`). */
|
|
61
|
+
export type PatchPromptKind = "mode-change" | "deletion" | "addition" | "hunk";
|
|
62
|
+
/** The index of a prompt kind in {@link PatchMode.promptMode}. */
|
|
63
|
+
export declare function promptIndex(kind: PatchPromptKind): number;
|
|
64
|
+
/** add-patch.c's patch modes, by name. */
|
|
65
|
+
export declare const PATCH_MODES: Readonly<Record<PatchModeName, PatchMode>>;
|
|
66
|
+
/**
|
|
67
|
+
* The mode `run_add_p` picks: `stage` for add, `stash` for stash, and for reset, checkout
|
|
68
|
+
* and restore by the revision (none: from the index; `HEAD`; another one).
|
|
69
|
+
*/
|
|
70
|
+
export declare function patchModeFor(command: "add" | "stash" | "reset" | "checkout" | "worktree", revision?: string): PatchMode;
|
|
71
|
+
//# sourceMappingURL=patch-modes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-modes.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/patch-modes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6EAA6E;AAC7E,MAAM,MAAM,aAAa;AACvB,eAAe;AACb,OAAO;AACT,sBAAsB;GACpB,OAAO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e,GAAG,MAAM,CAEzD;AA4BD,0CAA0C;AAC1C,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,CAoHlE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,EAC5D,QAAQ,CAAC,EAAE,MAAM,GAChB,SAAS,CAsBX"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `run_add_p` for the commands: the configuration add-patch.c reads (`diff.context`,
|
|
3
|
+
* `diff.interHunkContext`, `diff.algorithm`, the comment character), the backend and the
|
|
4
|
+
* selection.
|
|
5
|
+
*/
|
|
6
|
+
import type { GitCommand } from "../../git-command.js";
|
|
7
|
+
import type { WorkingCopy } from "../../types.js";
|
|
8
|
+
import { type PatchCompatibility, type PatchResult, type PatchSelector } from "./add-patch.js";
|
|
9
|
+
import { type TemporaryIndex } from "./patch-backend.js";
|
|
10
|
+
import { type PatchMode } from "./patch-modes.js";
|
|
11
|
+
/** The patch-mode options every `-p` command takes. */
|
|
12
|
+
export interface PatchOptions {
|
|
13
|
+
/** `-U<n>` / `--unified=<n>` (default `diff.context`) */
|
|
14
|
+
context?: number;
|
|
15
|
+
/** `--inter-hunk-context=<n>` (default `diff.interHunkContext`) */
|
|
16
|
+
interHunkContext?: number;
|
|
17
|
+
/** `--no-auto-advance` (git 2.5x): false stays in a file until `q` and applies at the end */
|
|
18
|
+
autoAdvance?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** What {@link runPatchSelection} needs besides the options. */
|
|
21
|
+
export interface PatchSelectionRequest extends PatchOptions {
|
|
22
|
+
mode: PatchMode;
|
|
23
|
+
selector: PatchSelector | undefined;
|
|
24
|
+
/** The revision the diff compares with (a tree-ish; the empty tree for an unborn HEAD) */
|
|
25
|
+
diffRevision?: string;
|
|
26
|
+
paths: string[];
|
|
27
|
+
compatibility?: PatchCompatibility;
|
|
28
|
+
temporaryIndex?: TemporaryIndex;
|
|
29
|
+
/** The command running the selection, whose hook session gathers the hooks' output */
|
|
30
|
+
hookSource?: GitCommand<unknown>;
|
|
31
|
+
}
|
|
32
|
+
/** Runs a patch selection as `run_add_p` does for a command. */
|
|
33
|
+
export declare function runPatchSelection(workingCopy: WorkingCopy, request: PatchSelectionRequest): Promise<PatchResult>;
|
|
34
|
+
/**
|
|
35
|
+
* The revision checkout's patch mode hands run_add_p, and the one its diff compares with:
|
|
36
|
+
* `HEAD` stays `HEAD` (the empty tree on an unborn branch), a commit becomes its full id
|
|
37
|
+
* (`<a>...<b>` included), a tree keeps its name.
|
|
38
|
+
*/
|
|
39
|
+
export declare function patchRevisionOf(revision: string | undefined, access: {
|
|
40
|
+
headId: () => Promise<string | undefined>;
|
|
41
|
+
resolve: (name: string) => Promise<string>;
|
|
42
|
+
peelCommit: (id: string) => Promise<string | undefined>;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
revision?: string;
|
|
45
|
+
diffRevision?: string;
|
|
46
|
+
}>;
|
|
47
|
+
/** The mode of a path checkout's `-p` by what it restores (builtin/checkout.c). */
|
|
48
|
+
export declare function pathPatchMode(index: boolean, worktree: boolean, revision?: string): PatchMode;
|
|
49
|
+
//# sourceMappingURL=patch-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-session.d.ts","sourceRoot":"","sources":["../../../src/commands/add-patch/patch-session.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7E,O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,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAI7F"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git am`: applies a series of patches from mailboxes, committing each with the author,
|
|
3
|
+
* date and message of its mail, as git does: the state in `.git/rebase-apply/` (the split
|
|
4
|
+
* mails `0001`..., `next`, `last`, `info`, `msg`, `patch`, `final-commit`,
|
|
5
|
+
* `author-script`, the option files, `abort-safety`), `ORIG_HEAD`, the reflog lines
|
|
6
|
+
* (`am: <subject>`, `am --abort`), the output ("Applying: <subject>", "Patch failed at
|
|
7
|
+
* ...") and the advice, and `--continue`, `--skip`, `--abort`, `--quit`.
|
|
8
|
+
*
|
|
9
|
+
* Not run: the `applypatch-msg`, `pre-applypatch` and `post-applypatch` hooks, rerere,
|
|
10
|
+
* and the auto maintenance git starts at the end. Notes are not copied: plain `git am`
|
|
11
|
+
* copies none (only `rebase --apply` does, through `rewritten`).
|
|
12
|
+
*/
|
|
13
|
+
import { GitCommand } from "../../git-command.js";
|
|
14
|
+
import { type AmPatchFormat } from "./patch-format.js";
|
|
15
|
+
/** What `git am` printed and how it ended. */
|
|
16
|
+
export interface AmResult {
|
|
17
|
+
/** 0 done, 128 stopped (a patch that does not apply, an error) */
|
|
18
|
+
exitCode: number;
|
|
19
|
+
output: string;
|
|
20
|
+
errors: string;
|
|
21
|
+
}
|
|
22
|
+
/** The options `git am` passes to `git apply` (kept in `apply-opt`). */
|
|
23
|
+
export interface AmApplyOptions {
|
|
24
|
+
/** `-C<n>` */
|
|
25
|
+
context?: number;
|
|
26
|
+
/** `-p<n>` */
|
|
27
|
+
strip?: number;
|
|
28
|
+
/** `--whitespace=<action>` */
|
|
29
|
+
whitespace?: string;
|
|
30
|
+
/** `--directory=<dir>` */
|
|
31
|
+
directory?: string;
|
|
32
|
+
/** `--exclude=<path>` */
|
|
33
|
+
exclude?: string[];
|
|
34
|
+
/** `--include=<path>` */
|
|
35
|
+
include?: string[];
|
|
36
|
+
/** `--reject` */
|
|
37
|
+
reject?: boolean;
|
|
38
|
+
/** `--ignore-whitespace` */
|
|
39
|
+
ignoreWhitespace?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `git am`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* await git.am().addMbox(mboxBytes).setThreeWay(true).call();
|
|
47
|
+
* await git.am().setResume("continue").call();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class AmCommand extends GitCommand<AmResult> {
|
|
51
|
+
private mboxes;
|
|
52
|
+
private patchFormat?;
|
|
53
|
+
private fixedClock?;
|
|
54
|
+
private resume?;
|
|
55
|
+
private threeWay?;
|
|
56
|
+
private signoff;
|
|
57
|
+
private keepCr?;
|
|
58
|
+
private keep;
|
|
59
|
+
private messageId?;
|
|
60
|
+
private scissors?;
|
|
61
|
+
private quiet;
|
|
62
|
+
private noVerify;
|
|
63
|
+
private utf8;
|
|
64
|
+
private ignoreDate;
|
|
65
|
+
private committerDateIsAuthorDate;
|
|
66
|
+
private mboxrd;
|
|
67
|
+
private emptyMode;
|
|
68
|
+
private applyOptions;
|
|
69
|
+
private legacyMessages;
|
|
70
|
+
private out;
|
|
71
|
+
private err;
|
|
72
|
+
/**
|
|
73
|
+
* A mailbox (mbox) to apply, in order. `name` is its file's name as git shows it in
|
|
74
|
+
* messages (the file argument); a named file's format is detected (from the first one)
|
|
75
|
+
* and it must not be empty, while one without a name reads as standard input (an mbox).
|
|
76
|
+
*/
|
|
77
|
+
addMbox(mbox: Uint8Array | string, name?: string): this;
|
|
78
|
+
/**
|
|
79
|
+
* `--patch-format=<format>`: mbox, mboxrd, stgit or hg (Mercurial); detected from the
|
|
80
|
+
* first named mailbox when not given. An StGit series (`stgit-series`) names its patch
|
|
81
|
+
* files, which a command given contents cannot open: it is refused.
|
|
82
|
+
*/
|
|
83
|
+
setPatchFormat(format: AmPatchFormat): this;
|
|
84
|
+
/**
|
|
85
|
+
* The clock (seconds since the epoch) for the dates git takes from it: the author date of
|
|
86
|
+
* `--ignore-date` or of a mail without a `Date:` header, the committer date and the reflog
|
|
87
|
+
* lines (default: the system clock).
|
|
88
|
+
*/
|
|
89
|
+
setClock(seconds: number): this;
|
|
90
|
+
protected clock(): number;
|
|
91
|
+
/** `--continue`/`--resolved`, `--allow-empty`, `--skip`, `--abort`, `--quit`. */
|
|
92
|
+
setResume(mode: "continue" | "resolved" | "allow-empty" | "skip" | "abort" | "quit"): this;
|
|
93
|
+
/** `-3` / `--3way` (default `am.threeWay`). */
|
|
94
|
+
setThreeWay(value: boolean): this;
|
|
95
|
+
/** `-s` / `--signoff`. */
|
|
96
|
+
setSignoff(value: boolean): this;
|
|
97
|
+
/** `--keep-cr` (default `am.keepcr`). */
|
|
98
|
+
setKeepCr(value: boolean): this;
|
|
99
|
+
/** `-k` (true) / `--keep-non-patch` ("non-patch"). */
|
|
100
|
+
setKeep(value: boolean | "non-patch"): this;
|
|
101
|
+
/** `-m` / `--message-id` (default `am.messageid`). */
|
|
102
|
+
setMessageId(value: boolean): this;
|
|
103
|
+
/** `-c` / `--scissors`, `--no-scissors`. */
|
|
104
|
+
setScissors(value: boolean): this;
|
|
105
|
+
/** `--no-verify`: the applypatch-msg and pre-applypatch hooks do not run. */
|
|
106
|
+
setNoVerify(value: boolean): this;
|
|
107
|
+
/** `-q`. */
|
|
108
|
+
setQuiet(value: boolean): this;
|
|
109
|
+
/** `-u` (default) / `-n`. */
|
|
110
|
+
setUtf8(value: boolean): this;
|
|
111
|
+
/** `--ignore-date`. */
|
|
112
|
+
setIgnoreDate(value: boolean): this;
|
|
113
|
+
/** `--committer-date-is-author-date`. */
|
|
114
|
+
setCommitterDateIsAuthorDate(value: boolean): this;
|
|
115
|
+
/** `--patch-format=mboxrd`. */
|
|
116
|
+
setMboxrd(value: boolean): this;
|
|
117
|
+
/** `--empty=stop|drop|keep`. */
|
|
118
|
+
setEmpty(mode: "stop" | "drop" | "keep"): this;
|
|
119
|
+
/** The options passed through to `git apply`. */
|
|
120
|
+
setApplyOptions(options: AmApplyOptions): this;
|
|
121
|
+
/** git before 2.46 prints the resolve advice on stdout, not as hints. */
|
|
122
|
+
setLegacyMessages(value: boolean): this;
|
|
123
|
+
private state;
|
|
124
|
+
private say;
|
|
125
|
+
private result;
|
|
126
|
+
call(): Promise<AmResult>;
|
|
127
|
+
private fatal;
|
|
128
|
+
private read;
|
|
129
|
+
/** `write_file_buf`: the content as it is. */
|
|
130
|
+
private write;
|
|
131
|
+
/** `write_state_text` (`write_file`): the line completed. */
|
|
132
|
+
private writeText;
|
|
133
|
+
private headId;
|
|
134
|
+
private run;
|
|
135
|
+
private setup;
|
|
136
|
+
private applyArgs;
|
|
137
|
+
private load;
|
|
138
|
+
private next;
|
|
139
|
+
private firstLine;
|
|
140
|
+
private indexHasChanges;
|
|
141
|
+
/** `die_user_resolve`: the advice, then the stop. */
|
|
142
|
+
private dieUserResolve;
|
|
143
|
+
private patchIsEmpty;
|
|
144
|
+
private amRun;
|
|
145
|
+
private runApply;
|
|
146
|
+
/** `fall_back_threeway`: the patch applied to the blobs it names, merged into HEAD. */
|
|
147
|
+
private fallBackThreeway;
|
|
148
|
+
/** Runs an am hook, its output (git's stderr) added to the am's in order. */
|
|
149
|
+
private runAmHook;
|
|
150
|
+
private doCommit;
|
|
151
|
+
private resolve;
|
|
152
|
+
private abort;
|
|
153
|
+
/**
|
|
154
|
+
* git's `clean_index(head, remote)` (`am --skip`, `am --abort`): conflicted entries reset to
|
|
155
|
+
* HEAD (a two-way merge from HEAD to HEAD that leaves every other entry, staged changes and
|
|
156
|
+
* deletions included, as it is), then the index moved to `remote` (a two-way merge from
|
|
157
|
+
* the index's own tree, so a one-way reset with git's up-to-date and untracked checks),
|
|
158
|
+
* then a merge in progress forgotten (`remove_branch_state`). A refusal prints
|
|
159
|
+
* unpack-trees' error, then dies with "failed to clean index".
|
|
160
|
+
*/
|
|
161
|
+
private cleanIndex;
|
|
162
|
+
private sequencerContext;
|
|
163
|
+
}
|
|
164
|
+
interface Fixed {
|
|
165
|
+
text: string;
|
|
166
|
+
changed: boolean;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* commit.c's `ensure_utf8` of a binary string: each byte that starts no valid UTF-8
|
|
170
|
+
* sequence (`has_invalid_utf8`: overlong forms, surrogates and non-characters included)
|
|
171
|
+
* read as Latin-1.
|
|
172
|
+
*/
|
|
173
|
+
export declare function ensureUtf8(text: string): Fixed;
|
|
174
|
+
export {};
|
|
175
|
+
//# sourceMappingURL=am-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"am-command.d.ts","sourceRoot":"","sources":["../../../src/commands/am/am-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAkClD,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,mBAAmB,CAAC;AAI3B,8CAA8C;AAC9C,MAAM,WAAW,QAAQ;IACvB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,cAAc;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,gBAAgB,CAA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AChC,KAAK;IAInB,6DAA6D;YAC/C,SAAS;YAIT,MAAM;YAIN,GAAG;YAoCH,KAAK;IAkGnB,OAAO,CAAC,SAAS;YAcH,IAAI;YA+BJ,IAAI;IAYlB,OAAO,CAAC,SAAS;YAKH,eAAe;IAO7B,qDAAqD;YACvC,cAAc;YA0Bd,YAAY;YAKZ,KAAK;YAqHL,QAAQ;IAuBtB,uFAAuF;YACzE,gBAAgB;IAkJ9B,6EAA6E;YAC/D,SAAS;YAQT,QAAQ;YA6ER,OAAO;YAwBP,KAAK;IAkBnB;;;;;;;OAOG;YACW,UAAU;IAkBxB,OAAO,CAAC,gBAAgB;CAWzB;AAiBD,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAOD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CA8C9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/am/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's mail tools as `git am` runs them: `mailsplit` (an mbox, or mboxrd, cut into one
|
|
3
|
+
* file per message) and `mailinfo` (a message's author, date and subject, its commit
|
|
4
|
+
* message and its patch: RFC 2047 headers, charsets converted to UTF-8, quoted-printable
|
|
5
|
+
* and base64 bodies, in-body `From:`/`Subject:`/`Date:` headers, scissors lines, the
|
|
6
|
+
* `---` that starts the patch). Ports of builtin/mailsplit.c and mailinfo.c on binary
|
|
7
|
+
* strings (one character per byte).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* `git mailsplit -b`: the messages of an mbox (binary string). Throws "corrupt mailbox"
|
|
11
|
+
* where git exits; an empty mbox gives none.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mailsplit(mbox: string, options?: {
|
|
14
|
+
keepCr?: boolean;
|
|
15
|
+
mboxrd?: boolean;
|
|
16
|
+
}): string[];
|
|
17
|
+
/** What mailinfo found in a message. */
|
|
18
|
+
export interface MailInfo {
|
|
19
|
+
/** The `info` file: `Author:`, `Email:`, `Subject:`, `Date:` lines and a blank line */
|
|
20
|
+
info: string;
|
|
21
|
+
/** The commit message (the body up to the patch) */
|
|
22
|
+
msg: string;
|
|
23
|
+
/** The patch */
|
|
24
|
+
patch: string;
|
|
25
|
+
/** Lines of the patch */
|
|
26
|
+
patchLines: number;
|
|
27
|
+
author: string;
|
|
28
|
+
email: string;
|
|
29
|
+
subject: string;
|
|
30
|
+
date: string;
|
|
31
|
+
/** Warnings and errors git prints */
|
|
32
|
+
errors: string;
|
|
33
|
+
formatFlowed: boolean;
|
|
34
|
+
failed: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Options of {@link mailinfo}. */
|
|
37
|
+
export interface MailInfoOptions {
|
|
38
|
+
/** `-k`: keep the subject as it is */
|
|
39
|
+
keepSubject?: boolean;
|
|
40
|
+
/** `-b`: keep brackets that do not hold "PATCH" */
|
|
41
|
+
keepNonPatchBrackets?: boolean;
|
|
42
|
+
/** `-m`: the Message-ID added to the message */
|
|
43
|
+
addMessageId?: boolean;
|
|
44
|
+
/** `--scissors` (true) / `--no-scissors` (false) */
|
|
45
|
+
useScissors?: boolean;
|
|
46
|
+
/** Convert to UTF-8 (`-u`, default); false keeps the bytes (`-n`) */
|
|
47
|
+
utf8?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The charset `-u` converts to (git's `metainfo_charset`: am's commit output encoding,
|
|
50
|
+
* `i18n.commitEncoding`); UTF-8 by default
|
|
51
|
+
*/
|
|
52
|
+
charset?: string;
|
|
53
|
+
/** `--quoted-cr=<action>` (default warn) */
|
|
54
|
+
quotedCr?: "nowarn" | "warn" | "strip";
|
|
55
|
+
}
|
|
56
|
+
/** git's `mailinfo` of one message (binary string). */
|
|
57
|
+
export declare function mailinfo(message: string, options?: MailInfoOptions): MailInfo;
|
|
58
|
+
//# sourceMappingURL=mailinfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailinfo.d.ts","sourceRoot":"","sources":["../../../src/commands/am/mailinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2CH;;;GAGG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,MAAM,EAAE,CAwBV;AAED,wCAAwC;AACxC,MAAM,WAAW,QAAQ;IACvB,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,mCAAmC;AACnC,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gDAAgD;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qEAAqE;IACrE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;CACxC;AAqXD,uDAAuD;AACvD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,QAAQ,CA8ajF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The patch formats `git am` reads besides mailboxes (builtin/am.c): the detection of a
|
|
3
|
+
* file's format (`detect_patch_format`) and the conversion of StGit and Mercurial patches
|
|
4
|
+
* to mails (`stgit_patch_to_mail`, `hg_patch_to_mail`). Contents are binary strings.
|
|
5
|
+
*/
|
|
6
|
+
/** A patch format `git am` reads (`--patch-format`). */
|
|
7
|
+
export type AmPatchFormat = "mbox" | "mboxrd" | "stgit" | "stgit-series" | "hg";
|
|
8
|
+
/**
|
|
9
|
+
* `detect_patch_format` of a file's content: its format, undefined when it is none git
|
|
10
|
+
* recognises ("Patch format detection failed.").
|
|
11
|
+
*/
|
|
12
|
+
export declare function detectPatchFormat(content: string): AmPatchFormat | undefined;
|
|
13
|
+
/** `stgit_patch_to_mail`: an StGit patch as a mail. */
|
|
14
|
+
export declare function stgitPatchToMail(patch: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* `hg_patch_to_mail`: a Mercurial patch (`hg export`) as a mail; its error ("invalid Date
|
|
17
|
+
* line", ...) when the header does not parse.
|
|
18
|
+
*/
|
|
19
|
+
export declare function hgPatchToMail(patch: string): {
|
|
20
|
+
mail: string;
|
|
21
|
+
} | {
|
|
22
|
+
error: string;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=patch-format.d.ts.map
|