@statewalker/vcs-commands 0.4.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 +299 -34
- 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 +67 -4
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +179 -7
- 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 +93 -0
- package/dist/commands/core-config.d.ts.map +1 -0
- 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 +244 -23
- 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 +55 -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 +146 -6
- 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 +69 -13
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-create-command.d.ts +214 -26
- package/dist/commands/stash-create-command.d.ts.map +1 -1
- package/dist/commands/stash-drop-command.d.ts +10 -2
- package/dist/commands/stash-drop-command.d.ts.map +1 -1
- package/dist/commands/stash-list-command.d.ts +2 -4
- package/dist/commands/stash-list-command.d.ts.map +1 -1
- package/dist/commands/stash-working-tree.d.ts +95 -0
- package/dist/commands/stash-working-tree.d.ts.map +1 -0
- package/dist/commands/status-command.d.ts +320 -28
- 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 +137 -6
- 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 +204 -0
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -0
- 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/core-commands/index.d.ts +0 -3
- package/dist/core-commands/index.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 +29 -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 +371 -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 +422 -32
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +326 -5
- 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/index.d.ts +1 -0
- package/dist/remote-config/index.d.ts.map +1 -1
- package/dist/remote-config/remote-config-store.d.ts +123 -3
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/remote-config/remote-refs.d.ts +41 -0
- package/dist/remote-config/remote-refs.d.ts.map +1 -0
- 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 +16 -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 +24 -1
- 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 +143 -18
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/results-BZGa2Z3I.js +2934 -0
- package/dist/transport-command.d.ts +56 -1
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +15 -10
- package/src/commands/add-command.ts +1291 -224
- 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 +1426 -297
- package/src/commands/checkout-paths.ts +784 -0
- package/src/commands/cherry-pick-command.ts +156 -396
- package/src/commands/clean-command.ts +532 -85
- package/src/commands/clone-command.ts +826 -55
- package/src/commands/commit-command.ts +1781 -166
- package/src/commands/core-config.ts +196 -0
- 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 +1038 -79
- 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 +83 -0
- package/src/commands/init-command.ts +60 -11
- 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 +500 -19
- package/src/commands/remote-transport.ts +383 -0
- package/src/commands/reset-command.ts +828 -91
- 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 +692 -124
- package/src/commands/stash-create-command.ts +752 -89
- package/src/commands/stash-drop-command.ts +67 -6
- package/src/commands/stash-list-command.ts +10 -4
- package/src/commands/stash-working-tree.ts +387 -0
- package/src/commands/status-command.ts +1426 -97
- 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 +344 -15
- 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 +641 -0
- 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 +9 -5
- package/src/core-commands/index.ts +0 -8
- package/src/errors/add-errors.ts +45 -0
- package/src/errors/checkout-errors.ts +46 -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 +1218 -118
- package/src/git.ts +552 -11
- package/src/index.ts +1 -1
- package/src/remote-config/index.ts +1 -0
- package/src/remote-config/remote-config-store.ts +326 -16
- package/src/remote-config/remote-refs.ts +119 -0
- 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 +18 -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 +24 -1
- 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 +288 -27
- package/src/transport-command.ts +139 -2
- package/dist/commands-BpeXZTC3.js +0 -10278
- package/dist/core-commands/checkout.command.d.ts +0 -103
- package/dist/core-commands/checkout.command.d.ts.map +0 -1
- package/dist/core-commands/checkout.command.impl.d.ts +0 -110
- package/dist/core-commands/checkout.command.impl.d.ts.map +0 -1
- package/dist/status-result-BapZoQaR.js +0 -411
- package/src/core-commands/checkout.command.impl.ts +0 -564
- package/src/core-commands/checkout.command.ts +0 -125
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type Commit, type ObjectId, type PersonIdent } from "@statewalker/vcs-core";
|
|
2
|
+
import { type Worktree } from "@statewalker/vcs-working-tree";
|
|
3
3
|
import { GitCommand } from "../git-command.js";
|
|
4
|
+
import { CleanupMode } from "./message-cleanup.js";
|
|
5
|
+
import { type StatusTextResult, type UntrackedFilesMode } from "./status-command.js";
|
|
4
6
|
/**
|
|
5
7
|
* Result of a commit operation.
|
|
6
8
|
*
|
|
@@ -61,18 +63,66 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
61
63
|
private message?;
|
|
62
64
|
private author?;
|
|
63
65
|
private committer?;
|
|
66
|
+
/** `--author=<name> <email>`: dated when the commit is made */
|
|
67
|
+
private authorName?;
|
|
68
|
+
/** A committer named without a date, dated when the commit is made */
|
|
69
|
+
private committerName?;
|
|
70
|
+
private resetAuthor;
|
|
64
71
|
private amend;
|
|
72
|
+
private noPostRewrite;
|
|
73
|
+
private noVerify;
|
|
65
74
|
private allowEmpty;
|
|
66
75
|
private parents;
|
|
67
76
|
private onlyPaths;
|
|
68
77
|
private all;
|
|
78
|
+
private include;
|
|
79
|
+
private includePaths;
|
|
69
80
|
private worktreeIterator;
|
|
81
|
+
private cleanupMode?;
|
|
82
|
+
private allowEmptyMessage;
|
|
83
|
+
private editor?;
|
|
84
|
+
private edit?;
|
|
85
|
+
private includeStatus?;
|
|
86
|
+
private verbose?;
|
|
87
|
+
private untrackedMode?;
|
|
88
|
+
private statusFormat?;
|
|
89
|
+
private showBranch?;
|
|
90
|
+
private nullTermination;
|
|
91
|
+
private aheadBehind?;
|
|
92
|
+
private templateFile?;
|
|
70
93
|
/**
|
|
71
|
-
* Set the commit message
|
|
94
|
+
* Set the commit message, as git's `commit -m` takes it: its last line is ended and it is
|
|
95
|
+
* cleaned up (`whitespace` by default, see {@link setCleanupMode}), so `"Fix"` is stored
|
|
96
|
+
* as `"Fix\n"` and the commit gets native git's id.
|
|
72
97
|
*
|
|
73
98
|
* @param message Commit message
|
|
74
99
|
*/
|
|
75
100
|
setMessage(message: string): this;
|
|
101
|
+
/**
|
|
102
|
+
* Add a paragraph to the message, as each further `-m` of `git commit` does: the
|
|
103
|
+
* message so far gets its last line ended and a blank line, then this one (`-m a -m b`
|
|
104
|
+
* is `"a\n\nb\n"`). The first call is {@link setMessage}.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* await git.commit().addMessage("Subject").addMessage("Body paragraph.").call();
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @param message One paragraph of the commit message
|
|
112
|
+
*/
|
|
113
|
+
addMessage(message: string): this;
|
|
114
|
+
/**
|
|
115
|
+
* How the message is cleaned up (git's `--cleanup=<mode>`; default `commit.cleanup`, else
|
|
116
|
+
* `default`, which without an editor is `whitespace`: trailing whitespace and surrounding
|
|
117
|
+
* blank lines dropped, blank runs collapsed). `strip` also drops comment lines;
|
|
118
|
+
* `verbatim` keeps the message as given (with its last line ended, as `-m` does).
|
|
119
|
+
*/
|
|
120
|
+
setCleanupMode(mode: CleanupMode): this;
|
|
121
|
+
/**
|
|
122
|
+
* Allow a message that is empty after its cleanup (git's `--allow-empty-message`);
|
|
123
|
+
* without it such a commit is refused: `Aborting commit due to empty commit message.`
|
|
124
|
+
*/
|
|
125
|
+
setAllowEmptyMessage(allow: boolean): this;
|
|
76
126
|
/**
|
|
77
127
|
* Set the author identity.
|
|
78
128
|
*
|
|
@@ -99,6 +149,24 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
99
149
|
* @param committer Committer identity
|
|
100
150
|
*/
|
|
101
151
|
setCommitterIdent(committer: PersonIdent): this;
|
|
152
|
+
/**
|
|
153
|
+
* `--reset-author`: an amended commit, or the commit that concludes a cherry-pick, is
|
|
154
|
+
* authored as a new one (the author resolved as git resolves it, dated now) instead of
|
|
155
|
+
* keeping the earlier commit's author.
|
|
156
|
+
*
|
|
157
|
+
* @param reset Whether to reset the author
|
|
158
|
+
*/
|
|
159
|
+
setResetAuthor(reset: boolean): this;
|
|
160
|
+
/**
|
|
161
|
+
* `--no-post-rewrite`: an amend does not carry the amended commit's notes over to the new
|
|
162
|
+
* one (`notes.rewriteRef`, `notes.rewrite.amend`), as git skips its post-rewrite step.
|
|
163
|
+
*/
|
|
164
|
+
setNoPostRewrite(noPostRewrite: boolean): this;
|
|
165
|
+
/**
|
|
166
|
+
* `-n` / `--no-verify`: the `pre-commit` and `commit-msg` hooks do not run
|
|
167
|
+
* (`prepare-commit-msg` and `post-commit` still do, as in git).
|
|
168
|
+
*/
|
|
169
|
+
setNoVerify(noVerify: boolean): this;
|
|
102
170
|
/**
|
|
103
171
|
* Set whether to amend the previous commit.
|
|
104
172
|
*
|
|
@@ -121,11 +189,25 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
121
189
|
*/
|
|
122
190
|
setParentIds(...parents: ObjectId[]): this;
|
|
123
191
|
/**
|
|
124
|
-
* Set paths to commit (--only
|
|
192
|
+
* Set paths to commit (`git commit --only <paths>`, git's partial commit).
|
|
125
193
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
194
|
+
* The paths are a pathspec, as git reads it (`d/`, `*.md`, `:(glob)d/**`, `:!d/x`,
|
|
195
|
+
* `./a`). As git's `prepare_index`: the index entries (any stage) and HEAD's files the
|
|
196
|
+
* pathspec matches are listed (`list_paths`); an element that matches none of them fails
|
|
197
|
+
* with git's "error: pathspec '<path>' did not match any file(s) known to git". The index
|
|
198
|
+
* lock is then held until HEAD has moved. Each listed path is taken from the worktree
|
|
199
|
+
* literally (`add_remove_files`): a file (ignored or not) is staged as `git add` stages it
|
|
200
|
+
* (cleaned by the content filters; an intent-to-add entry gets the content, a conflicted
|
|
201
|
+
* path is resolved to the file, the entries it clashes with as a file or a directory
|
|
202
|
+
* replaced), a path gone is removed, a submodule takes the commit checked out in it, and a
|
|
203
|
+
* path that is now a directory holding no commit refuses the commit before anything
|
|
204
|
+
* changes ("'<path>' does not have a commit checked out"). The index is
|
|
205
|
+
* written into the lock with the paths updated, and the commit records HEAD's tree with
|
|
206
|
+
* only these paths changed, whatever else is staged. The lock is renamed over the index
|
|
207
|
+
* once the commit is made; on any failure it is removed and the index (and this instance's
|
|
208
|
+
* staging, unwritten edits included) stays as it was. A skip-worktree path keeps its HEAD
|
|
209
|
+
* version. A partial commit during a merge, a cherry-pick or a rebase is refused; other
|
|
210
|
+
* unmerged paths do not stop it (they stay unmerged in the index).
|
|
129
211
|
*
|
|
130
212
|
* Cannot be combined with setAll().
|
|
131
213
|
*
|
|
@@ -137,7 +219,9 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
137
219
|
* Set whether to auto-stage modified tracked files before committing.
|
|
138
220
|
*
|
|
139
221
|
* If true, stages all modified and deleted tracked files before
|
|
140
|
-
* creating the commit. Requires a working tree iterator.
|
|
222
|
+
* creating the commit. Requires a working tree iterator. As git's: the index lock is held
|
|
223
|
+
* from before the files are staged until HEAD has moved, and the index is left as it was
|
|
224
|
+
* when the commit fails.
|
|
141
225
|
*
|
|
142
226
|
* Cannot be combined with setOnly().
|
|
143
227
|
*
|
|
@@ -148,6 +232,27 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
148
232
|
* @throws Error if combined with --only paths
|
|
149
233
|
*/
|
|
150
234
|
setAll(all: boolean): this;
|
|
235
|
+
/**
|
|
236
|
+
* Commit the index with the tracked files `paths` names staged first (`git commit -i
|
|
237
|
+
* <paths>` / `--include`, git's `prepare_index` "non partial, non as-is commit"): the index
|
|
238
|
+
* lock is taken, the tracked paths the pathspec matches are staged from the worktree as
|
|
239
|
+
* `git add -u <paths>` stages them (`add_files_to_cache`; untracked files are not added),
|
|
240
|
+
* an element that matches no index entry fails with git's "error: pathspec '<path>' did
|
|
241
|
+
* not match any file(s) known to git" (git 2.5x; 2.43 commits what is staged), and the
|
|
242
|
+
* whole index, written into the lock, is committed; the lock is renamed over the index
|
|
243
|
+
* once HEAD has moved, or removed on failure (the index stays as it was).
|
|
244
|
+
*
|
|
245
|
+
* As git: refused with {@link setOnly} paths ("options '-i/--include' and '-o/--only'
|
|
246
|
+
* cannot be used together"), with {@link setAll} ("options '-i/--include' and
|
|
247
|
+
* '-a/--all' cannot be used together"), and without paths ("No paths with
|
|
248
|
+
* --include/--only does not make sense."), when the commit runs.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```typescript
|
|
252
|
+
* await git.commit().setInclude("src/a.ts").setMessage("Fix a").call();
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
setInclude(...paths: string[]): this;
|
|
151
256
|
/**
|
|
152
257
|
* Whether --all mode is enabled.
|
|
153
258
|
*/
|
|
@@ -161,6 +266,101 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
161
266
|
* @param iterator Custom working tree iterator
|
|
162
267
|
* @returns this for chaining
|
|
163
268
|
*/
|
|
269
|
+
/**
|
|
270
|
+
* The editor of the commit message (git's `core.editor` / `GIT_EDITOR`, which a library
|
|
271
|
+
* cannot launch): called with the path of `COMMIT_EDITMSG` in the git directory and the
|
|
272
|
+
* text written there, the template git prepares (the message so far, then, unless
|
|
273
|
+
* {@link setIncludeStatus} is false, the commented help and status, and with
|
|
274
|
+
* {@link setVerbose} the diff below the scissors line). It returns the edited text, or
|
|
275
|
+
* nothing once it changed the file itself; the result is cleaned up as git cleans up an
|
|
276
|
+
* edited message (`default` strips comments, `scissors` cuts at the scissors line). It is
|
|
277
|
+
* used when no message is given, or with {@link setEdit}.
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* await git.commit().setEditor(async (_path, template) => `Subject\n\n${template}`).call();
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
setEditor(editor: CommitEditor): this;
|
|
285
|
+
/**
|
|
286
|
+
* `-t <file>` / `--template=<file>`: the editor starts from this file's text (default
|
|
287
|
+
* `commit.template`) when no message is given and nothing is in progress; a message the
|
|
288
|
+
* editor leaves as the template was is refused (`Aborting commit; you did not edit the
|
|
289
|
+
* message.`). A relative path is read from the worktree's top, through the host.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* await git.commit().setTemplate("/home/me/.gitmessage").setEditor(edit).call();
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
setTemplate(path: string): this;
|
|
297
|
+
/** `-e` / `--no-edit`: edit a given message too, or never edit (default: edit when none is given). */
|
|
298
|
+
setEdit(edit: boolean): this;
|
|
299
|
+
/** `--status` / `--no-status`: the status in the editor's template (default `commit.status`, true). */
|
|
300
|
+
setIncludeStatus(include: boolean): this;
|
|
301
|
+
/**
|
|
302
|
+
* `-v` (1) / `-vv` (2): the staged diff below the template's scissors line (and the
|
|
303
|
+
* unstaged one), or in {@link callDryRun}'s output (default `commit.verbose`)
|
|
304
|
+
*/
|
|
305
|
+
setVerbose(level: number): this;
|
|
306
|
+
/** `-u<mode>` / `--untracked-files=<mode>` of the template and the dry run */
|
|
307
|
+
setUntrackedFiles(mode: UntrackedFilesMode): this;
|
|
308
|
+
/** `--short`, `--porcelain`, `--long`: the format of {@link callDryRun} (git's commit has no v2) */
|
|
309
|
+
setStatusFormat(format: "long" | "short" | "porcelain"): this;
|
|
310
|
+
/** `--branch`: the branch header of the short and porcelain dry runs (default `status.branch`) */
|
|
311
|
+
setShowBranch(show: boolean): this;
|
|
312
|
+
/** `-z`: NUL-terminated dry-run output (porcelain unless another format is set) */
|
|
313
|
+
setNullTermination(z: boolean): this;
|
|
314
|
+
/** `--[no-]ahead-behind` of the dry run (default `status.aheadBehind` for the human formats) */
|
|
315
|
+
setAheadBehind(full: boolean): this;
|
|
316
|
+
/**
|
|
317
|
+
* `git commit --dry-run` (and `--short`, `--porcelain`, `--long`, `-z`, which imply it):
|
|
318
|
+
* the status of what would be committed, in the format set, with git's exit code (0
|
|
319
|
+
* when there is something to commit, else 1). The index is prepared as the commit would
|
|
320
|
+
* prepare it (`-a` stages the tracked changes, {@link setInclude} the named tracked paths,
|
|
321
|
+
* {@link setOnly} builds the index of HEAD with the named paths), then left as it was
|
|
322
|
+
* (rollback_index_files).
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ```typescript
|
|
326
|
+
* const { text, exitCode } = await git.commit().setAll(true).callDryRun();
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
329
|
+
callDryRun(): Promise<CommitDryRunResult>;
|
|
330
|
+
/** git's use_editor: an editor is set, and no message is given or `-e` asks for it. */
|
|
331
|
+
private usesEditor;
|
|
332
|
+
/**
|
|
333
|
+
* prepare_to_commit with an editor: COMMIT_EDITMSG written with the message so far and
|
|
334
|
+
* (`commit.status`) the commented help, identities and status of the template, the
|
|
335
|
+
* editor run over it, and what it left cleaned up as the commit message.
|
|
336
|
+
*/
|
|
337
|
+
private editMessage;
|
|
338
|
+
/**
|
|
339
|
+
* The commit template (`-t`, else `commit.template`, `~/` expanded) read through the host,
|
|
340
|
+
* undefined when none is set; one that cannot be read fails as git's `die_errno`.
|
|
341
|
+
*/
|
|
342
|
+
private readTemplate;
|
|
343
|
+
/** committer_ident_sufficiently_given: a name and an email named, not guessed. */
|
|
344
|
+
private committerIdentGiven;
|
|
345
|
+
/** parse_and_validate_options' checks of `--amend`. */
|
|
346
|
+
private checkAmend;
|
|
347
|
+
/** `-v` as given, else `commit.verbose` (a boolean or a level), else 0. */
|
|
348
|
+
private verboseLevel;
|
|
349
|
+
/**
|
|
350
|
+
* run_status for the commit: the status of the prepared index against HEAD (HEAD^1 for
|
|
351
|
+
* `--amend`), its stats not written back (the commit holds the index).
|
|
352
|
+
*/
|
|
353
|
+
private commitStatus;
|
|
354
|
+
/** {@link withFalseIndex} with the files of `tree` (a partial commit's stored tree). */
|
|
355
|
+
private withIndexOfTree;
|
|
356
|
+
/**
|
|
357
|
+
* Runs `fn` while the staging holds the entries `flat` names (a partial commit's false
|
|
358
|
+
* index: HEAD with the named paths), each with the stat of the staging's same entry,
|
|
359
|
+
* then puts the staging back exactly as it was: the same entry objects, so the ones kept
|
|
360
|
+
* as read are still checked for racy-git smudging when the index is written
|
|
361
|
+
* (`saveState`; a staging without it gets its entries rebuilt).
|
|
362
|
+
*/
|
|
363
|
+
private withFalseIndex;
|
|
164
364
|
setWorktree(iterator: Worktree): this;
|
|
165
365
|
/**
|
|
166
366
|
* Execute the commit.
|
|
@@ -172,18 +372,101 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
172
372
|
*/
|
|
173
373
|
call(): Promise<CommitResult>;
|
|
174
374
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
375
|
+
* `-i <paths>` (git's prepare_index for `also`): the option checks of
|
|
376
|
+
* parse_and_validate_options and prepare_index, then the index lock held from before the
|
|
377
|
+
* tracked paths are staged until HEAD has moved.
|
|
378
|
+
*/
|
|
379
|
+
private commitIncluded;
|
|
380
|
+
/** `-i <paths>`: parse_and_validate_options' and prepare_index's refusals. */
|
|
381
|
+
private checkIncludeOptions;
|
|
382
|
+
/**
|
|
383
|
+
* The commit, once `-a` staged the tracked changes (`index`: the index lock it holds).
|
|
384
|
+
* A partial commit takes the lock itself.
|
|
385
|
+
*/
|
|
386
|
+
private commitWith;
|
|
387
|
+
/**
|
|
388
|
+
* A partial commit's false index written as git's `prepare_index` writes it for the hooks
|
|
389
|
+
* (`$GIT_DIR/next-index-<pid>.lock`): HEAD's tree with the named paths taken, each entry
|
|
390
|
+
* the index has unchanged keeping its stat data (create_base_index's one-way merge), the
|
|
391
|
+
* others none. Undefined where the repository's files cannot hold it.
|
|
392
|
+
*/
|
|
393
|
+
private writeFalseIndexFile;
|
|
394
|
+
/** The commit made from the index (or the partial commit's tree), after the index is ready. */
|
|
395
|
+
private commitPrepared;
|
|
396
|
+
/**
|
|
397
|
+
* prepare_to_commit's refusal of a commit with nothing to commit: the tree is its first
|
|
398
|
+
* parent's (HEAD's, HEAD^1's when amending), or empty without a first parent, unless a merge is concluded, empty commits are
|
|
399
|
+
* allowed, or a merge commit is amended.
|
|
400
|
+
*/
|
|
401
|
+
private refuseNothingToCommit;
|
|
402
|
+
/** The commit of `treeId` made, HEAD moved to it, and what was in progress ended. */
|
|
403
|
+
private finishCommit;
|
|
404
|
+
/**
|
|
405
|
+
* The variables of the commit hooks (git's `run_commit_hook`): `GIT_INDEX_FILE` names the
|
|
406
|
+
* index the commit records (the lock `-a` and a partial commit write; git's false index of
|
|
407
|
+
* a partial commit is not kept as a file here), and `GIT_EDITOR=:` tells a hook that no
|
|
408
|
+
* editor runs.
|
|
181
409
|
*/
|
|
182
|
-
private
|
|
410
|
+
private commitHookEnv;
|
|
411
|
+
/** Runs a hook that can refuse the commit; whether it ran. */
|
|
412
|
+
private runCommitHook;
|
|
183
413
|
/**
|
|
184
|
-
*
|
|
414
|
+
* The arguments of prepare-commit-msg after the message file (prepare_to_commit's
|
|
415
|
+
* hook_arg1 and hook_arg2): where the message came from.
|
|
185
416
|
*/
|
|
186
|
-
private
|
|
417
|
+
private prepareMessageHookArgs;
|
|
418
|
+
/**
|
|
419
|
+
* prepare-commit-msg, the editor (when one runs) and commit-msg (not with --no-verify)
|
|
420
|
+
* over COMMIT_EDITMSG, in prepare_to_commit's order; whether any hook ran (the file is then
|
|
421
|
+
* to be read back). A non-zero commit-msg refuses the commit, as does prepare-commit-msg.
|
|
422
|
+
*/
|
|
423
|
+
private runMessageHooks;
|
|
424
|
+
/** The commits MERGE_HEAD names (one per line), none without a merge in progress. */
|
|
425
|
+
private mergeHeads;
|
|
426
|
+
/** The heads none of the others reaches (git's reduce_heads), in their order. */
|
|
427
|
+
private reduceHeads;
|
|
428
|
+
/**
|
|
429
|
+
* After the commit: the merge state removed (MERGE_HEAD, MERGE_MSG, MERGE_MODE,
|
|
430
|
+
* SQUASH_MSG, AUTO_MERGE), a stopped cherry-pick or revert ended (its sequencer state
|
|
431
|
+
* too once it was the last pick), and MERGE_AUTOSTASH applied back, as `git commit`.
|
|
432
|
+
*/
|
|
433
|
+
private cleanupAfterCommit;
|
|
434
|
+
/**
|
|
435
|
+
* The index held for a commit that changes it (git's `repo_hold_locked_index`): the
|
|
436
|
+
* index lock taken now (a staging with an index file), released on failure with the
|
|
437
|
+
* staging as it was before (read again, or its unwritten edits put back).
|
|
438
|
+
*/
|
|
439
|
+
private holdIndex;
|
|
440
|
+
/**
|
|
441
|
+
* The paths a partial commit takes (git's `list_paths`): those of the index (any stage)
|
|
442
|
+
* and of HEAD's tree the pathspec matches (`ce_path_match`, magic and globs as git's), in
|
|
443
|
+
* git's order, each with whether its index entry is skip-worktree. Refused during a
|
|
444
|
+
* merge, a cherry-pick or a rebase (git's whence), and when an element of the pathspec
|
|
445
|
+
* matches nothing (`report_path_error`).
|
|
446
|
+
*/
|
|
447
|
+
private listPartialPaths;
|
|
448
|
+
/** The files (and gitlinks) of a tree, in the directories `mayMatch` lets in. */
|
|
449
|
+
private collectTreeFiles;
|
|
450
|
+
/**
|
|
451
|
+
* git's partial commit (`prepare_index`, `add_remove_files`): each listed path (but the
|
|
452
|
+
* skip-worktree ones) as git's `add_remove_files` takes it, literally: a file (ignored or
|
|
453
|
+
* not) hashed and staged, a path gone removed, a submodule staged at the commit checked
|
|
454
|
+
* out in it, a directory without one refused before anything changes ("'<path>' does not
|
|
455
|
+
* have a commit checked out"); the index then gets its
|
|
456
|
+
* cache-tree (none while it holds conflicts) and is written into the lock. The tree
|
|
457
|
+
* committed is HEAD's with the same paths taken (git's false index), returned as HEAD's
|
|
458
|
+
* tree and those edits: stored by {@link storeFalseIndex}, never by a dry run.
|
|
459
|
+
*/
|
|
460
|
+
private preparePartialCommit;
|
|
461
|
+
/** The tree of a partial commit's false index, stored (with the directories it changes). */
|
|
462
|
+
private storeFalseIndex;
|
|
463
|
+
/** The files of a partial commit's false index, without storing a tree. */
|
|
464
|
+
private falseIndexFiles;
|
|
465
|
+
/**
|
|
466
|
+
* A tree with the given files set (or removed, for null), only the directories on their
|
|
467
|
+
* paths stored again; undefined when nothing is left in it.
|
|
468
|
+
*/
|
|
469
|
+
private editTree;
|
|
187
470
|
/**
|
|
188
471
|
* Stage all modified/deleted tracked files.
|
|
189
472
|
*
|
|
@@ -196,4 +479,15 @@ export declare class CommitCommand extends GitCommand<CommitResult> {
|
|
|
196
479
|
*/
|
|
197
480
|
private getWorktreeIterator;
|
|
198
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* The editor of a commit message (`CommitCommand.setEditor`): the path of the message file
|
|
484
|
+
* within the git directory (`COMMIT_EDITMSG`) and its text; it returns the edited text, or
|
|
485
|
+
* nothing (anything but a string) when it edited the file in place.
|
|
486
|
+
*/
|
|
487
|
+
export type CommitEditor = (path: string, text: string) => Promise<unknown>;
|
|
488
|
+
/** What `CommitCommand.callDryRun` gives: the status text and git's exit code. */
|
|
489
|
+
export interface CommitDryRunResult extends StatusTextResult {
|
|
490
|
+
/** 0 when there is something to commit, 1 when not (dry_run_commit) */
|
|
491
|
+
exitCode: number;
|
|
492
|
+
}
|
|
199
493
|
//# sourceMappingURL=commit-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit-command.d.ts","sourceRoot":"","sources":["../../src/commands/commit-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"commit-command.d.ts","sourceRoot":"","sources":["../../src/commands/commit-command.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAGX,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,+BAA+B,CAAC;AAevC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa/C,OAAO,EACL,WAAW,EAOZ,MAAM,sBAAsB,CAAC;AAc9B,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC;AAI7B;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,MAAM;IAC1C,yCAAyC;IACzC,EAAE,EAAE,QAAQ,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,qBAAa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AC9E,OAAO,CAAC,mBAAmB;IAsB3B;;;OAGG;YACW,UAAU;IAyExB;;;;;OAKG;YACW,mBAAmB;IAkDjC,+FAA+F;YACjF,cAAc;IAiO5B;;;;OAIG;YACW,qBAAqB;IAmBnC,qFAAqF;YACvE,YAAY;IA0F1B;;;;;OAKG;YACW,aAAa;IAe3B,8DAA8D;YAChD,aAAa;IAiB3B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAkB9B;;;;OAIG;YACW,eAAe;IAgB7B,qFAAqF;YACvE,UAAU;IAYxB,iFAAiF;YACnE,WAAW;IAgBzB;;;;OAIG;YACW,kBAAkB;IA0ChC;;;;OAIG;YACW,SAAS;IAsDvB;;;;;;OAMG;YACW,gBAAgB;IAqF9B,iFAAiF;YACnE,gBAAgB;IAgB9B;;;;;;;;;OASG;YACW,oBAAoB;IA6DlC,4FAA4F;YAC9E,eAAe;IAI7B,2EAA2E;YAC7D,eAAe;IAoB7B;;;OAGG;YACW,QAAQ;IAiCtB;;;;;OAKG;YACW,mBAAmB;IAyBjC;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAQ5B;AAyHD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE5E,kFAAkF;AAClF,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `core.*` settings that decide how the worktree is read and written.
|
|
3
|
+
*
|
|
4
|
+
* Read from the working copy's own configuration: this repository has no chain of
|
|
5
|
+
* global and system configuration files, so a `core.symlinks` set only in `~/.gitconfig`
|
|
6
|
+
* is not seen (native git would honour it).
|
|
7
|
+
*/
|
|
8
|
+
import { type ObjectId } from "@statewalker/vcs-core";
|
|
9
|
+
import type { WorkingCopy, Worktree, WorktreeModeTrust } from "@statewalker/vcs-working-tree";
|
|
10
|
+
/**
|
|
11
|
+
* A git boolean (`git_config_bool`: a key with no `=` is true, an empty value false), else
|
|
12
|
+
* `fallback`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function coreBool(workingCopy: WorkingCopy, name: string, fallback: boolean): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the worktree's executable bits and symbolic links are real: the worktree can
|
|
17
|
+
* represent them and `core.filemode` / `core.symlinks` are not false.
|
|
18
|
+
*/
|
|
19
|
+
export declare function worktreeModeTrust(workingCopy: WorkingCopy, worktree: Worktree): WorktreeModeTrust;
|
|
20
|
+
/** The values git's `core.disambiguate` takes (`set_disambiguate_hint_config`). */
|
|
21
|
+
export declare const DISAMBIGUATE_HINTS: readonly string[];
|
|
22
|
+
/**
|
|
23
|
+
* What git dies with on loading its configuration (`git_default_core_config`, which every
|
|
24
|
+
* command runs before it does anything, `status` included), else undefined: a
|
|
25
|
+
* `core.disambiguate` it does not know, the first bad value in the configuration's order
|
|
26
|
+
* (`error: unknown hint type for 'core.disambiguate': foo`, or for a variable without `=`
|
|
27
|
+
* `error: missing value for 'core.disambiguate'`, then `fatal: bad config variable
|
|
28
|
+
* 'core.disambiguate' in file '<file>' at line <n>`). A value with no file (set in memory)
|
|
29
|
+
* fails as git's command-line config does.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const message = configLoadError(workingCopy);
|
|
34
|
+
* if (message) throw new InvalidConfigError("core.disambiguate", message);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function configLoadError(workingCopy: WorkingCopy): {
|
|
38
|
+
key: string;
|
|
39
|
+
message: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* `id` abbreviated as git prints it (`repo_find_unique_abbrev(id, DEFAULT_ABBREV)`): to
|
|
43
|
+
* `core.abbrev` digits (auto: from the approximate object count, at least 7), lengthened until
|
|
44
|
+
* no other stored object shares them. Each call counts the objects again for the automatic
|
|
45
|
+
* length; a command that abbreviates several ids uses one {@link createIdAbbreviator} (the
|
|
46
|
+
* command's `abbreviateObjectId`) instead.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* output.push(`Created autostash: ${await abbreviateId(workingCopy, stashId)}`);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function abbreviateId(workingCopy: WorkingCopy, id: ObjectId): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* The lengths git abbreviates `ids` to (`repo_find_unique_abbrev` with `DEFAULT_ABBREV`):
|
|
56
|
+
* from `minLength`, else `core.abbrev` (auto: from the approximate object count), lengthened
|
|
57
|
+
* until unique among the stored objects. Without an object store, the start length (7 for
|
|
58
|
+
* auto).
|
|
59
|
+
*/
|
|
60
|
+
export declare function abbrevLengths(workingCopy: WorkingCopy, ids: Iterable<ObjectId>, minLength?: number): Promise<Map<ObjectId, number>>;
|
|
61
|
+
/** Options of {@link createIdAbbreviator} */
|
|
62
|
+
export interface IdAbbreviatorOptions {
|
|
63
|
+
/**
|
|
64
|
+
* Keep the store's listings for the abbreviator's life (each loose fan-out directory read
|
|
65
|
+
* once, as git's `odb_loose_cache`): for commands that write no objects while they
|
|
66
|
+
* abbreviate, such as `log` and `diff`.
|
|
67
|
+
*/
|
|
68
|
+
cacheListings?: boolean;
|
|
69
|
+
}
|
|
70
|
+
/** Abbreviates ids for one command or operation; see {@link createIdAbbreviator}. */
|
|
71
|
+
export interface IdAbbreviator {
|
|
72
|
+
/** `id` abbreviated as git prints it (see {@link abbreviateId}) */
|
|
73
|
+
abbreviate(id: ObjectId): Promise<string>;
|
|
74
|
+
/** The lengths of `ids` (see {@link abbrevLengths}) */
|
|
75
|
+
lengths(ids: Iterable<ObjectId>, minLength?: number): Promise<Map<ObjectId, number>>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* An abbreviator that counts the objects once, for the automatic length (`core.abbrev`
|
|
79
|
+
* unset or "auto"), however many ids it abbreviates: git computes its approximate object
|
|
80
|
+
* count once per process and keeps it (`approximate_object_count_valid`), and so does this
|
|
81
|
+
* for its lifetime. Counting lists every object on stores without a cheap count (key-value,
|
|
82
|
+
* SQL, memory), so a command abbreviating several ids (merge's `Updating a..b`, rebase's
|
|
83
|
+
* todo backup) pays for one scan, not one per id. Objects written meanwhile are not
|
|
84
|
+
* counted again, as in git; prefix uniqueness is still checked against the store each time.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const abbrev = createIdAbbreviator(workingCopy);
|
|
89
|
+
* output.push(`Updating ${await abbrev.abbreviate(head)}..${await abbrev.abbreviate(src)}`);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function createIdAbbreviator(workingCopy: WorkingCopy, options?: IdAbbreviatorOptions): IdAbbreviator;
|
|
93
|
+
//# sourceMappingURL=core-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-config.d.ts","sourceRoot":"","sources":["../../src/commands/core-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAI9F;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAE3F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAG,iBAAiB,CAejG;AAED,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAO/C,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,WAAW,GACvB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAe9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1F;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACvB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAEhC;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,uDAAuD;IACvD,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;CACtF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,oBAAyB,GACjC,aAAa,CA2Bf"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's date modes (`--date=<mode>`, `log.date`): date.c's parse_date_format and show_date.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* const mode = parseDateMode("iso");
|
|
7
|
+
* showDate(1112911993, "+0200", mode); // "2005-04-08 00:13:13 +0200"
|
|
8
|
+
* showDate(1112911993, "+0200", parseDateMode("format:%Y/%m/%d")); // "2005/04/08"
|
|
9
|
+
* showDate(1112911993, "+0200", parseDateMode("relative"), { now }); // "19 years ago"
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* The modes: `default` (`Thu Apr 7 22:13:13 2005 +0200`), `relative`, `local` (default in
|
|
13
|
+
* the local zone, without it), `iso`/`iso8601`, `iso-strict`/`iso8601-strict`, `rfc`/`rfc2822`,
|
|
14
|
+
* `short`, `raw`, `unix`, `human` and `format:<strftime>` (the C locale's names); each but
|
|
15
|
+
* `relative`, `raw`... may end in `-local` to be shown in the local zone. `auto:<mode>` is the
|
|
16
|
+
* default mode, as git without a terminal takes it.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
/** A parsed date mode (date.c's struct date_mode). */
|
|
21
|
+
export interface DateMode {
|
|
22
|
+
type: "normal" | "relative" | "short" | "iso8601" | "iso8601-strict" | "rfc2822" | "strftime" | "raw" | "unix" | "human";
|
|
23
|
+
/** Shown in the local zone (`-local`, `local`) */
|
|
24
|
+
local: boolean;
|
|
25
|
+
/** The strftime format of `format:` */
|
|
26
|
+
strftime?: string;
|
|
27
|
+
}
|
|
28
|
+
/** What {@link showDate} reads besides the date. */
|
|
29
|
+
export interface ShowDateContext {
|
|
30
|
+
/** Now, in seconds (`relative`, `human`); default the clock */
|
|
31
|
+
now?: number;
|
|
32
|
+
/** The local zone's offset east of UTC in minutes at a time (default the host's) */
|
|
33
|
+
localTzOffset?: (time: number) => number;
|
|
34
|
+
/**
|
|
35
|
+
* The local zone's name at a time, as `%Z` of a `format-local:` date shows it (default
|
|
36
|
+
* {@link hostZoneName})
|
|
37
|
+
*/
|
|
38
|
+
localTzName?: (time: number) => string;
|
|
39
|
+
}
|
|
40
|
+
/** An error git reports for a date mode it does not know (`fatal: unknown date format`). */
|
|
41
|
+
export declare class DateModeError extends Error {
|
|
42
|
+
}
|
|
43
|
+
/** date.c's parse_date_format. */
|
|
44
|
+
export declare function parseDateMode(spec: string): DateMode;
|
|
45
|
+
/** The default date mode. */
|
|
46
|
+
export declare const DEFAULT_DATE_MODE: DateMode;
|
|
47
|
+
/**
|
|
48
|
+
* The host's name for the local zone at a time (strftime's `%Z` of a local date): the
|
|
49
|
+
* abbreviation `Intl` knows (`PST`, `CEST`), else, for a zone tzdata only names by its offset
|
|
50
|
+
* (`Asia/Kathmandu`), the offset as glibc prints it (`+0545`).
|
|
51
|
+
*/
|
|
52
|
+
export declare function hostZoneName(time: number, localTz: (time: number) => number): string;
|
|
53
|
+
/**
|
|
54
|
+
* date.c's show_date: `time` (seconds) in its zone `tzOffset` (`+HHMM`, read as git reads
|
|
55
|
+
* it: `+0060` stays `+0060`) as the mode shows it.
|
|
56
|
+
*/
|
|
57
|
+
export declare function showDate(time: number, tzOffset: string, mode: DateMode, context?: ShowDateContext): string;
|
|
58
|
+
//# sourceMappingURL=date-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../src/commands/date-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,sDAAsD;AACtD,MAAM,WAAW,QAAQ;IACvB,IAAI,EACA,QAAQ,GACR,UAAU,GACV,OAAO,GACP,SAAS,GACT,gBAAgB,GAChB,SAAS,GACT,UAAU,GACV,KAAK,GACL,MAAM,GACN,OAAO,CAAC;IACZ,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACxC;AAED,4FAA4F;AAC5F,qBAAa,aAAc,SAAQ,KAAK;CAAG;AAkB3C,kCAAkC;AAClC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAoBpD;AAED,6BAA6B;AAC7B,eAAO,MAAM,iBAAiB,EAAE,QAA2C,CAAC;AAgb5E;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAkBpF;AA4CD;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,eAAoB,GAC5B,MAAM,CA8DR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-command.d.ts","sourceRoot":"","sources":["../../src/commands/describe-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"describe-command.d.ts","sourceRoot":"","sources":["../../src/commands/describe-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,sCAAsC;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,8BAA8B;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;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