@statewalker/vcs-commands 0.9.0 → 0.11.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.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 +41 -2
- package/dist/commands/am/am-command.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 +43 -1
- package/dist/commands/blame-command.d.ts.map +1 -1
- 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 +144 -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-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.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/cherry-pick-command.d.ts +10 -0
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +28 -0
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +9 -1
- 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 +54 -0
- package/dist/commands/default-branch.d.ts.map +1 -1
- package/dist/commands/diff-command.d.ts +132 -5
- 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 +65 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/fetch-multiple-command.d.ts.map +1 -1
- package/dist/commands/format-rev-command.d.ts +60 -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-ipc.d.ts +30 -0
- package/dist/commands/fsmonitor-ipc.d.ts.map +1 -0
- 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-hooks.d.ts +32 -0
- 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 +45 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -5
- 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/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +26 -0
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +28 -1
- 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/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 +7 -0
- 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 +67 -5
- package/dist/commands/merge-drivers.d.ts.map +1 -1
- package/dist/commands/merge-support.d.ts +6 -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/mktag-command.d.ts +51 -0
- package/dist/commands/mktag-command.d.ts.map +1 -0
- 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/ort-merge.d.ts +24 -0
- package/dist/commands/ort-merge.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 +24 -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.map +1 -1
- package/dist/commands/push-command.d.ts +17 -2
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +108 -2
- 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/remote-object-info-command.d.ts +55 -0
- package/dist/commands/remote-object-info-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 +158 -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 -2
- package/dist/commands/reset-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 +3 -0
- package/dist/commands/rev-list-command.d.ts.map +1 -1
- package/dist/commands/rev-parse-command.d.ts +5 -0
- package/dist/commands/rev-parse-command.d.ts.map +1 -1
- package/dist/commands/revert-command.d.ts +10 -0
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +5 -0
- package/dist/commands/revision-range.d.ts.map +1 -1
- package/dist/commands/revision-resolver.d.ts +27 -1
- package/dist/commands/revision-resolver.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +18 -0
- package/dist/commands/sequencer-pick.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/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 +30 -2
- 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 +16 -2
- 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 +22 -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 +9 -1
- package/dist/commands/submodule-commands.d.ts.map +1 -1
- package/dist/commands/submodule-update-command.d.ts +27 -1
- package/dist/commands/submodule-update-command.d.ts.map +1 -1
- package/dist/commands/tag-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 +131 -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-CNvli5bl.js → commands-bQQ9OmCh.js} +52514 -44630
- package/dist/errors/command-errors.d.ts +33 -0
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/index.js +39 -1
- package/dist/{fsck-CPeDh9fh.js → fsck-BHT9bUS-.js} +184 -143
- package/dist/git-command.d.ts +66 -4
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +532 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/guarded-transport-command.d.ts +3 -1
- package/dist/guarded-transport-command.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/maintenance-run-command-Cx2PlGV9.js +13544 -0
- package/dist/{remote-transport-CCmBadm-.js → remote-transport-BrQZfyHu.js} +1009 -10
- package/dist/results/cherry-pick-result.d.ts +6 -0
- package/dist/results/cherry-pick-result.d.ts.map +1 -1
- package/dist/results/diff-entry.d.ts +10 -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 +49 -3
- package/dist/results/diff-output.d.ts.map +1 -1
- package/dist/results/fetch-result.d.ts +12 -0
- package/dist/results/fetch-result.d.ts.map +1 -1
- package/dist/results/index.js +2 -2
- package/dist/results/merge-result.d.ts +5 -0
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +5 -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-BDuEgdLU.js → results-CNHQnU5Y.js} +13707 -10608
- package/dist/transport-command.d.ts +79 -1
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/commands/add-command.ts +3 -0
- package/src/commands/add-patch/patch-backend.ts +4 -1
- 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 +193 -22
- package/src/commands/apply/index.ts +1 -0
- 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 +118 -19
- 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 +895 -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-ref-format-command.ts +129 -0
- package/src/commands/checkout-command.ts +61 -22
- package/src/commands/checkout-index-command.ts +568 -0
- package/src/commands/checkout-paths.ts +7 -0
- package/src/commands/cherry-pick-command.ts +21 -1
- package/src/commands/clone-command.ts +249 -9
- package/src/commands/commit-command.ts +22 -4
- package/src/commands/config-command.ts +9 -0
- package/src/commands/daemon-access-hook.ts +78 -0
- package/src/commands/default-branch.ts +118 -1
- package/src/commands/diff-command.ts +592 -47
- 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 +312 -8
- package/src/commands/fetch-multiple-command.ts +4 -1
- package/src/commands/format-rev-command.ts +267 -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-ipc.ts +121 -0
- package/src/commands/fsmonitor-refresh.ts +320 -0
- package/src/commands/gc-command.ts +10 -0
- package/src/commands/git-hooks.ts +123 -6
- 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 +46 -0
- package/src/commands/init-command.ts +14 -0
- 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/local-transport.ts +252 -4
- package/src/commands/log-command.ts +104 -5
- package/src/commands/log-output.ts +66 -5
- 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 +708 -0
- package/src/commands/maintenance-run-command.ts +949 -0
- package/src/commands/merge-command.ts +78 -32
- package/src/commands/merge-config.ts +23 -1
- package/src/commands/merge-drivers.ts +109 -20
- package/src/commands/merge-support.ts +29 -5
- package/src/commands/merge-tree-command.ts +786 -0
- package/src/commands/mktag-command.ts +149 -0
- 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/ort-merge.ts +92 -25
- package/src/commands/patch-id-command.ts +65 -0
- package/src/commands/patch-id.ts +218 -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 +2 -0
- package/src/commands/push-command.ts +87 -5
- package/src/commands/rebase-command.ts +507 -19
- package/src/commands/refs-command.ts +274 -0
- package/src/commands/remote-object-info-command.ts +109 -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 +1066 -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 +75 -3
- package/src/commands/rev-filter/commit-grep.ts +7 -2
- package/src/commands/rev-list-command.ts +9 -0
- package/src/commands/rev-parse-command.ts +49 -5
- package/src/commands/revert-command.ts +21 -1
- package/src/commands/revision-range.ts +7 -2
- package/src/commands/revision-resolver.ts +97 -14
- package/src/commands/sequencer-pick.ts +47 -0
- package/src/commands/serve-repository.ts +65 -0
- package/src/commands/session-id.ts +31 -0
- package/src/commands/show-branch-command.ts +981 -0
- package/src/commands/show-command.ts +1 -1
- package/src/commands/show-ref-command.ts +439 -0
- package/src/commands/signature-check.ts +37 -5
- package/src/commands/signing.ts +176 -23
- package/src/commands/stash-apply-command.ts +3 -0
- package/src/commands/stash-export-command.ts +397 -0
- package/src/commands/status-command.ts +74 -8
- package/src/commands/stripspace-command.ts +118 -0
- package/src/commands/submodule-add-command.ts +40 -2
- package/src/commands/submodule-auth.ts +61 -6
- package/src/commands/submodule-commands.ts +12 -2
- package/src/commands/submodule-update-command.ts +47 -1
- package/src/commands/tag-command.ts +33 -11
- package/src/commands/textconv-cache.ts +143 -0
- package/src/commands/tree-restore.ts +14 -0
- package/src/commands/unpack-objects-command.ts +235 -0
- package/src/commands/update-index-command.ts +1148 -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/errors/command-errors.ts +45 -0
- package/src/git-command.ts +177 -3
- package/src/git.ts +808 -1
- package/src/guarded-transport-command.ts +6 -1
- package/src/results/cherry-pick-result.ts +6 -0
- package/src/results/diff-entry.ts +12 -0
- package/src/results/diff-formatter.ts +7 -4
- package/src/results/diff-output.ts +117 -11
- package/src/results/diff-pickaxe.ts +1 -1
- package/src/results/fetch-result.ts +12 -0
- package/src/results/merge-result.ts +5 -0
- package/src/results/push-result.ts +5 -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/transport-command.ts +182 -1
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client side of the v2 `promisor-remote` capability (git 2.49+, promisor-remote.c's
|
|
3
|
+
* `filter_promisor_remote` and `promisor_remote_reply`): which promisor remotes a server
|
|
4
|
+
* advertises the client accepts (`promisor.acceptFromServer`: `None`, `KnownUrl`, `KnownName`,
|
|
5
|
+
* `All`; `promisor.checkFields`), what it stores of them (`promisor.storeFields`: the
|
|
6
|
+
* `partialCloneFilter` and `token` of a remote it already has), and which remotes its lazy
|
|
7
|
+
* fetches then try first ({@link acceptedPromisorRemotes}).
|
|
8
|
+
*
|
|
9
|
+
* Not yet: `promisor.acceptFromServerUrl` (2.56: remotes created from an advertised URL) and
|
|
10
|
+
* `--filter=auto`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // [promisor] acceptFromServer = knownUrl; [remote "lop"] url = file:///lop; promisor = true
|
|
15
|
+
* const reply = promisorRemoteReplyOf(workingCopy, (line) => stderr.push(line));
|
|
16
|
+
* await reply("name=lop,url=file:///lop"); // "lop": sent as `promisor-remote=lop`
|
|
17
|
+
* acceptedPromisorRemotes(workingCopy); // Set { "lop" }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { ObjectFilterError, parseObjectFilter } from "@statewalker/vcs-core";
|
|
22
|
+
import {
|
|
23
|
+
encodePromisorRemoteNames,
|
|
24
|
+
type PromisorRemoteInfo,
|
|
25
|
+
type PromisorRemoteReply,
|
|
26
|
+
parsePromisorRemoteInfo,
|
|
27
|
+
} from "@statewalker/vcs-transport";
|
|
28
|
+
import type { WorkingCopy } from "@statewalker/vcs-working-tree";
|
|
29
|
+
import { RemoteConfigStore } from "../remote-config/index.js";
|
|
30
|
+
import { promisorRemotes } from "./promisor-remote.js";
|
|
31
|
+
|
|
32
|
+
type AcceptPolicy = "none" | "knownUrl" | "knownName" | "all";
|
|
33
|
+
|
|
34
|
+
/** The optional fields git knows (`known_fields`), lower-cased. */
|
|
35
|
+
const KNOWN_FIELDS = new Map([
|
|
36
|
+
["partialclonefilter", "partialCloneFilter"],
|
|
37
|
+
["token", "token"],
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
const accepted = new WeakMap<object, Set<string>>();
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The promisor remotes a server's `promisor-remote` advertisement made this repository
|
|
44
|
+
* accept (git's `promisor_remote.accepted`, kept for the process): its lazy fetches try them
|
|
45
|
+
* before the other promisor remotes.
|
|
46
|
+
*/
|
|
47
|
+
export function acceptedPromisorRemotes(workingCopy: WorkingCopy): ReadonlySet<string> {
|
|
48
|
+
return accepted.get(keyOf(workingCopy)) ?? new Set();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function keyOf(workingCopy: WorkingCopy): object {
|
|
52
|
+
try {
|
|
53
|
+
return workingCopy.history?.objects ?? workingCopy;
|
|
54
|
+
} catch {
|
|
55
|
+
return workingCopy;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The answer of `workingCopy` to a server's `promisor-remote` capability, given to
|
|
61
|
+
* `fetchFromConnection` (`FetchClientOptions.promisorRemote`). `stderr` gets git's lines
|
|
62
|
+
* (warnings, `Storing new filter from server ...`), each without its newline. Each call reads
|
|
63
|
+
* the configuration afresh: a stored field is not stored (nor told) again.
|
|
64
|
+
*/
|
|
65
|
+
export function promisorRemoteReplyOf(
|
|
66
|
+
workingCopy: WorkingCopy,
|
|
67
|
+
stderr: (line: string) => void,
|
|
68
|
+
): PromisorRemoteReply {
|
|
69
|
+
// fields_checked / fields_stored warn about unknown names once per process
|
|
70
|
+
const warnedFields = new Set<string>();
|
|
71
|
+
const fieldsOf = (store: RemoteConfigStore, key: string): string[] => {
|
|
72
|
+
const value = store.value(key);
|
|
73
|
+
if (!value) return [];
|
|
74
|
+
const out: string[] = [];
|
|
75
|
+
for (const raw of value.split(",")) {
|
|
76
|
+
const field = raw.trim();
|
|
77
|
+
if (field === "") continue;
|
|
78
|
+
const known = KNOWN_FIELDS.get(field.toLowerCase());
|
|
79
|
+
if (!known) {
|
|
80
|
+
if (!warnedFields.has(`${key}\0${field}`)) {
|
|
81
|
+
warnedFields.add(`${key}\0${field}`);
|
|
82
|
+
stderr(`warning: unsupported field '${field}' in '${key}' config`);
|
|
83
|
+
}
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (!out.includes(known)) out.push(known);
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
};
|
|
90
|
+
return async (info) => {
|
|
91
|
+
const store = RemoteConfigStore.from(workingCopy);
|
|
92
|
+
const policy = acceptPolicyOf(store, stderr);
|
|
93
|
+
if (policy === "none") return undefined;
|
|
94
|
+
const { remotes, warnings } = parsePromisorRemoteInfo(info);
|
|
95
|
+
for (const w of warnings) stderr(`warning: ${w}`);
|
|
96
|
+
const checked = fieldsOf(store, "promisor.checkFields");
|
|
97
|
+
const local = configuredPromisors(store, checked);
|
|
98
|
+
const accepting: PromisorRemoteInfo[] = [];
|
|
99
|
+
for (const advertised of remotes) {
|
|
100
|
+
if (shouldAccept(policy, advertised, local, checked, stderr)) accepting.push(advertised);
|
|
101
|
+
}
|
|
102
|
+
if (accepting.length === 0) return undefined;
|
|
103
|
+
// promisor_store_advertised_fields: only for a remote configured here
|
|
104
|
+
const storedFields = fieldsOf(store, "promisor.storeFields");
|
|
105
|
+
let changed = false;
|
|
106
|
+
if (storedFields.length > 0) {
|
|
107
|
+
const current = configuredPromisors(store, storedFields);
|
|
108
|
+
for (const advertised of accepting) {
|
|
109
|
+
const mine = current.find((p) => p.name === advertised.name);
|
|
110
|
+
if (!mine) continue;
|
|
111
|
+
if (
|
|
112
|
+
storedFields.includes("partialCloneFilter") &&
|
|
113
|
+
advertised.filter !== undefined &&
|
|
114
|
+
validFilter(advertised.filter, advertised.name, stderr)
|
|
115
|
+
) {
|
|
116
|
+
changed =
|
|
117
|
+
storeField(
|
|
118
|
+
store,
|
|
119
|
+
advertised.name,
|
|
120
|
+
"filter",
|
|
121
|
+
"partialCloneFilter",
|
|
122
|
+
advertised.filter,
|
|
123
|
+
mine.filter,
|
|
124
|
+
stderr,
|
|
125
|
+
) || changed;
|
|
126
|
+
}
|
|
127
|
+
if (
|
|
128
|
+
storedFields.includes("token") &&
|
|
129
|
+
advertised.token !== undefined &&
|
|
130
|
+
validToken(advertised.token, advertised.name, stderr)
|
|
131
|
+
) {
|
|
132
|
+
changed =
|
|
133
|
+
storeField(
|
|
134
|
+
store,
|
|
135
|
+
advertised.name,
|
|
136
|
+
"token",
|
|
137
|
+
"token",
|
|
138
|
+
advertised.token,
|
|
139
|
+
mine.token,
|
|
140
|
+
stderr,
|
|
141
|
+
) || changed;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (changed) await store.save();
|
|
146
|
+
// the accepted remotes that are promisor remotes here are tried first by lazy fetches
|
|
147
|
+
const promisors = new Set(
|
|
148
|
+
promisorRemotes(RemoteConfigStore.from(workingCopy)).map((r) => r.name),
|
|
149
|
+
);
|
|
150
|
+
const key = keyOf(workingCopy);
|
|
151
|
+
const set = accepted.get(key) ?? new Set<string>();
|
|
152
|
+
for (const r of accepting) if (promisors.has(r.name)) set.add(r.name);
|
|
153
|
+
accepted.set(key, set);
|
|
154
|
+
return encodePromisorRemoteNames(accepting.map((r) => r.name));
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** accept_from_server: the last `promisor.acceptFromServer`, case-insensitive. */
|
|
159
|
+
function acceptPolicyOf(store: RemoteConfigStore, stderr: (line: string) => void): AcceptPolicy {
|
|
160
|
+
const value = store.value("promisor.acceptfromserver");
|
|
161
|
+
if (value === undefined) return "none";
|
|
162
|
+
const v = value.toLowerCase();
|
|
163
|
+
if (v === "" || v === "none") return "none";
|
|
164
|
+
if (v === "knownurl") return "knownUrl";
|
|
165
|
+
if (v === "knownname") return "knownName";
|
|
166
|
+
if (v === "all") return "all";
|
|
167
|
+
stderr(`warning: unknown '${value}' value for 'promisor.acceptfromserver' config option`);
|
|
168
|
+
return "none";
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** promisor_config_info_list: the promisor remotes with a non-empty URL, with `fields`. */
|
|
172
|
+
function configuredPromisors(
|
|
173
|
+
store: RemoteConfigStore,
|
|
174
|
+
fields: readonly string[],
|
|
175
|
+
): PromisorRemoteInfo[] {
|
|
176
|
+
const out: PromisorRemoteInfo[] = [];
|
|
177
|
+
const nonEmpty = (key: string) => {
|
|
178
|
+
const v = store.value(key);
|
|
179
|
+
return v ? v : undefined;
|
|
180
|
+
};
|
|
181
|
+
for (const { name } of promisorRemotes(store)) {
|
|
182
|
+
const url = nonEmpty(`remote.${name}.url`);
|
|
183
|
+
if (url === undefined) continue;
|
|
184
|
+
const filter = fields.includes("partialCloneFilter")
|
|
185
|
+
? nonEmpty(`remote.${name}.partialCloneFilter`)
|
|
186
|
+
: undefined;
|
|
187
|
+
const token = fields.includes("token") ? nonEmpty(`remote.${name}.token`) : undefined;
|
|
188
|
+
out.push({
|
|
189
|
+
name,
|
|
190
|
+
url,
|
|
191
|
+
...(filter !== undefined ? { filter } : {}),
|
|
192
|
+
...(token !== undefined ? { token } : {}),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** should_accept_remote (without `promisor.acceptFromServerUrl`). */
|
|
199
|
+
function shouldAccept(
|
|
200
|
+
policy: AcceptPolicy,
|
|
201
|
+
advertised: PromisorRemoteInfo,
|
|
202
|
+
local: readonly PromisorRemoteInfo[],
|
|
203
|
+
checked: readonly string[],
|
|
204
|
+
stderr: (line: string) => void,
|
|
205
|
+
): boolean {
|
|
206
|
+
const mine = local.find((p) => p.name === advertised.name);
|
|
207
|
+
if (!mine) return policy === "all" && allFieldsMatch(advertised, local, undefined, checked);
|
|
208
|
+
if (policy === "all") return allFieldsMatch(advertised, local, undefined, checked);
|
|
209
|
+
if (policy === "knownName") return allFieldsMatch(advertised, local, mine, checked);
|
|
210
|
+
if (mine.url !== advertised.url) {
|
|
211
|
+
stderr(
|
|
212
|
+
`warning: known remote named '${advertised.name}' but with URL '${mine.url}' instead of '${advertised.url}', ignoring this remote`,
|
|
213
|
+
);
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
return policy === "knownUrl" && allFieldsMatch(advertised, local, mine, checked);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** all_fields_match: every checked field advertised and equal to one remote's (or `mine`'s). */
|
|
220
|
+
function allFieldsMatch(
|
|
221
|
+
advertised: PromisorRemoteInfo,
|
|
222
|
+
local: readonly PromisorRemoteInfo[],
|
|
223
|
+
mine: PromisorRemoteInfo | undefined,
|
|
224
|
+
checked: readonly string[],
|
|
225
|
+
): boolean {
|
|
226
|
+
const fieldOf = (r: PromisorRemoteInfo, field: string) =>
|
|
227
|
+
field === "partialCloneFilter" ? r.filter : r.token;
|
|
228
|
+
for (const field of checked) {
|
|
229
|
+
const value = fieldOf(advertised, field);
|
|
230
|
+
if (value === undefined) return false;
|
|
231
|
+
const candidates = mine ? [mine] : local;
|
|
232
|
+
if (!candidates.some((r) => fieldOf(r, field) === value)) return false;
|
|
233
|
+
}
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** store_one_field: a new value written (`repo_config_set_gently`) and told on stderr. */
|
|
238
|
+
function storeField(
|
|
239
|
+
store: RemoteConfigStore,
|
|
240
|
+
remote: string,
|
|
241
|
+
label: string,
|
|
242
|
+
field: string,
|
|
243
|
+
advertised: string,
|
|
244
|
+
current: string | undefined,
|
|
245
|
+
stderr: (line: string) => void,
|
|
246
|
+
): boolean {
|
|
247
|
+
if (current !== undefined && current === advertised) return false;
|
|
248
|
+
stderr(`Storing new ${label} from server for remote '${remote}'.`);
|
|
249
|
+
stderr(` '${current ?? ""}' -> '${advertised}'`);
|
|
250
|
+
store.setValue(`remote.${remote}.${field}`, advertised);
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** valid_filter: the advertised filter must parse (git warns with the parser's reason). */
|
|
255
|
+
function validFilter(filter: string, remote: string, stderr: (line: string) => void): boolean {
|
|
256
|
+
try {
|
|
257
|
+
parseObjectFilter(filter);
|
|
258
|
+
return true;
|
|
259
|
+
} catch (error) {
|
|
260
|
+
const reason = error instanceof ObjectFilterError ? error.message : String(error);
|
|
261
|
+
stderr(
|
|
262
|
+
`warning: invalid filter '${filter}' for remote '${remote}' will not be stored: ${reason}`,
|
|
263
|
+
);
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** valid_token: no control character. */
|
|
269
|
+
function validToken(token: string, remote: string, stderr: (line: string) => void): boolean {
|
|
270
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: git's iscntrl check
|
|
271
|
+
if (/[\x00-\x1f\x7f]/.test(token)) {
|
|
272
|
+
stderr(`warning: invalid token '${token}' for remote '${remote}' will not be stored`);
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
@@ -34,11 +34,14 @@ import {
|
|
|
34
34
|
FetchCheckError,
|
|
35
35
|
fetchPromisedObjects,
|
|
36
36
|
type GitTransportRegistry,
|
|
37
|
+
unpackLimitOf,
|
|
37
38
|
} from "@statewalker/vcs-transport";
|
|
38
39
|
import { parseGitBool } from "@statewalker/vcs-utils";
|
|
39
40
|
import type { WorkingCopy } from "@statewalker/vcs-working-tree";
|
|
40
41
|
import { RemoteConfigStore } from "../remote-config/index.js";
|
|
41
42
|
import { hostEnvironmentOf } from "./git-ident.js";
|
|
43
|
+
import { httpClientSettingsOf } from "./http-config.js";
|
|
44
|
+
import { acceptedPromisorRemotes } from "./promisor-remote-reply.js";
|
|
42
45
|
|
|
43
46
|
/** A promisor remote (git's `struct promisor_remote`). */
|
|
44
47
|
export interface PromisorRemote {
|
|
@@ -166,6 +169,14 @@ export function createPromisorFetcher(
|
|
|
166
169
|
return false;
|
|
167
170
|
}
|
|
168
171
|
const config = store();
|
|
172
|
+
// the child `git fetch <remote> --filter=blob:none` registers the filter first
|
|
173
|
+
// (fetch_one_setup_partial's partial_clone_register): a promisor remote without one,
|
|
174
|
+
// such as a large object promisor a server's promisor-remote capability named, gets it
|
|
175
|
+
if (remote.partialCloneFilter === undefined) {
|
|
176
|
+
registerPartialClone(config, remote.name, "blob:none");
|
|
177
|
+
await config.save();
|
|
178
|
+
remote.partialCloneFilter = "blob:none";
|
|
179
|
+
}
|
|
169
180
|
const url = config.remoteUrlOf(remote.name);
|
|
170
181
|
// the child fetch runs with fetch_if_missing = 0: it reads through the history's view
|
|
171
182
|
// without lazy fetch (a read elsewhere meanwhile still fetches)
|
|
@@ -177,6 +188,7 @@ export function createPromisorFetcher(
|
|
|
177
188
|
const { fetchFsckOf } = await import("./fsck/index.js");
|
|
178
189
|
const environment = hostEnvironmentOf(workingCopy);
|
|
179
190
|
const fsckWarnings: string[] = [];
|
|
191
|
+
const unpackLimit = unpackLimitOf({ getAll: (key) => config.values(key) }, "fetch");
|
|
180
192
|
const fsck = await fetchFsckOf({
|
|
181
193
|
value: (key) => config.value(key),
|
|
182
194
|
entries: (prefix) => config.entriesWithPrefix(prefix),
|
|
@@ -203,6 +215,8 @@ export function createPromisorFetcher(
|
|
|
203
215
|
...(options.headers ? { headers: options.headers } : {}),
|
|
204
216
|
...(options.timeout !== undefined ? { timeout: options.timeout } : {}),
|
|
205
217
|
protocolVersion: protocolVersionOf(config),
|
|
218
|
+
httpSettings: (remoteUrl) =>
|
|
219
|
+
httpClientSettingsOf(config, remoteUrl, environment, { compatibility }),
|
|
206
220
|
},
|
|
207
221
|
async (connection) => {
|
|
208
222
|
try {
|
|
@@ -213,6 +227,8 @@ export function createPromisorFetcher(
|
|
|
213
227
|
url: anonymizeUrl(url),
|
|
214
228
|
compatibility,
|
|
215
229
|
...(fsck ? { fsckObjects: fsck } : {}),
|
|
230
|
+
// the child fetch's fetch.unpackLimit: whether fetch-pack keeps the pack itself
|
|
231
|
+
...(unpackLimit !== undefined ? { unpackLimit } : {}),
|
|
216
232
|
});
|
|
217
233
|
} catch (error) {
|
|
218
234
|
// fetch-pack ran: its start-up warnings came first
|
|
@@ -268,8 +284,15 @@ export function createPromisorFetcher(
|
|
|
268
284
|
fetchIfMissing: () => !noLazyFetch(),
|
|
269
285
|
async fetch(ids) {
|
|
270
286
|
let remaining = [...ids];
|
|
271
|
-
// try_promisor_remotes: the first remote whose fetch succeeds ends it
|
|
272
|
-
|
|
287
|
+
// try_promisor_remotes: the first remote whose fetch succeeds ends it, the remotes a
|
|
288
|
+
// server's promisor-remote capability made us accept first
|
|
289
|
+
const all = promisorRemotes(store());
|
|
290
|
+
const acceptedNames = acceptedPromisorRemotes(workingCopy);
|
|
291
|
+
const ordered = [
|
|
292
|
+
...all.filter((r) => acceptedNames.has(r.name)),
|
|
293
|
+
...all.filter((r) => !acceptedNames.has(r.name)),
|
|
294
|
+
];
|
|
295
|
+
for (const remote of ordered) {
|
|
273
296
|
if (await fetchFrom(remote, remaining)) return [];
|
|
274
297
|
if (remaining.length === 1) continue;
|
|
275
298
|
// remove_fetched_oids: what a failed fetch brought all the same
|
|
@@ -805,6 +805,8 @@ export class PullCommand extends GuardedTransportCommand<PullResult> {
|
|
|
805
805
|
// the guarded transports: credentials and headers only where this pull's rule allows
|
|
806
806
|
update.setTransports(this.getTransports());
|
|
807
807
|
if (this.timeout !== undefined) update.setTimeout(this.timeout);
|
|
808
|
+
if (this.credentialHelper) update.setCredentialHelper(this.credentialHelper);
|
|
809
|
+
if (this.warningCallback) update.setWarningCallback(this.warningCallback);
|
|
808
810
|
try {
|
|
809
811
|
return await update.call();
|
|
810
812
|
} catch (error) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isValidRefName, parseCoreAbbrev } from "@statewalker/vcs-core";
|
|
2
2
|
import {
|
|
3
|
+
anonymizeUrl,
|
|
3
4
|
countRefspecMatch,
|
|
4
5
|
createRepositoryFacade,
|
|
5
6
|
createTransportRefStore,
|
|
@@ -11,6 +12,7 @@ import {
|
|
|
11
12
|
ObjectFormatMismatchError,
|
|
12
13
|
objectSource,
|
|
13
14
|
PushCertificateError,
|
|
15
|
+
type PushCertSigner,
|
|
14
16
|
type PushClientResult,
|
|
15
17
|
type PushCommandResult,
|
|
16
18
|
PushRefspecError,
|
|
@@ -38,10 +40,17 @@ import { RemoteConfigStore } from "../remote-config/index.js";
|
|
|
38
40
|
import { type PushResult, PushStatus, type RemoteRefUpdate } from "../results/push-result.js";
|
|
39
41
|
import { TransportCommand } from "../transport-command.js";
|
|
40
42
|
import { endOfSymbolicChain, installTracking, pushTrackingPlan } from "./branch-tracking.js";
|
|
41
|
-
import {
|
|
43
|
+
import { FetchCommand } from "./fetch-command.js";
|
|
44
|
+
import { committerIdentOf, hostEnvironmentOf, localTimezoneOffset } from "./git-ident.js";
|
|
42
45
|
import { remoteHookSession } from "./local-transport.js";
|
|
43
46
|
import { withRemoteReceivePack } from "./remote-transport.js";
|
|
44
|
-
import {
|
|
47
|
+
import { clientSessionIdOf } from "./session-id.js";
|
|
48
|
+
import {
|
|
49
|
+
SIGNING_FAILED_LINES,
|
|
50
|
+
SigningFailedError,
|
|
51
|
+
signingKeyIdOf,
|
|
52
|
+
signPayload,
|
|
53
|
+
} from "./signing.js";
|
|
45
54
|
import {
|
|
46
55
|
createSubmoduleAuthPolicy,
|
|
47
56
|
guardSubmoduleTransports,
|
|
@@ -424,8 +433,9 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
424
433
|
* certificate; undefined (the default) leaves it to `push.gpgSign` (a boolean or
|
|
425
434
|
* `if-asked`). A server that takes no certificate refuses a signed push (`fatal: the
|
|
426
435
|
* receiving end does not support --signed push`) and gets an `if-asked` one unsigned,
|
|
427
|
-
* with git's warning ({@link PushResult.warnings}).
|
|
428
|
-
*
|
|
436
|
+
* with git's warning ({@link PushResult.warnings}). The certificate is signed through the
|
|
437
|
+
* host's signer as `commit -S` signs (`gpg.format`, `user.signingKey`); without a signer, or
|
|
438
|
+
* when it fails, the push dies as git does when gpg cannot sign (`error: gpg failed to sign
|
|
429
439
|
* the data:`, `fatal: failed to sign the push certificate`, exit 128:
|
|
430
440
|
* {@link SigningFailedError}), before anything is sent.
|
|
431
441
|
*/
|
|
@@ -450,6 +460,43 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
450
460
|
return value === true ? "always" : value === "if-asked" ? "if-asked" : undefined;
|
|
451
461
|
}
|
|
452
462
|
|
|
463
|
+
/**
|
|
464
|
+
* send-pack's `generate_push_cert` through the host's signer (`sign_buffer` with the default
|
|
465
|
+
* key, as `push --signed` signs): the pusher is `get_signing_key_id()`, the date now in the
|
|
466
|
+
* local zone (git's `datestamp`: never `GIT_COMMITTER_DATE`), the pushee the URL without its
|
|
467
|
+
* credentials. A failed signing dies as git: gpg's lines, `fatal: failed to sign the push
|
|
468
|
+
* certificate`, exit 128.
|
|
469
|
+
*/
|
|
470
|
+
private pushCertSigner(remoteUrl: string): PushCertSigner {
|
|
471
|
+
const committer = () => committerIdentOf(this.workingCopy);
|
|
472
|
+
return {
|
|
473
|
+
pusher: () => signingKeyIdOf(this.workingCopy, "", committer()),
|
|
474
|
+
pushee: anonymizeUrl(remoteUrl),
|
|
475
|
+
date: () => {
|
|
476
|
+
const timestamp = Math.floor(Date.now() / 1000);
|
|
477
|
+
return { timestamp, tzOffset: localTimezoneOffset(timestamp) };
|
|
478
|
+
},
|
|
479
|
+
sign: async (payload) => {
|
|
480
|
+
const cwd = await this.hooks.hostWorkingDirectory().catch(() => undefined);
|
|
481
|
+
try {
|
|
482
|
+
return await signPayload(this.workingCopy, "", payload, {
|
|
483
|
+
committer: committer(),
|
|
484
|
+
...(cwd !== undefined ? { cwd } : {}),
|
|
485
|
+
tail: ["fatal: failed to sign the push certificate"],
|
|
486
|
+
});
|
|
487
|
+
} catch (error) {
|
|
488
|
+
if (!(error instanceof SigningFailedError) || error.exitCode !== undefined) throw error;
|
|
489
|
+
throw new SigningFailedError(error.message, error.signingKey, 128, {
|
|
490
|
+
...(error.signerMessages ? { signerMessages: error.signerMessages } : {}),
|
|
491
|
+
...(error.programExitCode !== undefined
|
|
492
|
+
? { programExitCode: error.programExitCode }
|
|
493
|
+
: {}),
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
|
|
453
500
|
/**
|
|
454
501
|
* Whether atomic push is enabled.
|
|
455
502
|
*/
|
|
@@ -728,7 +775,9 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
728
775
|
const recurseOnPush =
|
|
729
776
|
recurse !== undefined && new SubmoduleFetchRepository(this.workingCopy).hasWorktree();
|
|
730
777
|
const submoduleOutput = { text: submoduleWarnings.map((w) => `${w}\n`).join("") };
|
|
778
|
+
const sessionId = clientSessionIdOf(this.workingCopy);
|
|
731
779
|
const pushOptions: TransportPushOptions = {
|
|
780
|
+
...(sessionId !== undefined ? { sessionId } : {}),
|
|
732
781
|
url: remoteUrl,
|
|
733
782
|
auth: this.credentials,
|
|
734
783
|
headers: this.headers,
|
|
@@ -738,7 +787,9 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
738
787
|
refspecs,
|
|
739
788
|
force: this.force || mirror,
|
|
740
789
|
atomic: this.atomic,
|
|
741
|
-
...(this.pushCertMode()
|
|
790
|
+
...(this.pushCertMode()
|
|
791
|
+
? { signed: this.pushCertMode(), pushCertSigner: this.pushCertSigner(remoteUrl) }
|
|
792
|
+
: {}),
|
|
742
793
|
thin: this.thin,
|
|
743
794
|
dryRun: this.dryRun,
|
|
744
795
|
prune: this.prune,
|
|
@@ -757,6 +808,10 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
757
808
|
}
|
|
758
809
|
: {}),
|
|
759
810
|
followTags: this.followTags ?? this.configBool("push.followTags") ?? false,
|
|
811
|
+
// push.negotiate: send-pack's child `git fetch --negotiate-only` to the same URL
|
|
812
|
+
...(this.configBool("push.negotiate")
|
|
813
|
+
? { negotiate: (tips: readonly string[]) => this.negotiateCommons(remoteUrl, tips) }
|
|
814
|
+
: {}),
|
|
760
815
|
onProgress: (message) => {
|
|
761
816
|
messages.push(message);
|
|
762
817
|
this.progressMessageCallback?.(message);
|
|
@@ -992,6 +1047,7 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
992
1047
|
return {
|
|
993
1048
|
uri: remoteUrl,
|
|
994
1049
|
remoteUpdates,
|
|
1050
|
+
...(result.serverSessionId !== undefined ? { serverSessionId: result.serverSessionId } : {}),
|
|
995
1051
|
bytesSent: result.bytesSent,
|
|
996
1052
|
objectCount: result.packObjects,
|
|
997
1053
|
messages,
|
|
@@ -1150,6 +1206,8 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
1150
1206
|
// directory, its directory as cwd), their output relayed where the child prints it
|
|
1151
1207
|
child.setTransports(this.submoduleTransports());
|
|
1152
1208
|
if (this.timeout !== undefined) child.setTimeout(this.timeout);
|
|
1209
|
+
if (this.credentialHelper) child.setCredentialHelper(this.credentialHelper);
|
|
1210
|
+
if (this.warningCallback) child.setWarningCallback(this.warningCallback);
|
|
1153
1211
|
if (this.dryRun) child.setDryRun(true);
|
|
1154
1212
|
if (pushOptions.length > 0) child.setPushOptions([...pushOptions]);
|
|
1155
1213
|
if (configured) {
|
|
@@ -1300,6 +1358,30 @@ export class PushCommand extends TransportCommand<PushResult> {
|
|
|
1300
1358
|
return lines;
|
|
1301
1359
|
}
|
|
1302
1360
|
|
|
1361
|
+
/**
|
|
1362
|
+
* get_commons_through_negotiation: `git fetch --negotiate-only --negotiation-tip=<id>...
|
|
1363
|
+
* <url>` run as git's child, its acknowledged commits the commons; its warnings (stderr)
|
|
1364
|
+
* passed on, and no commons when it fails (git's "push negotiation failed").
|
|
1365
|
+
*/
|
|
1366
|
+
private async negotiateCommons(
|
|
1367
|
+
url: string,
|
|
1368
|
+
tips: readonly string[],
|
|
1369
|
+
): Promise<{ commons?: readonly string[]; warnings?: readonly string[] }> {
|
|
1370
|
+
const fetch = this.configureChild(new FetchCommand(this._workingCopy))
|
|
1371
|
+
.setRemote(url)
|
|
1372
|
+
.setNegotiationTips(...tips)
|
|
1373
|
+
.setNegotiateOnly(true);
|
|
1374
|
+
try {
|
|
1375
|
+
const result = await fetch.call();
|
|
1376
|
+
return {
|
|
1377
|
+
warnings: result.messages,
|
|
1378
|
+
...(result.exitCode ? {} : { commons: result.negotiatedCommits ?? [] }),
|
|
1379
|
+
};
|
|
1380
|
+
} catch (error) {
|
|
1381
|
+
return { warnings: [error instanceof Error ? error.message : String(error)] };
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1303
1385
|
/**
|
|
1304
1386
|
* remote.c's `is_reachable_in_reflog` for `--force-if-includes`: whether the remote's value
|
|
1305
1387
|
* (peeled to a commit) is the new value of an entry of the local ref's reflog (the local ref
|