@statewalker/vcs-commands 0.8.0 → 0.10.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 +1 -1
- package/dist/commands/add-command.d.ts +32 -0
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/add-patch/add-patch.d.ts +7 -0
- package/dist/commands/add-patch/add-patch.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-backend.d.ts +2 -0
- package/dist/commands/add-patch/patch-backend.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-modes.d.ts +6 -2
- package/dist/commands/add-patch/patch-modes.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-session.d.ts +4 -0
- package/dist/commands/add-patch/patch-session.d.ts.map +1 -1
- package/dist/commands/am/am-command.d.ts +88 -2
- package/dist/commands/am/am-command.d.ts.map +1 -1
- package/dist/commands/apply/apply-command.d.ts +2 -0
- package/dist/commands/apply/apply-command.d.ts.map +1 -1
- package/dist/commands/apply/apply-parse.d.ts +7 -0
- package/dist/commands/apply/apply-parse.d.ts.map +1 -1
- package/dist/commands/apply/index.d.ts +1 -1
- package/dist/commands/apply/index.d.ts.map +1 -1
- package/dist/commands/archive/archive-command.d.ts +169 -0
- package/dist/commands/archive/archive-command.d.ts.map +1 -0
- package/dist/commands/archive/archive-entry.d.ts +60 -0
- package/dist/commands/archive/archive-entry.d.ts.map +1 -0
- package/dist/commands/archive/index.d.ts +8 -0
- package/dist/commands/archive/index.d.ts.map +1 -0
- package/dist/commands/archive/remote-archive-command.d.ts +56 -0
- package/dist/commands/archive/remote-archive-command.d.ts.map +1 -0
- package/dist/commands/archive/tar-archive.d.ts +31 -0
- package/dist/commands/archive/tar-archive.d.ts.map +1 -0
- package/dist/commands/archive/tar-commit-id.d.ts +13 -0
- package/dist/commands/archive/tar-commit-id.d.ts.map +1 -0
- package/dist/commands/archive/upload-archive-writer.d.ts +48 -0
- package/dist/commands/archive/upload-archive-writer.d.ts.map +1 -0
- package/dist/commands/archive/zip-archive.d.ts +42 -0
- package/dist/commands/archive/zip-archive.d.ts.map +1 -0
- package/dist/commands/attributes-source.d.ts +10 -0
- package/dist/commands/attributes-source.d.ts.map +1 -1
- package/dist/commands/blame-command.d.ts +345 -8
- package/dist/commands/blame-command.d.ts.map +1 -1
- package/dist/commands/blame-ignore.d.ts +48 -0
- package/dist/commands/blame-ignore.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-create-command.d.ts +67 -0
- package/dist/commands/bundle/bundle-create-command.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-format.d.ts +89 -0
- package/dist/commands/bundle/bundle-format.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-list.d.ts +92 -0
- package/dist/commands/bundle/bundle-list.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-read-commands.d.ts +81 -0
- package/dist/commands/bundle/bundle-read-commands.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-support.d.ts +32 -0
- package/dist/commands/bundle/bundle-support.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-transport.d.ts +38 -0
- package/dist/commands/bundle/bundle-transport.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-uri-host.d.ts +43 -0
- package/dist/commands/bundle/bundle-uri-host.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-uri.d.ts +55 -0
- package/dist/commands/bundle/bundle-uri.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-verify.d.ts +63 -0
- package/dist/commands/bundle/bundle-verify.d.ts.map +1 -0
- package/dist/commands/bundle/index.d.ts +14 -0
- package/dist/commands/bundle/index.d.ts.map +1 -0
- package/dist/commands/cat-file/batch-format.d.ts +58 -0
- package/dist/commands/cat-file/batch-format.d.ts.map +1 -0
- package/dist/commands/cat-file/cat-file-command.d.ts +135 -0
- package/dist/commands/cat-file/cat-file-command.d.ts.map +1 -0
- package/dist/commands/cat-file/index.d.ts +3 -0
- package/dist/commands/cat-file/index.d.ts.map +1 -0
- package/dist/commands/check-attr-command.d.ts +66 -0
- package/dist/commands/check-attr-command.d.ts.map +1 -0
- package/dist/commands/check-ignore-command.d.ts +58 -0
- package/dist/commands/check-ignore-command.d.ts.map +1 -0
- package/dist/commands/check-mailmap-command.d.ts +49 -0
- package/dist/commands/check-mailmap-command.d.ts.map +1 -0
- package/dist/commands/check-ref-format-command.d.ts +60 -0
- package/dist/commands/check-ref-format-command.d.ts.map +1 -0
- package/dist/commands/checkout-command.d.ts +7 -0
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/checkout-index-command.d.ts +96 -0
- package/dist/commands/checkout-index-command.d.ts.map +1 -0
- package/dist/commands/checkout-paths.d.ts +4 -0
- package/dist/commands/checkout-paths.d.ts.map +1 -1
- package/dist/commands/cherry-command.d.ts +61 -0
- package/dist/commands/cherry-command.d.ts.map +1 -0
- package/dist/commands/cherry-pick-command.d.ts +33 -1
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +32 -0
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clean-interactive.d.ts +56 -0
- package/dist/commands/clean-interactive.d.ts.map +1 -0
- package/dist/commands/clone-command.d.ts +135 -2
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +59 -3
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/config-command.d.ts +2 -0
- package/dist/commands/config-command.d.ts.map +1 -1
- package/dist/commands/daemon-access-hook.d.ts +36 -0
- package/dist/commands/daemon-access-hook.d.ts.map +1 -0
- package/dist/commands/default-branch.d.ts +42 -0
- package/dist/commands/default-branch.d.ts.map +1 -1
- package/dist/commands/describe-command.d.ts +71 -64
- package/dist/commands/describe-command.d.ts.map +1 -1
- package/dist/commands/diff-command.d.ts +249 -10
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/diff-external.d.ts +43 -0
- package/dist/commands/diff-external.d.ts.map +1 -0
- package/dist/commands/diff-plumbing/diff-pairs-command.d.ts +27 -0
- package/dist/commands/diff-plumbing/diff-pairs-command.d.ts.map +1 -0
- package/dist/commands/diff-plumbing/diff-plumbing-command.d.ts +129 -0
- package/dist/commands/diff-plumbing/diff-plumbing-command.d.ts.map +1 -0
- package/dist/commands/diff-plumbing/index.d.ts +3 -0
- package/dist/commands/diff-plumbing/index.d.ts.map +1 -0
- package/dist/commands/diff-textconv.d.ts +5 -1
- package/dist/commands/diff-textconv.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-export-command.d.ts +135 -0
- package/dist/commands/fast-export/fast-export-command.d.ts.map +1 -0
- package/dist/commands/fast-export/fast-import-command.d.ts +182 -0
- package/dist/commands/fast-export/fast-import-command.d.ts.map +1 -0
- package/dist/commands/fast-export/fast-stream-support.d.ts +64 -0
- package/dist/commands/fast-export/fast-stream-support.d.ts.map +1 -0
- package/dist/commands/fast-export/index.d.ts +4 -0
- package/dist/commands/fast-export/index.d.ts.map +1 -0
- package/dist/commands/fetch-command.d.ts +125 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/fetch-multiple-command.d.ts +193 -0
- package/dist/commands/fetch-multiple-command.d.ts.map +1 -0
- package/dist/commands/format-patch-command.d.ts +28 -2
- package/dist/commands/format-patch-command.d.ts.map +1 -1
- package/dist/commands/format-rev-command.d.ts +58 -0
- package/dist/commands/format-rev-command.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-command.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-msg-ids.d.ts +18 -3
- package/dist/commands/fsck/fsck-msg-ids.d.ts.map +1 -1
- package/dist/commands/fsmonitor-refresh.d.ts +69 -0
- package/dist/commands/fsmonitor-refresh.d.ts.map +1 -0
- package/dist/commands/gc-command.d.ts +5 -0
- package/dist/commands/gc-command.d.ts.map +1 -1
- package/dist/commands/git-describe.d.ts +77 -4
- package/dist/commands/git-describe.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +47 -1
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/git-paths.d.ts +26 -0
- package/dist/commands/git-paths.d.ts.map +1 -0
- package/dist/commands/grep/grep-command.d.ts +2 -1
- package/dist/commands/grep/grep-command.d.ts.map +1 -1
- package/dist/commands/history-command.d.ts +156 -0
- package/dist/commands/history-command.d.ts.map +1 -0
- package/dist/commands/http-config.d.ts +38 -0
- package/dist/commands/http-config.d.ts.map +1 -0
- package/dist/commands/index-adder.d.ts +12 -1
- package/dist/commands/index-adder.d.ts.map +1 -1
- package/dist/commands/index-host.d.ts.map +1 -1
- package/dist/commands/index.d.ts +56 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -3
- package/dist/commands/init-command.d.ts +89 -0
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/last-modified-command.d.ts +102 -0
- package/dist/commands/last-modified-command.d.ts.map +1 -0
- package/dist/commands/lfs/go-url.d.ts +43 -0
- package/dist/commands/lfs/go-url.d.ts.map +1 -0
- package/dist/commands/lfs/index.d.ts +3 -0
- package/dist/commands/lfs/index.d.ts.map +1 -0
- package/dist/commands/lfs/lfs-config.d.ts +174 -0
- package/dist/commands/lfs/lfs-config.d.ts.map +1 -0
- package/dist/commands/lfs/lfs-endpoint-command.d.ts +83 -0
- package/dist/commands/lfs/lfs-endpoint-command.d.ts.map +1 -0
- package/dist/commands/line-log.d.ts +161 -0
- package/dist/commands/line-log.d.ts.map +1 -0
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +261 -6
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-graph.d.ts +4 -2
- package/dist/commands/log-graph.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +88 -2
- package/dist/commands/log-output.d.ts.map +1 -1
- package/dist/commands/ls-files-command.d.ts +153 -0
- package/dist/commands/ls-files-command.d.ts.map +1 -0
- package/dist/commands/ls-remote-command.d.ts +5 -0
- package/dist/commands/ls-remote-command.d.ts.map +1 -1
- package/dist/commands/ls-tree-command.d.ts +105 -0
- package/dist/commands/ls-tree-command.d.ts.map +1 -0
- package/dist/commands/mailmap.d.ts +24 -1
- package/dist/commands/mailmap.d.ts.map +1 -1
- package/dist/commands/maintenance-run-command.d.ts +122 -0
- package/dist/commands/maintenance-run-command.d.ts.map +1 -0
- package/dist/commands/merge-command.d.ts +58 -1
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-config.d.ts +7 -0
- package/dist/commands/merge-config.d.ts.map +1 -1
- package/dist/commands/merge-drivers.d.ts +69 -5
- package/dist/commands/merge-drivers.d.ts.map +1 -1
- package/dist/commands/merge-strategy-options.d.ts +69 -0
- package/dist/commands/merge-strategy-options.d.ts.map +1 -0
- package/dist/commands/merge-support.d.ts +16 -0
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/merge-tree-command.d.ts +122 -0
- package/dist/commands/merge-tree-command.d.ts.map +1 -0
- package/dist/commands/message-cleanup.d.ts +2 -0
- package/dist/commands/message-cleanup.d.ts.map +1 -1
- package/dist/commands/mktag-command.d.ts +51 -0
- package/dist/commands/mktag-command.d.ts.map +1 -0
- package/dist/commands/name-rev-command.d.ts +65 -0
- package/dist/commands/name-rev-command.d.ts.map +1 -0
- package/dist/commands/name-rev.d.ts +110 -22
- package/dist/commands/name-rev.d.ts.map +1 -1
- package/dist/commands/object-store/count-objects-command.d.ts +58 -0
- package/dist/commands/object-store/count-objects-command.d.ts.map +1 -0
- package/dist/commands/object-store/index.d.ts +5 -0
- package/dist/commands/object-store/index.d.ts.map +1 -0
- package/dist/commands/object-store/objects-directory.d.ts +12 -0
- package/dist/commands/object-store/objects-directory.d.ts.map +1 -0
- package/dist/commands/object-store/prune-command.d.ts +38 -0
- package/dist/commands/object-store/prune-command.d.ts.map +1 -0
- package/dist/commands/object-store/show-index-command.d.ts +23 -0
- package/dist/commands/object-store/show-index-command.d.ts.map +1 -0
- package/dist/commands/octopus-merge.d.ts +26 -1
- package/dist/commands/octopus-merge.d.ts.map +1 -1
- package/dist/commands/ort-merge.d.ts +40 -0
- package/dist/commands/ort-merge.d.ts.map +1 -1
- package/dist/commands/ort-recursive.d.ts.map +1 -1
- package/dist/commands/patch-id-command.d.ts +30 -0
- package/dist/commands/patch-id-command.d.ts.map +1 -0
- package/dist/commands/patch-id.d.ts +82 -0
- package/dist/commands/patch-id.d.ts.map +1 -1
- package/dist/commands/plumbing-command.d.ts +66 -0
- package/dist/commands/plumbing-command.d.ts.map +1 -0
- package/dist/commands/plumbing-input.d.ts +38 -0
- package/dist/commands/plumbing-input.d.ts.map +1 -0
- package/dist/commands/promisor-remote-reply.d.ts +35 -0
- package/dist/commands/promisor-remote-reply.d.ts.map +1 -0
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/pull-command.d.ts +182 -38
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +82 -2
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/range-diff/index.d.ts +4 -0
- package/dist/commands/range-diff/index.d.ts.map +1 -0
- package/dist/commands/range-diff/linear-assignment.d.ts +27 -0
- package/dist/commands/range-diff/linear-assignment.d.ts.map +1 -0
- package/dist/commands/range-diff/range-diff-command.d.ts +121 -0
- package/dist/commands/range-diff/range-diff-command.d.ts.map +1 -0
- package/dist/commands/range-diff/range-diff.d.ts +106 -0
- package/dist/commands/range-diff/range-diff.d.ts.map +1 -0
- package/dist/commands/read-tree-command.d.ts +14 -0
- package/dist/commands/read-tree-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +129 -4
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/refs-command.d.ts +81 -0
- package/dist/commands/refs-command.d.ts.map +1 -0
- package/dist/commands/remerge-diff.d.ts +59 -0
- package/dist/commands/remerge-diff.d.ts.map +1 -0
- package/dist/commands/remote-command.d.ts +41 -0
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/remote-object-info-command.d.ts +55 -0
- package/dist/commands/remote-object-info-command.d.ts.map +1 -0
- package/dist/commands/remote-show-command.d.ts +204 -0
- package/dist/commands/remote-show-command.d.ts.map +1 -0
- package/dist/commands/remote-transport.d.ts +40 -3
- package/dist/commands/remote-transport.d.ts.map +1 -1
- package/dist/commands/repack-command.d.ts +115 -0
- package/dist/commands/repack-command.d.ts.map +1 -0
- package/dist/commands/replace-command.d.ts +143 -0
- package/dist/commands/replace-command.d.ts.map +1 -0
- package/dist/commands/replay-command.d.ts +117 -0
- package/dist/commands/replay-command.d.ts.map +1 -0
- package/dist/commands/repo-command.d.ts +136 -0
- package/dist/commands/repo-command.d.ts.map +1 -0
- package/dist/commands/request-pull-command.d.ts +82 -0
- package/dist/commands/request-pull-command.d.ts.map +1 -0
- package/dist/commands/rerere-command.d.ts +36 -0
- package/dist/commands/rerere-command.d.ts.map +1 -0
- package/dist/commands/rerere.d.ts +102 -0
- package/dist/commands/rerere.d.ts.map +1 -0
- package/dist/commands/reset-command.d.ts +19 -1
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts +7 -0
- package/dist/commands/restore-command.d.ts.map +1 -1
- package/dist/commands/rev-filter/commit-grep.d.ts +3 -1
- package/dist/commands/rev-filter/commit-grep.d.ts.map +1 -1
- package/dist/commands/rev-list-command.d.ts +78 -3
- package/dist/commands/rev-list-command.d.ts.map +1 -1
- package/dist/commands/rev-parse-command.d.ts +9 -0
- package/dist/commands/rev-parse-command.d.ts.map +1 -1
- package/dist/commands/revert-command.d.ts +32 -1
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +7 -0
- package/dist/commands/revision-range.d.ts.map +1 -1
- package/dist/commands/revision-resolver.d.ts +12 -0
- package/dist/commands/revision-resolver.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +120 -1
- package/dist/commands/sequencer-pick.d.ts.map +1 -1
- package/dist/commands/sequencer-support.d.ts +10 -1
- package/dist/commands/sequencer-support.d.ts.map +1 -1
- package/dist/commands/serve-repository.d.ts +23 -1
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/session-id.d.ts +18 -0
- package/dist/commands/session-id.d.ts.map +1 -0
- package/dist/commands/shortlog-command.d.ts +109 -0
- package/dist/commands/shortlog-command.d.ts.map +1 -0
- package/dist/commands/shortlog.d.ts +151 -0
- package/dist/commands/shortlog.d.ts.map +1 -0
- package/dist/commands/show-branch-command.d.ts +59 -0
- package/dist/commands/show-branch-command.d.ts.map +1 -0
- package/dist/commands/show-ref-command.d.ts +112 -0
- package/dist/commands/show-ref-command.d.ts.map +1 -0
- package/dist/commands/signature-check.d.ts +9 -2
- package/dist/commands/signature-check.d.ts.map +1 -1
- package/dist/commands/signing.d.ts +22 -1
- package/dist/commands/signing.d.ts.map +1 -1
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-export-command.d.ts +115 -0
- package/dist/commands/stash-export-command.d.ts.map +1 -0
- package/dist/commands/status-command.d.ts +33 -3
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/stripspace-command.d.ts +44 -0
- package/dist/commands/stripspace-command.d.ts.map +1 -0
- package/dist/commands/submodule-add-command.d.ts +10 -1
- package/dist/commands/submodule-add-command.d.ts.map +1 -1
- package/dist/commands/submodule-auth.d.ts +3 -1
- package/dist/commands/submodule-auth.d.ts.map +1 -1
- package/dist/commands/submodule-commands.d.ts +99 -3
- package/dist/commands/submodule-commands.d.ts.map +1 -1
- package/dist/commands/submodule-fetch.d.ts +149 -0
- package/dist/commands/submodule-fetch.d.ts.map +1 -0
- package/dist/commands/submodule-model.d.ts +8 -0
- package/dist/commands/submodule-model.d.ts.map +1 -1
- package/dist/commands/submodule-unpack.d.ts +120 -0
- package/dist/commands/submodule-unpack.d.ts.map +1 -0
- package/dist/commands/submodule-update-command.d.ts +21 -1
- package/dist/commands/submodule-update-command.d.ts.map +1 -1
- package/dist/commands/subtree-shift.d.ts +27 -0
- package/dist/commands/subtree-shift.d.ts.map +1 -0
- package/dist/commands/switch-command.d.ts +3 -0
- package/dist/commands/switch-command.d.ts.map +1 -1
- package/dist/commands/textconv-cache.d.ts +58 -0
- package/dist/commands/textconv-cache.d.ts.map +1 -0
- package/dist/commands/tree-restore.d.ts +5 -0
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/unpack-objects-command.d.ts +47 -0
- package/dist/commands/unpack-objects-command.d.ts.map +1 -0
- package/dist/commands/update-index-command.d.ts +110 -0
- package/dist/commands/update-index-command.d.ts.map +1 -0
- package/dist/commands/uri-protocols.d.ts +13 -0
- package/dist/commands/uri-protocols.d.ts.map +1 -0
- package/dist/commands/url-parse-command.d.ts +30 -0
- package/dist/commands/url-parse-command.d.ts.map +1 -0
- package/dist/commands/var-command.d.ts +42 -0
- package/dist/commands/var-command.d.ts.map +1 -0
- package/dist/commands/worktree-overwrite-checks.d.ts +2 -0
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
- package/dist/{commands-ISM52N0n.js → commands-Mlo1dxQN.js} +56133 -70269
- package/dist/errors/command-errors.d.ts +58 -0
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/index.js +67 -1
- package/dist/fsck-CrhVMNIH.js +5179 -0
- package/dist/git-command.d.ts +89 -3
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +628 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/guarded-transport-command.d.ts +84 -0
- package/dist/guarded-transport-command.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/maintenance-run-command-Bw21HEkH.js +13539 -0
- package/dist/remote-transport-Bu4PGSMD.js +2605 -0
- package/dist/rename/detect-renames.d.ts +20 -0
- package/dist/rename/detect-renames.d.ts.map +1 -1
- package/dist/rename/diffcore-break.d.ts +51 -0
- package/dist/rename/diffcore-break.d.ts.map +1 -0
- package/dist/rename/index.d.ts +1 -0
- package/dist/rename/index.d.ts.map +1 -1
- package/dist/results/blame-format.d.ts +62 -1
- package/dist/results/blame-format.d.ts.map +1 -1
- package/dist/results/cherry-pick-result.d.ts +6 -0
- package/dist/results/cherry-pick-result.d.ts.map +1 -1
- package/dist/results/clone-result.d.ts +9 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/diff-dirstat.d.ts +36 -0
- package/dist/results/diff-dirstat.d.ts.map +1 -0
- package/dist/results/diff-entry.d.ts +20 -0
- package/dist/results/diff-entry.d.ts.map +1 -1
- package/dist/results/diff-formatter.d.ts.map +1 -1
- package/dist/results/diff-output.d.ts +67 -3
- package/dist/results/diff-output.d.ts.map +1 -1
- 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 +2 -0
- package/dist/results/index.d.ts.map +1 -1
- package/dist/results/index.js +2 -2
- package/dist/results/init-result.d.ts +8 -1
- package/dist/results/init-result.d.ts.map +1 -1
- package/dist/results/line-range-hunks.d.ts +27 -0
- package/dist/results/line-range-hunks.d.ts.map +1 -0
- package/dist/results/merge-result.d.ts +13 -1
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/pull-result.d.ts +11 -0
- package/dist/results/pull-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +10 -0
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/rebase-result.d.ts +7 -0
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/revert-result.d.ts +6 -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 +1 -1
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/results-ERo9vELd.js +49673 -0
- package/dist/transport-command.d.ts +93 -1
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/commands/add-command.ts +118 -0
- package/src/commands/add-patch/add-patch.ts +8 -0
- package/src/commands/add-patch/patch-backend.ts +24 -3
- package/src/commands/add-patch/patch-modes.ts +26 -2
- package/src/commands/add-patch/patch-session.ts +6 -0
- package/src/commands/am/am-command.ts +301 -12
- package/src/commands/apply/apply-command.ts +52 -9
- package/src/commands/apply/apply-parse.ts +10 -0
- package/src/commands/apply/index.ts +9 -1
- package/src/commands/archive/archive-command.ts +1148 -0
- package/src/commands/archive/archive-entry.ts +93 -0
- package/src/commands/archive/index.ts +7 -0
- package/src/commands/archive/remote-archive-command.ts +140 -0
- package/src/commands/archive/tar-archive.ts +207 -0
- package/src/commands/archive/tar-commit-id.ts +72 -0
- package/src/commands/archive/upload-archive-writer.ts +213 -0
- package/src/commands/archive/zip-archive.ts +317 -0
- package/src/commands/attributes-source.ts +26 -12
- package/src/commands/blame-command.ts +1551 -53
- package/src/commands/blame-ignore.ts +307 -0
- package/src/commands/bundle/bundle-create-command.ts +405 -0
- package/src/commands/bundle/bundle-format.ts +228 -0
- package/src/commands/bundle/bundle-list.ts +276 -0
- package/src/commands/bundle/bundle-read-commands.ts +157 -0
- package/src/commands/bundle/bundle-support.ts +85 -0
- package/src/commands/bundle/bundle-transport.ts +107 -0
- package/src/commands/bundle/bundle-uri-host.ts +204 -0
- package/src/commands/bundle/bundle-uri.ts +236 -0
- package/src/commands/bundle/bundle-verify.ts +152 -0
- package/src/commands/bundle/index.ts +14 -0
- package/src/commands/cat-file/batch-format.ts +193 -0
- package/src/commands/cat-file/cat-file-command.ts +857 -0
- package/src/commands/cat-file/index.ts +2 -0
- package/src/commands/check-attr-command.ts +333 -0
- package/src/commands/check-ignore-command.ts +261 -0
- package/src/commands/check-mailmap-command.ts +129 -0
- package/src/commands/check-ref-format-command.ts +129 -0
- package/src/commands/checkout-command.ts +131 -28
- package/src/commands/checkout-index-command.ts +568 -0
- package/src/commands/checkout-paths.ts +35 -0
- package/src/commands/cherry-command.ts +187 -0
- package/src/commands/cherry-pick-command.ts +63 -2
- package/src/commands/clean-command.ts +92 -12
- package/src/commands/clean-interactive.ts +522 -0
- package/src/commands/clone-command.ts +803 -50
- package/src/commands/commit-command.ts +202 -51
- package/src/commands/config-command.ts +9 -0
- package/src/commands/daemon-access-hook.ts +78 -0
- package/src/commands/default-branch.ts +99 -1
- package/src/commands/describe-command.ts +341 -254
- package/src/commands/diff-command.ts +1186 -99
- package/src/commands/diff-external.ts +131 -0
- package/src/commands/diff-plumbing/diff-pairs-command.ts +193 -0
- package/src/commands/diff-plumbing/diff-plumbing-command.ts +424 -0
- package/src/commands/diff-plumbing/index.ts +2 -0
- package/src/commands/diff-textconv.ts +5 -1
- package/src/commands/fast-export/fast-export-command.ts +911 -0
- package/src/commands/fast-export/fast-import-command.ts +1553 -0
- package/src/commands/fast-export/fast-stream-support.ts +162 -0
- package/src/commands/fast-export/index.ts +3 -0
- package/src/commands/fetch-command.ts +665 -14
- package/src/commands/fetch-multiple-command.ts +668 -0
- package/src/commands/format-patch-command.ts +189 -77
- package/src/commands/format-rev-command.ts +251 -0
- package/src/commands/fsck/fsck-command.ts +47 -20
- package/src/commands/fsck/fsck-msg-ids.ts +19 -3
- package/src/commands/fsck/fsck-pack.ts +2 -2
- package/src/commands/fsmonitor-refresh.ts +315 -0
- package/src/commands/gc-command.ts +10 -0
- package/src/commands/git-describe.ts +456 -217
- package/src/commands/git-hooks.ts +165 -9
- package/src/commands/git-paths.ts +136 -0
- package/src/commands/grep/grep-command.ts +38 -15
- package/src/commands/history-command.ts +617 -0
- package/src/commands/http-config.ts +139 -0
- package/src/commands/index-adder.ts +37 -3
- package/src/commands/index-host.ts +6 -1
- package/src/commands/index.ts +62 -0
- package/src/commands/init-command.ts +617 -49
- package/src/commands/last-modified-command.ts +804 -0
- package/src/commands/lfs/go-url.ts +370 -0
- package/src/commands/lfs/index.ts +2 -0
- package/src/commands/lfs/lfs-config.ts +738 -0
- package/src/commands/lfs/lfs-endpoint-command.ts +180 -0
- package/src/commands/line-log.ts +931 -0
- package/src/commands/local-transport.ts +252 -4
- package/src/commands/log-command.ts +1518 -182
- package/src/commands/log-graph.ts +6 -3
- package/src/commands/log-output.ts +228 -15
- package/src/commands/ls-files-command.ts +1177 -0
- package/src/commands/ls-remote-command.ts +6 -0
- package/src/commands/ls-tree-command.ts +684 -0
- package/src/commands/mailmap.ts +41 -5
- package/src/commands/maintenance-run-command.ts +949 -0
- package/src/commands/merge-command.ts +351 -47
- package/src/commands/merge-config.ts +23 -1
- package/src/commands/merge-drivers.ts +112 -20
- package/src/commands/merge-strategy-options.ts +224 -0
- package/src/commands/merge-support.ts +130 -26
- package/src/commands/merge-tree-command.ts +786 -0
- package/src/commands/message-cleanup.ts +1 -1
- package/src/commands/mktag-command.ts +149 -0
- package/src/commands/name-rev-command.ts +184 -0
- package/src/commands/name-rev.ts +700 -109
- package/src/commands/object-store/count-objects-command.ts +404 -0
- package/src/commands/object-store/index.ts +4 -0
- package/src/commands/object-store/objects-directory.ts +24 -0
- package/src/commands/object-store/prune-command.ts +129 -0
- package/src/commands/object-store/show-index-command.ts +151 -0
- package/src/commands/octopus-merge.ts +35 -11
- package/src/commands/ort-merge.ts +124 -23
- package/src/commands/ort-recursive.ts +40 -2
- package/src/commands/patch-id-command.ts +65 -0
- package/src/commands/patch-id.ts +327 -0
- package/src/commands/plumbing-command.ts +141 -0
- package/src/commands/plumbing-input.ts +87 -0
- package/src/commands/promisor-remote-reply.ts +276 -0
- package/src/commands/promisor-remote.ts +25 -2
- package/src/commands/pull-command.ts +720 -224
- package/src/commands/push-command.ts +440 -8
- package/src/commands/range-diff/index.ts +3 -0
- package/src/commands/range-diff/linear-assignment.ts +203 -0
- package/src/commands/range-diff/range-diff-command.ts +433 -0
- package/src/commands/range-diff/range-diff.ts +617 -0
- package/src/commands/read-tree-command.ts +74 -3
- package/src/commands/rebase-command.ts +647 -83
- package/src/commands/refs-command.ts +274 -0
- package/src/commands/remerge-diff.ts +241 -0
- package/src/commands/remote-command.ts +98 -10
- package/src/commands/remote-object-info-command.ts +109 -0
- package/src/commands/remote-show-command.ts +836 -0
- package/src/commands/remote-transport.ts +116 -1
- package/src/commands/repack-command.ts +383 -0
- package/src/commands/replace-command.ts +816 -0
- package/src/commands/replay-command.ts +674 -0
- package/src/commands/repo-command.ts +967 -0
- package/src/commands/request-pull-command.ts +356 -0
- package/src/commands/rerere-command.ts +179 -0
- package/src/commands/rerere.ts +925 -0
- package/src/commands/reset-command.ts +78 -3
- package/src/commands/restore-command.ts +15 -0
- package/src/commands/rev-filter/commit-grep.ts +7 -2
- package/src/commands/rev-list-command.ts +196 -11
- package/src/commands/rev-parse-command.ts +62 -4
- package/src/commands/revert-command.ts +62 -2
- package/src/commands/revision-range.ts +10 -3
- package/src/commands/revision-resolver.ts +44 -3
- package/src/commands/sequencer-pick.ts +370 -29
- package/src/commands/sequencer-support.ts +164 -2
- package/src/commands/serve-repository.ts +65 -0
- package/src/commands/session-id.ts +31 -0
- package/src/commands/shortlog-command.ts +354 -0
- package/src/commands/shortlog.ts +361 -0
- package/src/commands/show-branch-command.ts +981 -0
- package/src/commands/show-command.ts +3 -2
- package/src/commands/show-ref-command.ts +439 -0
- package/src/commands/signature-check.ts +37 -5
- package/src/commands/signing.ts +122 -16
- package/src/commands/stash-apply-command.ts +3 -0
- package/src/commands/stash-export-command.ts +397 -0
- package/src/commands/status-command.ts +158 -31
- package/src/commands/status-format.ts +1 -1
- package/src/commands/stripspace-command.ts +118 -0
- package/src/commands/submodule-add-command.ts +22 -1
- package/src/commands/submodule-auth.ts +61 -6
- package/src/commands/submodule-commands.ts +333 -5
- package/src/commands/submodule-fetch.ts +789 -0
- package/src/commands/submodule-model.ts +9 -1
- package/src/commands/submodule-unpack.ts +265 -0
- package/src/commands/submodule-update-command.ts +68 -5
- package/src/commands/subtree-shift.ts +215 -0
- package/src/commands/switch-command.ts +9 -0
- package/src/commands/textconv-cache.ts +143 -0
- package/src/commands/tree-restore.ts +20 -1
- package/src/commands/unpack-objects-command.ts +235 -0
- package/src/commands/update-index-command.ts +1016 -0
- package/src/commands/uri-protocols.ts +13 -0
- package/src/commands/url-parse-command.ts +67 -0
- package/src/commands/var-command.ts +219 -0
- package/src/commands/worktree-overwrite-checks.ts +5 -0
- package/src/errors/command-errors.ts +80 -0
- package/src/git-command.ts +218 -2
- package/src/git.ts +1033 -80
- package/src/guarded-transport-command.ts +176 -0
- package/src/index.ts +1 -0
- package/src/rename/detect-renames.ts +42 -8
- package/src/rename/diffcore-break.ts +166 -0
- package/src/rename/index.ts +1 -0
- package/src/results/blame-format.ts +268 -43
- package/src/results/cherry-pick-result.ts +6 -0
- package/src/results/clone-result.ts +6 -0
- package/src/results/diff-dirstat.ts +117 -0
- package/src/results/diff-entry.ts +24 -0
- package/src/results/diff-formatter.ts +8 -4
- package/src/results/diff-output.ts +239 -8
- package/src/results/diff-pickaxe.ts +1 -1
- package/src/results/fetch-result.ts +24 -1
- package/src/results/index.ts +2 -0
- package/src/results/init-result.ts +10 -1
- package/src/results/line-range-hunks.ts +126 -0
- package/src/results/merge-result.ts +14 -0
- package/src/results/pull-result.ts +7 -0
- package/src/results/push-result.ts +10 -0
- package/src/results/rebase-result.ts +7 -0
- package/src/results/revert-result.ts +6 -0
- package/src/results/stash-result.ts +6 -0
- package/src/results/status-result.ts +2 -2
- package/src/transport-command.ts +216 -4
- package/dist/fsck-DLRpbwTj.js +0 -13405
- package/dist/results-TB2IJ64h.js +0 -4700
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's `fetch.uriProtocols` (fetch-pack.c's fetch_pack_config): the last value, split at
|
|
3
|
+
* commas, as the fetch options' `uriProtocols`; nothing when unset or valueless.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* uriProtocolsOption("http,https"); // { uriProtocols: ["http", "https"] }
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export function uriProtocolsOption(value: string | undefined): { uriProtocols?: string[] } {
|
|
11
|
+
if (value === undefined || value === "") return {};
|
|
12
|
+
return { uriProtocols: value.split(",") };
|
|
13
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git url-parse` (builtin/url-parse.c, git 2.5x): each URL parsed as git reads remote URLs
|
|
3
|
+
* (`url_parse`), printing the component asked for, or dying on the first URL git refuses.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* // git url-parse -c host user@example.com:repo.git
|
|
8
|
+
* await git.urlParse().setComponent("host").addUrl("user@example.com:repo.git").call();
|
|
9
|
+
* // { exitCode: 0, stdout: "example.com\n", stderr: "" }
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { URL_COMPONENTS, type UrlComponent, urlComponent, urlParse } from "@statewalker/vcs-utils";
|
|
14
|
+
|
|
15
|
+
import { GitCommand } from "../git-command.js";
|
|
16
|
+
import type { PlumbingTextOutput } from "./check-ref-format-command.js";
|
|
17
|
+
|
|
18
|
+
const USAGE =
|
|
19
|
+
"usage: git url-parse [-c <component>] [--] <url>...\n\n" +
|
|
20
|
+
" -c, --[no-]component <component>\n" +
|
|
21
|
+
" which URL component to extract\n\n";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* `git url-parse [-c <component>] <url>...`: every URL checked in order, the component of
|
|
25
|
+
* each printed (an empty line when the URL has none); nothing printed without a component.
|
|
26
|
+
* A URL git refuses ends the run with git's `fatal:` line (exit 128) after the earlier URLs'
|
|
27
|
+
* lines; an unknown component dies before any URL is read, no URL prints the usage (129).
|
|
28
|
+
*/
|
|
29
|
+
export class UrlParseCommand extends GitCommand<PlumbingTextOutput> {
|
|
30
|
+
private readonly urls: string[] = [];
|
|
31
|
+
private component?: string;
|
|
32
|
+
|
|
33
|
+
/** A URL to parse. */
|
|
34
|
+
addUrl(url: string): this {
|
|
35
|
+
this.checkCallable();
|
|
36
|
+
this.urls.push(url);
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** `-c <component>`: `scheme`, `user`, `password`, `host`, `port` or `path`. */
|
|
41
|
+
setComponent(component: UrlComponent | string | undefined): this {
|
|
42
|
+
this.checkCallable();
|
|
43
|
+
this.component = component;
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async call(): Promise<PlumbingTextOutput> {
|
|
48
|
+
this.checkCallable();
|
|
49
|
+
this.setCallable(false);
|
|
50
|
+
if (this.urls.length === 0) return { exitCode: 129, stdout: "", stderr: USAGE };
|
|
51
|
+
const component = this.component;
|
|
52
|
+
if (component !== undefined && !URL_COMPONENTS.includes(component as UrlComponent)) {
|
|
53
|
+
return {
|
|
54
|
+
exitCode: 128,
|
|
55
|
+
stdout: "",
|
|
56
|
+
stderr: `fatal: invalid git URL component '${component}'\n`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
let stdout = "";
|
|
60
|
+
for (const url of this.urls) {
|
|
61
|
+
const parsed = urlParse(url);
|
|
62
|
+
if ("error" in parsed) return { exitCode: 128, stdout, stderr: `fatal: ${parsed.error}\n` };
|
|
63
|
+
if (component !== undefined) stdout += `${urlComponent(parsed, component as UrlComponent)}\n`;
|
|
64
|
+
}
|
|
65
|
+
return { exitCode: 0, stdout, stderr: "" };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git var` (builtin/var.c): git's logical variables (`GIT_AUTHOR_IDENT`, `GIT_EDITOR`,
|
|
3
|
+
* `GIT_PAGER`, `GIT_DEFAULT_BRANCH`, the configuration and attribute files ...), one asked
|
|
4
|
+
* for, or all of them after the configuration (`-l`).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // git var GIT_AUTHOR_IDENT
|
|
9
|
+
* await git.var().setVariable("GIT_AUTHOR_IDENT").call();
|
|
10
|
+
* // { exitCode: 0, stdout: "A U Thor <author@example.com> 1112911993 -0700\n", stderr: "" }
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { formatPersonIdent } from "@statewalker/vcs-core";
|
|
15
|
+
import {
|
|
16
|
+
expandUserPath,
|
|
17
|
+
type GitHostEnvironment,
|
|
18
|
+
xdgConfigPath,
|
|
19
|
+
} from "@statewalker/vcs-working-tree";
|
|
20
|
+
|
|
21
|
+
import { GitApiError } from "../errors/index.js";
|
|
22
|
+
import { GitCommand } from "../git-command.js";
|
|
23
|
+
import { RemoteConfigStore } from "../remote-config/index.js";
|
|
24
|
+
import type { PlumbingTextOutput } from "./check-ref-format-command.js";
|
|
25
|
+
import { isValidBranchName } from "./default-branch.js";
|
|
26
|
+
import { authorIdentOf, committerIdentOf, hostEnvironmentOf } from "./git-ident.js";
|
|
27
|
+
|
|
28
|
+
/** The variables `git var` knows, in the order `-l` lists them. */
|
|
29
|
+
export const GIT_VARIABLES = [
|
|
30
|
+
"GIT_COMMITTER_IDENT",
|
|
31
|
+
"GIT_AUTHOR_IDENT",
|
|
32
|
+
"GIT_EDITOR",
|
|
33
|
+
"GIT_SEQUENCE_EDITOR",
|
|
34
|
+
"GIT_PAGER",
|
|
35
|
+
"GIT_DEFAULT_BRANCH",
|
|
36
|
+
"GIT_SHELL_PATH",
|
|
37
|
+
"GIT_ATTR_SYSTEM",
|
|
38
|
+
"GIT_ATTR_GLOBAL",
|
|
39
|
+
"GIT_CONFIG_SYSTEM",
|
|
40
|
+
"GIT_CONFIG_GLOBAL",
|
|
41
|
+
] as const;
|
|
42
|
+
|
|
43
|
+
/** A variable of {@link GIT_VARIABLES}. */
|
|
44
|
+
export type GitVariable = (typeof GIT_VARIABLES)[number];
|
|
45
|
+
|
|
46
|
+
const USAGE = "usage: git var (-l | <variable>)\n";
|
|
47
|
+
|
|
48
|
+
/** git's `normalize_path_copy`: `//`, `.` and `..` components resolved (undefined above `/`). */
|
|
49
|
+
function normalizePath(path: string): string | undefined {
|
|
50
|
+
const absolute = path.startsWith("/");
|
|
51
|
+
const out: string[] = [];
|
|
52
|
+
const parts = path.split("/");
|
|
53
|
+
for (let i = 0; i < parts.length; i++) {
|
|
54
|
+
const part = parts[i] as string;
|
|
55
|
+
if (part === "" && i < parts.length - 1) continue;
|
|
56
|
+
if (part === ".") continue;
|
|
57
|
+
if (part === "..") {
|
|
58
|
+
if (out.length === 0) return undefined;
|
|
59
|
+
out.pop();
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
out.push(part);
|
|
63
|
+
}
|
|
64
|
+
const joined = out.join("/");
|
|
65
|
+
return absolute ? `/${joined}` : joined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* `git var -l` (every configuration variable as `key=value`, then every variable with a
|
|
70
|
+
* value) or `git var <variable>` (its value; exit 1 when it has none, usage and 129 for an
|
|
71
|
+
* unknown name). Identities are git's `fmt_ident` of the environment and configuration (strict
|
|
72
|
+
* when asked for alone); the editor is `GIT_EDITOR`, `core.editor`, `VISUAL` (unless the
|
|
73
|
+
* terminal is dumb), `EDITOR`, else `vi` (none on a dumb terminal); the pager `GIT_PAGER`,
|
|
74
|
+
* `core.pager`, `PAGER`, else `less` (`cat` for an empty one; the host environment's
|
|
75
|
+
* `defaultEditor` and `defaultPager` name another build's defaults); the shell `/bin/sh`; the
|
|
76
|
+
* file paths those of the host environment.
|
|
77
|
+
*/
|
|
78
|
+
export class VarCommand extends GitCommand<PlumbingTextOutput> {
|
|
79
|
+
private variable?: string;
|
|
80
|
+
private list = false;
|
|
81
|
+
|
|
82
|
+
/** The variable to print. */
|
|
83
|
+
setVariable(name: GitVariable | string): this {
|
|
84
|
+
this.checkCallable();
|
|
85
|
+
this.variable = name;
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** `-l`: the configuration, then every variable. */
|
|
90
|
+
setList(list: boolean): this {
|
|
91
|
+
this.checkCallable();
|
|
92
|
+
this.list = list;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async call(): Promise<PlumbingTextOutput> {
|
|
97
|
+
this.checkCallable();
|
|
98
|
+
this.setCallable(false);
|
|
99
|
+
const usage = { exitCode: 129, stdout: "", stderr: USAGE };
|
|
100
|
+
if (this.list === (this.variable !== undefined)) return usage;
|
|
101
|
+
if (this.list) {
|
|
102
|
+
let stdout = "";
|
|
103
|
+
for (const { key, text } of RemoteConfigStore.from(
|
|
104
|
+
this._workingCopy,
|
|
105
|
+
).allEntriesWithOrigin() ?? []) {
|
|
106
|
+
stdout += text === undefined ? `${key}\n` : `${key}=${text}\n`;
|
|
107
|
+
}
|
|
108
|
+
for (const name of GIT_VARIABLES) {
|
|
109
|
+
let value: string | undefined;
|
|
110
|
+
try {
|
|
111
|
+
value = this.read(name, false);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
if (error instanceof GitApiError)
|
|
114
|
+
return { exitCode: 128, stdout, stderr: `${error.message}\n` };
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
if (value === undefined) continue;
|
|
118
|
+
// the global files, one per line
|
|
119
|
+
const lines = name === "GIT_CONFIG_GLOBAL" && value !== "" ? value.split("\n") : [value];
|
|
120
|
+
for (const line of lines) stdout += `${name}=${line}\n`;
|
|
121
|
+
}
|
|
122
|
+
return { exitCode: 0, stdout, stderr: "" };
|
|
123
|
+
}
|
|
124
|
+
const name = this.variable as string;
|
|
125
|
+
if (!(GIT_VARIABLES as readonly string[]).includes(name)) return usage;
|
|
126
|
+
let value: string | undefined;
|
|
127
|
+
try {
|
|
128
|
+
value = this.read(name as GitVariable, true);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
if (error instanceof GitApiError)
|
|
131
|
+
return { exitCode: 128, stdout: "", stderr: `${error.message}\n` };
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
if (value === undefined) return { exitCode: 1, stdout: "", stderr: "" };
|
|
135
|
+
return { exitCode: 0, stdout: `${value}\n`, stderr: "" };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** A variable's value, undefined when it has none. */
|
|
139
|
+
private read(name: GitVariable, strict: boolean): string | undefined {
|
|
140
|
+
const environment = hostEnvironmentOf(this._workingCopy);
|
|
141
|
+
const config = RemoteConfigStore.from(this._workingCopy);
|
|
142
|
+
const programs = environment?.programVariables ?? {};
|
|
143
|
+
switch (name) {
|
|
144
|
+
case "GIT_COMMITTER_IDENT":
|
|
145
|
+
return formatPersonIdent(committerIdentOf(this._workingCopy, { strict }));
|
|
146
|
+
case "GIT_AUTHOR_IDENT":
|
|
147
|
+
return formatPersonIdent(authorIdentOf(this._workingCopy, { strict }));
|
|
148
|
+
case "GIT_EDITOR":
|
|
149
|
+
return this.editor(environment, config);
|
|
150
|
+
case "GIT_SEQUENCE_EDITOR":
|
|
151
|
+
return (
|
|
152
|
+
programs.GIT_SEQUENCE_EDITOR ??
|
|
153
|
+
config.value("sequence.editor") ??
|
|
154
|
+
this.editor(environment, config)
|
|
155
|
+
);
|
|
156
|
+
case "GIT_PAGER": {
|
|
157
|
+
const pager =
|
|
158
|
+
programs.GIT_PAGER ??
|
|
159
|
+
config.value("core.pager") ??
|
|
160
|
+
programs.PAGER ??
|
|
161
|
+
environment?.defaultPager ??
|
|
162
|
+
"less";
|
|
163
|
+
return pager === "" || pager === "cat" ? "cat" : pager;
|
|
164
|
+
}
|
|
165
|
+
case "GIT_DEFAULT_BRANCH": {
|
|
166
|
+
const configured = config.value("init.defaultBranch");
|
|
167
|
+
if (configured === undefined) return environment?.breakingChanges ? "main" : "master";
|
|
168
|
+
if (!isValidBranchName(configured)) {
|
|
169
|
+
throw new GitApiError(`fatal: invalid branch name: init.defaultBranch = ${configured}`);
|
|
170
|
+
}
|
|
171
|
+
return configured;
|
|
172
|
+
}
|
|
173
|
+
case "GIT_SHELL_PATH":
|
|
174
|
+
return "/bin/sh";
|
|
175
|
+
case "GIT_ATTR_SYSTEM":
|
|
176
|
+
return environment?.systemAttributes !== undefined
|
|
177
|
+
? normalizePath(environment.systemAttributes)
|
|
178
|
+
: undefined;
|
|
179
|
+
case "GIT_ATTR_GLOBAL": {
|
|
180
|
+
const configured = config.value("core.attributesFile");
|
|
181
|
+
const path =
|
|
182
|
+
configured !== undefined
|
|
183
|
+
? expandUserPath(configured, environment)
|
|
184
|
+
: xdgConfigPath(environment, "attributes");
|
|
185
|
+
return path === undefined ? undefined : normalizePath(path);
|
|
186
|
+
}
|
|
187
|
+
case "GIT_CONFIG_SYSTEM":
|
|
188
|
+
return environment?.systemConfig !== undefined
|
|
189
|
+
? normalizePath(environment.systemConfig)
|
|
190
|
+
: undefined;
|
|
191
|
+
case "GIT_CONFIG_GLOBAL": {
|
|
192
|
+
// git_global_config_paths: $GIT_CONFIG_GLOBAL alone, else the XDG file and ~/.gitconfig
|
|
193
|
+
const paths =
|
|
194
|
+
environment?.globalConfig !== undefined
|
|
195
|
+
? [environment.globalConfig]
|
|
196
|
+
: [xdgConfigPath(environment, "config"), expandUserPath("~/.gitconfig", environment)];
|
|
197
|
+
const found = paths
|
|
198
|
+
.filter((p): p is string => p !== undefined && p !== "")
|
|
199
|
+
.map((p) => normalizePath(p) ?? p);
|
|
200
|
+
return found.length > 0 ? found.join("\n") : undefined;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** git_editor */
|
|
206
|
+
private editor(
|
|
207
|
+
environment: GitHostEnvironment | undefined,
|
|
208
|
+
config: RemoteConfigStore,
|
|
209
|
+
): string | undefined {
|
|
210
|
+
const programs = environment?.programVariables ?? {};
|
|
211
|
+
const term = programs.TERM;
|
|
212
|
+
const dumb = term === undefined || term === "dumb";
|
|
213
|
+
let editor = programs.GIT_EDITOR ?? config.value("core.editor");
|
|
214
|
+
if (editor === undefined && !dumb) editor = programs.VISUAL;
|
|
215
|
+
editor ??= programs.EDITOR;
|
|
216
|
+
if (editor === undefined && dumb) return undefined;
|
|
217
|
+
return editor ?? environment?.defaultEditor ?? "vi";
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -414,6 +414,8 @@ export function overwriteMessage(
|
|
|
414
414
|
lostDirs?: string[];
|
|
415
415
|
untracked?: string[];
|
|
416
416
|
untrackedRemoved?: string[];
|
|
417
|
+
/** Submodules that cannot be moved (git's ERROR_WOULD_LOSE_SUBMODULE), listed last */
|
|
418
|
+
submodules?: string[];
|
|
417
419
|
},
|
|
418
420
|
): string | undefined {
|
|
419
421
|
const list = (paths: string[]) => paths.map((p) => `\t${p}`);
|
|
@@ -463,6 +465,9 @@ export function overwriteMessage(
|
|
|
463
465
|
].join("\n"),
|
|
464
466
|
);
|
|
465
467
|
}
|
|
468
|
+
if (found.submodules?.length) {
|
|
469
|
+
parts.push(["error: Cannot update submodule:", ...list(found.submodules), ""].join("\n"));
|
|
470
|
+
}
|
|
466
471
|
return parts.length > 0 ? [...parts, "Aborting"].join("\n") : undefined;
|
|
467
472
|
}
|
|
468
473
|
|
|
@@ -167,3 +167,83 @@ export class HookFailedError extends GitApiError {
|
|
|
167
167
|
this.name = "HookFailedError";
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Thrown where `git describe` or `git name-rev` dies: the message is git's stderr (its
|
|
173
|
+
* `fatal:` line last), {@link stdout} what it printed before.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* try {
|
|
178
|
+
* await git.describe().setExactMatch(true).callText();
|
|
179
|
+
* } catch (e) {
|
|
180
|
+
* if (e instanceof DescribeError) console.error(e.message); // fatal: no tag exactly matches '...'
|
|
181
|
+
* }
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export class DescribeError extends GitApiError {
|
|
185
|
+
/** What git printed on stdout before it died */
|
|
186
|
+
readonly stdout: string;
|
|
187
|
+
/**
|
|
188
|
+
* A death saying nothing describes the commit (no names, no tag can describe it, no
|
|
189
|
+
* exact match, name-rev's `cannot describe`), not a failure of the command itself
|
|
190
|
+
*/
|
|
191
|
+
readonly undescribable: boolean;
|
|
192
|
+
|
|
193
|
+
constructor(
|
|
194
|
+
message: string,
|
|
195
|
+
stdout = "",
|
|
196
|
+
exitCode?: number,
|
|
197
|
+
options: { undescribable?: boolean } = {},
|
|
198
|
+
) {
|
|
199
|
+
super(message, exitCode !== undefined ? { exitCode } : undefined);
|
|
200
|
+
this.name = "DescribeError";
|
|
201
|
+
this.stdout = stdout;
|
|
202
|
+
this.undescribable = options.undescribable ?? false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Thrown by `mktag` when git dies (exit status 128): the input fails the strict fsck check
|
|
208
|
+
* (its `error: tag input does not pass fsck: ...` lines first), the tagged object is
|
|
209
|
+
* missing or of another type, or the tag cannot be written. The message is git's stderr.
|
|
210
|
+
*/
|
|
211
|
+
export class MktagFailedError extends GitApiError {
|
|
212
|
+
constructor(message: string) {
|
|
213
|
+
super(message, { exitCode: 128 });
|
|
214
|
+
this.name = "MktagFailedError";
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Thrown by `update-index` where git dies (exit status 128), before the index is written:
|
|
220
|
+
* a path it cannot add or remove (`Unable to process path <path>`), an entry it cannot mark,
|
|
221
|
+
* a malformed `--index-info` line. The message is git's stderr, `output` what it printed on
|
|
222
|
+
* stdout before (`--verbose`'s report).
|
|
223
|
+
*/
|
|
224
|
+
export class UpdateIndexFailedError extends GitApiError {
|
|
225
|
+
constructor(
|
|
226
|
+
message: string,
|
|
227
|
+
/** What git printed on stdout before dying */
|
|
228
|
+
readonly output = "",
|
|
229
|
+
) {
|
|
230
|
+
super(message, { exitCode: 128 });
|
|
231
|
+
this.name = "UpdateIndexFailedError";
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Thrown by `checkout-index` where git dies (exit status 128): options it refuses together
|
|
237
|
+
* (`--stage=all` with `--no-temp`, `--all` with paths), a badly quoted `--stdin` line, a file
|
|
238
|
+
* standing where a directory must be created without `-f`. The message is git's stderr.
|
|
239
|
+
*/
|
|
240
|
+
export class CheckoutIndexFailedError extends GitApiError {
|
|
241
|
+
constructor(
|
|
242
|
+
message: string,
|
|
243
|
+
/** What git printed on stdout before dying */
|
|
244
|
+
readonly output = "",
|
|
245
|
+
) {
|
|
246
|
+
super(message, { exitCode: 128 });
|
|
247
|
+
this.name = "CheckoutIndexFailedError";
|
|
248
|
+
}
|
|
249
|
+
}
|