@statewalker/vcs-commands 0.9.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.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 +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-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 +19 -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 +42 -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 +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-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 +44 -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 +22 -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 +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/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 +9 -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 +12 -0
- 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 +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 +2 -1
- 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 +9 -1
- package/dist/commands/submodule-commands.d.ts.map +1 -1
- package/dist/commands/submodule-update-command.d.ts +13 -1
- package/dist/commands/submodule-update-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-CNvli5bl.js → commands-Mlo1dxQN.js} +52078 -44471
- 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-CrhVMNIH.js} +184 -143
- package/dist/git-command.d.ts +58 -2
- 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-Bw21HEkH.js +13539 -0
- package/dist/{remote-transport-CCmBadm-.js → remote-transport-Bu4PGSMD.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-ERo9vELd.js} +28511 -25685
- package/dist/transport-command.d.ts +79 -1
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +12 -12
- 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 +163 -8
- 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 +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-ref-format-command.ts +129 -0
- package/src/commands/checkout-command.ts +39 -21
- 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 +208 -7
- 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 +99 -1
- package/src/commands/diff-command.ts +573 -46
- 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 +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-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 +45 -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 +55 -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 +684 -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 +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/rev-filter/commit-grep.ts +7 -2
- package/src/commands/rev-list-command.ts +9 -0
- package/src/commands/rev-parse-command.ts +62 -4
- package/src/commands/revert-command.ts +21 -1
- package/src/commands/revision-range.ts +7 -2
- package/src/commands/revision-resolver.ts +44 -3
- 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 +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 +43 -6
- 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 +12 -2
- package/src/commands/submodule-update-command.ts +29 -0
- 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 +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/errors/command-errors.ts +45 -0
- package/src/git-command.ts +131 -1
- 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,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Git LFS endpoint of an operation and remote, as git-lfs resolves it (see
|
|
3
|
+
* {@link LfsConfig}), with the credentials and headers the caller may send there.
|
|
4
|
+
*
|
|
5
|
+
* `.lfsconfig` is repository content: whoever writes the repository chooses its `lfs.url`.
|
|
6
|
+
* So static credentials and headers ({@link LfsEndpointCommand.setCredentials},
|
|
7
|
+
* {@link LfsEndpointCommand.setHeaders}) go to the endpoint only when its origin is one named
|
|
8
|
+
* with {@link LfsEndpointCommand.addCredentialOrigin}, or, with none named, the origin of the
|
|
9
|
+
* endpoint the user's own configuration gives (the same resolution without `.lfsconfig`):
|
|
10
|
+
* a `.lfsconfig` pointing the endpoint at another host gets none. Per-URL providers
|
|
11
|
+
* ({@link LfsEndpointCommand.setCredentialsForUrl}) are asked with the endpoint's URL and
|
|
12
|
+
* answer for its origin alone, as a credential helper does.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const ep = await git.lfsEndpoint().setOperation("upload")
|
|
17
|
+
* .setCredentials({ username: "u", password: "p" }).call();
|
|
18
|
+
* await lfsUpload(ep.url, store, objects, resolver, { ...ep.auth });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { Credentials } from "@statewalker/vcs-transport";
|
|
23
|
+
|
|
24
|
+
import { GitApiError } from "../../errors/index.js";
|
|
25
|
+
import { GitCommand } from "../../git-command.js";
|
|
26
|
+
import {
|
|
27
|
+
type CredentialsForUrl,
|
|
28
|
+
createSubmoduleAuthPolicy,
|
|
29
|
+
type HeadersForUrl,
|
|
30
|
+
strictUrlOrigin,
|
|
31
|
+
} from "../submodule-auth.js";
|
|
32
|
+
import { LfsConfig, type LfsEndpoint, type LfsEndpointOperation } from "./lfs-config.js";
|
|
33
|
+
|
|
34
|
+
/** What {@link LfsEndpointCommand.call} answers. */
|
|
35
|
+
export interface LfsEndpointResult extends LfsEndpoint {
|
|
36
|
+
/**
|
|
37
|
+
* What to send to the endpoint (structurally `LfsTransferOptions`' `credentials` and
|
|
38
|
+
* `headers`): empty when the policy gives the endpoint's origin nothing
|
|
39
|
+
*/
|
|
40
|
+
auth: { credentials?: { username: string; password: string }; headers?: Record<string, string> };
|
|
41
|
+
/** The endpoint's origin is one the static credentials are for */
|
|
42
|
+
trusted: boolean;
|
|
43
|
+
/** What git-lfs prints reading the configuration (ignored `.lfsconfig` keys) */
|
|
44
|
+
warnings: string[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** `git lfs env`'s endpoint for an operation and remote, with the credential policy applied. */
|
|
48
|
+
export class LfsEndpointCommand extends GitCommand<LfsEndpointResult> {
|
|
49
|
+
private operation: LfsEndpointOperation = "download";
|
|
50
|
+
private remote?: string;
|
|
51
|
+
private credentials?: Credentials;
|
|
52
|
+
private headers?: Record<string, string>;
|
|
53
|
+
private credentialOrigins: string[] = [];
|
|
54
|
+
private credentialsFor?: CredentialsForUrl;
|
|
55
|
+
private headersFor?: HeadersForUrl;
|
|
56
|
+
private compatibility?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The git-lfs version to follow (default `LFS_DEFAULT_COMPATIBILITY`, see
|
|
60
|
+
* `LfsConfigLoadOptions.compatibility`).
|
|
61
|
+
*/
|
|
62
|
+
setCompatibility(version: string): this {
|
|
63
|
+
this.checkCallable();
|
|
64
|
+
this.compatibility = version;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** `download` (default) or `upload` (`lfs.pushurl`, `lfspushurl`, `pushurl`, `pushInsteadOf`). */
|
|
69
|
+
setOperation(operation: LfsEndpointOperation): this {
|
|
70
|
+
this.checkCallable();
|
|
71
|
+
this.operation = operation;
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The remote; default git-lfs's: `branch.<name>.remote`, `remote.lfsdefault`, the only
|
|
77
|
+
* remote, `origin` (for uploads `branch.<name>.pushRemote`, `remote.lfspushdefault`,
|
|
78
|
+
* `remote.pushDefault` first). A URL may stand for a remote.
|
|
79
|
+
*/
|
|
80
|
+
setRemote(remote: string): this {
|
|
81
|
+
this.checkCallable();
|
|
82
|
+
this.remote = remote;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Credentials for the trusted origins only (see the module notes). */
|
|
87
|
+
setCredentials(credentials: Credentials): this {
|
|
88
|
+
this.checkCallable();
|
|
89
|
+
this.credentials = credentials;
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** HTTP headers for the trusted origins only (see the module notes). */
|
|
94
|
+
setHeaders(headers: Record<string, string>): this {
|
|
95
|
+
this.checkCallable();
|
|
96
|
+
this.headers = headers;
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* An origin the static credentials and headers are for; once one is named, the origin of
|
|
102
|
+
* the user's own endpoint is no longer trusted by default.
|
|
103
|
+
*
|
|
104
|
+
* @throws GitApiError for a URL without an origin (a path, `file:`)
|
|
105
|
+
*/
|
|
106
|
+
addCredentialOrigin(url: string): this {
|
|
107
|
+
this.checkCallable();
|
|
108
|
+
const origin = strictUrlOrigin(url);
|
|
109
|
+
if (origin === undefined) {
|
|
110
|
+
throw new GitApiError(`fatal: '${url}' names no origin (scheme and host) for credentials`);
|
|
111
|
+
}
|
|
112
|
+
this.credentialOrigins.push(origin);
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Asked with the endpoint's URL: its credentials, or undefined for the static rule. */
|
|
117
|
+
setCredentialsForUrl(provider: CredentialsForUrl): this {
|
|
118
|
+
this.checkCallable();
|
|
119
|
+
this.credentialsFor = provider;
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Asked with the endpoint's URL: its headers, or undefined for the static rule. */
|
|
124
|
+
setHeadersForUrl(provider: HeadersForUrl): this {
|
|
125
|
+
this.checkCallable();
|
|
126
|
+
this.headersFor = provider;
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async call(): Promise<LfsEndpointResult> {
|
|
131
|
+
this.checkCallable();
|
|
132
|
+
this.setCallable(false);
|
|
133
|
+
const compat = this.compatibility !== undefined ? { compatibility: this.compatibility } : {};
|
|
134
|
+
const lfs = await LfsConfig.load(this._workingCopy, compat);
|
|
135
|
+
const choice =
|
|
136
|
+
this.remote !== undefined
|
|
137
|
+
? { name: this.remote, fromLfsconfig: false }
|
|
138
|
+
: lfs.remoteChoice(this.operation);
|
|
139
|
+
const remote = choice.name;
|
|
140
|
+
const endpoint = await lfs.endpoint(this.operation, remote);
|
|
141
|
+
if (choice.fromLfsconfig) endpoint.fromLfsconfig = true;
|
|
142
|
+
let origins = this.credentialOrigins;
|
|
143
|
+
if (origins.length === 0 && (this.credentials || this.headers)) {
|
|
144
|
+
// the user's own endpoint: `.lfsconfig` left out entirely, its remote choice too (it may
|
|
145
|
+
// name a URL as the default remote, or turn `git://` into `http://`)
|
|
146
|
+
const mine = await LfsConfig.load(this._workingCopy, { ...compat, withoutLfsconfig: true });
|
|
147
|
+
const own = await mine.endpoint(
|
|
148
|
+
this.operation,
|
|
149
|
+
this.remote ?? mine.remoteChoice(this.operation).name,
|
|
150
|
+
);
|
|
151
|
+
// FETCH_HEAD is no configuration: it names whatever was fetched last (`git pull <url>`)
|
|
152
|
+
const origin = own.url && own.source !== "fetch-head" ? strictUrlOrigin(own.url) : undefined;
|
|
153
|
+
origins = origin !== undefined ? [origin] : [];
|
|
154
|
+
}
|
|
155
|
+
const policy = createSubmoduleAuthPolicy({
|
|
156
|
+
...(this.credentials ? { credentials: this.credentials } : {}),
|
|
157
|
+
...(this.headers ? { headers: this.headers } : {}),
|
|
158
|
+
origins,
|
|
159
|
+
...(this.credentialsFor ? { credentialsFor: this.credentialsFor } : {}),
|
|
160
|
+
...(this.headersFor ? { headersFor: this.headersFor } : {}),
|
|
161
|
+
});
|
|
162
|
+
const given = endpoint.url ? policy(endpoint.url) : {};
|
|
163
|
+
const auth: LfsEndpointResult["auth"] = {};
|
|
164
|
+
if (given.credentials) {
|
|
165
|
+
const { username, password, token } = given.credentials;
|
|
166
|
+
auth.credentials = {
|
|
167
|
+
username: username ?? (token !== undefined ? "x-access-token" : ""),
|
|
168
|
+
password: password ?? token ?? "",
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
if (given.headers) auth.headers = given.headers;
|
|
172
|
+
const origin = endpoint.url ? strictUrlOrigin(endpoint.url) : undefined;
|
|
173
|
+
return {
|
|
174
|
+
...endpoint,
|
|
175
|
+
auth,
|
|
176
|
+
trusted: origin !== undefined && origins.includes(origin),
|
|
177
|
+
warnings: [...lfs.warnings],
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { historyWithoutLazyFetch, type RefTransactionHook } from "@statewalker/vcs-core";
|
|
9
|
-
import { configFilesApiOf, readConfinedFile } from "@statewalker/vcs-store-files";
|
|
9
|
+
import { configFilesApiOf, readConfinedFile, updateServerInfo } from "@statewalker/vcs-store-files";
|
|
10
10
|
import {
|
|
11
11
|
createRepositoryFacade,
|
|
12
12
|
createTransportRefStore,
|
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
type GitServeSettings,
|
|
15
15
|
openDuplexConnection,
|
|
16
16
|
openDuplexReceivePackConnection,
|
|
17
|
+
type PushCertSignatureCheck,
|
|
18
|
+
pushCertificateEnv,
|
|
17
19
|
type ReceiveCommand,
|
|
20
|
+
type ReceivePackConfig,
|
|
18
21
|
type ReceivePackConnection,
|
|
19
22
|
ReceivePackDiedError,
|
|
20
23
|
type ReceivePackHookContext,
|
|
@@ -37,6 +40,7 @@ import {
|
|
|
37
40
|
import { GitApiError, TransportError } from "../errors/index.js";
|
|
38
41
|
import { quoteCStyleBody } from "../results/index.js";
|
|
39
42
|
import { type ReceiveFsckSettings, receiveFsckOf } from "./fsck/index.js";
|
|
43
|
+
import { GarbageCollectCommand } from "./gc-command.js";
|
|
40
44
|
import {
|
|
41
45
|
HookSession,
|
|
42
46
|
hookHostOf,
|
|
@@ -45,8 +49,15 @@ import {
|
|
|
45
49
|
refTransactionHookOf,
|
|
46
50
|
} from "./git-hooks.js";
|
|
47
51
|
import { ReadTreeCommand } from "./read-tree-command.js";
|
|
52
|
+
import { checkSignatureWith } from "./signature-check.js";
|
|
53
|
+
import { signingConfigFromEntries } from "./signing.js";
|
|
48
54
|
import { StatusCommand } from "./status-command.js";
|
|
49
|
-
import {
|
|
55
|
+
import {
|
|
56
|
+
repositoryPlaceOf,
|
|
57
|
+
usesBranch,
|
|
58
|
+
worktreeAdminWorkingCopy,
|
|
59
|
+
worktreeUsingBranch,
|
|
60
|
+
} from "./worktree-support.js";
|
|
50
61
|
|
|
51
62
|
/** The client's lines when the remote end of a local transport died. */
|
|
52
63
|
const COULD_NOT_READ =
|
|
@@ -171,6 +182,24 @@ export async function withLocalUploadPack<T>(
|
|
|
171
182
|
uploadPackHideRefs: settings.uploadPackHideRefs,
|
|
172
183
|
// uploadpack.allowFilter and uploadpackfilter.*
|
|
173
184
|
...(settings.uploadPackFilter ? { uploadPackFilter: settings.uploadPackFilter } : {}),
|
|
185
|
+
// uploadpack.allow*SHA1InWant (v0), uploadpack.allowRefInWant, transfer.advertiseSID
|
|
186
|
+
...(settings.uploadPackRequestPolicy
|
|
187
|
+
? { uploadPackRequestPolicy: settings.uploadPackRequestPolicy }
|
|
188
|
+
: {}),
|
|
189
|
+
...(settings.allowRefInWant ? { allowRefInWant: true } : {}),
|
|
190
|
+
// uploadpack.allowSidebandAll
|
|
191
|
+
...(settings.allowSidebandAll ? { allowSidebandAll: true } : {}),
|
|
192
|
+
// uploadpack.blobPackfileUri
|
|
193
|
+
...(settings.blobPackfileUris?.length ? { blobPackfileUris: settings.blobPackfileUris } : {}),
|
|
194
|
+
// uploadpack.advertiseBundleURIs and bundle.*
|
|
195
|
+
...(settings.bundleUris !== undefined ? { bundleUris: settings.bundleUris } : {}),
|
|
196
|
+
...(settings.advertiseSID ? { advertiseSID: true } : {}),
|
|
197
|
+
// transfer.advertiseObjectInfo: v2 object-info
|
|
198
|
+
...(settings.advertiseObjectInfo ? { advertiseObjectInfo: true } : {}),
|
|
199
|
+
// promisor.advertise (with promisor.sendFields)
|
|
200
|
+
...(settings.promisorRemoteInfo !== undefined
|
|
201
|
+
? { promisorRemoteInfo: settings.promisorRemoteInfo }
|
|
202
|
+
: {}),
|
|
174
203
|
...(head && "target" in head ? { currentBranch: head.target } : {}),
|
|
175
204
|
}))().finally(() => server.close?.());
|
|
176
205
|
try {
|
|
@@ -245,6 +274,48 @@ export function servedMaxTreeDepth(remote: OpenedRepository): number | undefined
|
|
|
245
274
|
return parseGitInt(value);
|
|
246
275
|
}
|
|
247
276
|
|
|
277
|
+
/**
|
|
278
|
+
* receive-pack's check of a push certificate's signature (`prepare_push_cert_sha1`'s
|
|
279
|
+
* `check_signature`): the served repository's `gpg.*`, the host's verifier (none: git's result
|
|
280
|
+
* when its program cannot run). A signature of no known format dies as git dies.
|
|
281
|
+
*/
|
|
282
|
+
function pushCertVerifierOf(
|
|
283
|
+
remote: OpenedRepository,
|
|
284
|
+
hooks: HookSession | undefined,
|
|
285
|
+
): (payload: Uint8Array, signature: Uint8Array) => Promise<PushCertSignatureCheck> {
|
|
286
|
+
return async (payload, signature) => {
|
|
287
|
+
const environment = hooks?.hostEnvironment;
|
|
288
|
+
const entries = () =>
|
|
289
|
+
(
|
|
290
|
+
(remote.config?.listWithOrigin?.() ?? remote.config?.list() ?? []) as Array<{
|
|
291
|
+
key: string;
|
|
292
|
+
value: string | null;
|
|
293
|
+
file?: string;
|
|
294
|
+
line?: number;
|
|
295
|
+
}>
|
|
296
|
+
).map((e) => ({
|
|
297
|
+
key: e.key.toLowerCase(),
|
|
298
|
+
text: e.value ?? undefined,
|
|
299
|
+
...(e.file !== undefined ? { file: e.file } : {}),
|
|
300
|
+
...(e.line !== undefined ? { line: e.line } : {}),
|
|
301
|
+
}));
|
|
302
|
+
// receive-pack runs its gpg / ssh-keygen in the git directory
|
|
303
|
+
const cwd = await hooks?.hostGitDir().catch(() => undefined);
|
|
304
|
+
const check = await checkSignatureWith(
|
|
305
|
+
() => signingConfigFromEntries(entries(), environment),
|
|
306
|
+
environment?.verifier,
|
|
307
|
+
payload,
|
|
308
|
+
signature,
|
|
309
|
+
{ payloadType: "push-cert", ...(cwd !== undefined ? { cwd } : {}) },
|
|
310
|
+
);
|
|
311
|
+
return {
|
|
312
|
+
result: check.result,
|
|
313
|
+
...(check.signer !== undefined ? { signer: check.signer } : {}),
|
|
314
|
+
...(check.key !== undefined ? { key: check.key } : {}),
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
|
|
248
319
|
/** What git's upload-pack and receive-pack read from the served repository's config. */
|
|
249
320
|
function serverSettingsOf(remote: OpenedRepository): ServerConfigSettings {
|
|
250
321
|
const config = remote.config;
|
|
@@ -532,6 +603,22 @@ export async function receivePackSettingsOf(
|
|
|
532
603
|
shallowUpdate: settings.shallowUpdate,
|
|
533
604
|
// receive.advertisePushOptions (git's default false)
|
|
534
605
|
advertisePushOptions: settings.advertisePushOptions,
|
|
606
|
+
// transfer.advertiseSID
|
|
607
|
+
...(settings.advertiseSID ? { advertiseSID: true } : {}),
|
|
608
|
+
// receive.advertiseAtomic, receive.maxInputSize, receive.keepAlive
|
|
609
|
+
...(settings.advertiseAtomic !== undefined
|
|
610
|
+
? { advertiseAtomic: settings.advertiseAtomic }
|
|
611
|
+
: {}),
|
|
612
|
+
...(settings.maxInputSize !== undefined ? { maxInputSize: settings.maxInputSize } : {}),
|
|
613
|
+
// receive.certNonceSeed, receive.certNonceSlop: signed pushes, their signature checked with
|
|
614
|
+
// the repository's gpg.* through the host's verifier
|
|
615
|
+
...(settings.certNonceSeed !== undefined ? { certNonceSeed: settings.certNonceSeed } : {}),
|
|
616
|
+
...(settings.certNonceSlop !== undefined ? { certNonceSlop: settings.certNonceSlop } : {}),
|
|
617
|
+
pushCertificates: { verify: pushCertVerifierOf(remote, hooks) },
|
|
618
|
+
...(settings.unpackLimit !== undefined ? { unpackLimit: settings.unpackLimit } : {}),
|
|
619
|
+
...(settings.receiveKeepAliveMs !== undefined
|
|
620
|
+
? { receiveKeepAliveMs: settings.receiveKeepAliveMs }
|
|
621
|
+
: {}),
|
|
535
622
|
uploadPackHideRefs: settings.uploadPackHideRefs,
|
|
536
623
|
receivePackHideRefs: settings.receivePackHideRefs,
|
|
537
624
|
...(receiveHooks ? { hooks: receiveHooks, relayPostReceive: true } : {}),
|
|
@@ -549,6 +636,8 @@ export async function receivePackSettingsOf(
|
|
|
549
636
|
// ... git 2.43 updates each ref after its update hook
|
|
550
637
|
...(hooks?.enabled && hooks.compatibility === "2.43" ? { interleaveUpdateHook: true } : {}),
|
|
551
638
|
...(checkedOut ? { checkedOutBranches: checkedOut } : {}),
|
|
639
|
+
// receive.autogc and receive.updateServerInfo, once the push is done
|
|
640
|
+
...afterPushOf(remote, hooks),
|
|
552
641
|
...(worktrees
|
|
553
642
|
? {
|
|
554
643
|
updateWorktree: async (ref: string, newOid: string, ctx?: ReceivePackHookContext) => {
|
|
@@ -560,6 +649,113 @@ export async function receivePackSettingsOf(
|
|
|
560
649
|
};
|
|
561
650
|
}
|
|
562
651
|
|
|
652
|
+
/** git's `git_config_bool` of the last value of `key` in `remote`'s config, else `fallback`. */
|
|
653
|
+
function remoteBool(remote: OpenedRepository, key: string, fallback: boolean): boolean {
|
|
654
|
+
const value = remote.config?.getAll(key).at(-1);
|
|
655
|
+
if (value === undefined) return fallback;
|
|
656
|
+
if (value === null) return true;
|
|
657
|
+
return parseGitBool(value) ?? fallback;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* run-command.c's `prepare_auto_maintenance`: whether git runs `maintenance run --auto` after a
|
|
662
|
+
* command (`maintenance.auto`, else `gc.auto` greater than 0, else yes).
|
|
663
|
+
*/
|
|
664
|
+
function autoMaintenanceEnabled(remote: OpenedRepository): boolean {
|
|
665
|
+
const auto = remote.config?.getAll("maintenance.auto").at(-1);
|
|
666
|
+
if (auto !== undefined) return auto === null ? true : (parseGitBool(auto) ?? true);
|
|
667
|
+
const gcAuto = remote.config?.getAll("gc.auto").at(-1);
|
|
668
|
+
if (gcAuto !== undefined && gcAuto !== null) {
|
|
669
|
+
const n = parseGitInt(gcAuto);
|
|
670
|
+
if (n !== undefined) return n > 0;
|
|
671
|
+
}
|
|
672
|
+
return true;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* What git's receive-pack does once a push is done (`ReceivePackConfig.afterPush`), after
|
|
677
|
+
* post-receive and post-update: `receive.autogc` (default true) runs the auto maintenance:
|
|
678
|
+
* git 2.5x's `maintenance run --auto --quiet` when `prepare_auto_maintenance` allows it
|
|
679
|
+
* (`maintenance.auto`, else `gc.auto` above 0), with the maintenance strategy and each task's
|
|
680
|
+
* condition (`MaintenanceRunCommand`), git 2.43's `gc --auto --quiet` (the receive side's
|
|
681
|
+
* hook runner tells the version); `receive.updateServerInfo` (default false)
|
|
682
|
+
* `update-server-info`. Nothing when neither applies.
|
|
683
|
+
*/
|
|
684
|
+
function afterPushOf(
|
|
685
|
+
remote: OpenedRepository,
|
|
686
|
+
hooks: HookSession | undefined,
|
|
687
|
+
): { afterPush?: ReceivePackConfig["afterPush"] } {
|
|
688
|
+
const v243 = hooks?.compatibility === "2.43";
|
|
689
|
+
const autoGc =
|
|
690
|
+
remoteBool(remote, "receive.autogc", true) &&
|
|
691
|
+
(v243 || autoMaintenanceEnabled(remote)) &&
|
|
692
|
+
remote.worktrees !== undefined &&
|
|
693
|
+
remote.history.packs !== undefined;
|
|
694
|
+
const serverInfo =
|
|
695
|
+
remoteBool(remote, "receive.updateServerInfo", false) &&
|
|
696
|
+
remote.files !== undefined &&
|
|
697
|
+
remote.history.objects !== undefined &&
|
|
698
|
+
remote.history.packs !== undefined;
|
|
699
|
+
if (!autoGc && !serverInfo) return {};
|
|
700
|
+
return {
|
|
701
|
+
afterPush: async (ctx: ReceivePackHookContext) => {
|
|
702
|
+
if (autoGc && remote.worktrees) {
|
|
703
|
+
const admin = await remote.worktrees.openAdmin();
|
|
704
|
+
// receive-pack's environment (its hook runner: pre-auto-gc, the git version followed)
|
|
705
|
+
const workingCopy = withEnvironment(
|
|
706
|
+
worktreeAdminWorkingCopy(admin),
|
|
707
|
+
hooks?.hostEnvironment,
|
|
708
|
+
);
|
|
709
|
+
// the child's stderr reaches the pusher on the side-band
|
|
710
|
+
let lines: string[];
|
|
711
|
+
if (v243) {
|
|
712
|
+
const result = await new GarbageCollectCommand(workingCopy)
|
|
713
|
+
.setAuto(true)
|
|
714
|
+
.setQuiet(true)
|
|
715
|
+
.call();
|
|
716
|
+
lines = [...(result.errors ?? []), ...(result.warnings ?? [])];
|
|
717
|
+
} else {
|
|
718
|
+
// loaded lazily: maintenance-run-command reaches this module again (through fetch)
|
|
719
|
+
const { MaintenanceRunCommand } = await import("./maintenance-run-command.js");
|
|
720
|
+
const result = await new MaintenanceRunCommand(workingCopy)
|
|
721
|
+
.setAuto(true)
|
|
722
|
+
.setQuiet(true)
|
|
723
|
+
.call();
|
|
724
|
+
lines = result.stderr.split("\n").filter((l) => l.length > 0);
|
|
725
|
+
}
|
|
726
|
+
if (lines.length > 0) await ctx.message(`${lines.join("\n")}\n`);
|
|
727
|
+
}
|
|
728
|
+
const { files } = remote;
|
|
729
|
+
const { objects, packs } = remote.history;
|
|
730
|
+
if (serverInfo && files && objects && packs) {
|
|
731
|
+
const gitDir = (remote.commonDir ?? remote.gitDir).replace(/^\/+/, "").replace(/\/+$/, "");
|
|
732
|
+
await updateServerInfo({ files, gitDir, objects, packs });
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* `workingCopy` whose configuration answers `environment` (see `hostEnvironmentOf`) with
|
|
740
|
+
* `environment`; itself without one.
|
|
741
|
+
*/
|
|
742
|
+
function withEnvironment(
|
|
743
|
+
workingCopy: WorkingCopy,
|
|
744
|
+
environment: GitHostEnvironment | undefined,
|
|
745
|
+
): WorkingCopy {
|
|
746
|
+
if (!environment) return workingCopy;
|
|
747
|
+
const own = <T extends object>(target: T, key: string | symbol): unknown => {
|
|
748
|
+
const value = Reflect.get(target, key, target);
|
|
749
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
750
|
+
};
|
|
751
|
+
const config = new Proxy(workingCopy.config, {
|
|
752
|
+
get: (target, key) => (key === "environment" ? environment : own(target, key)),
|
|
753
|
+
});
|
|
754
|
+
return new Proxy(workingCopy, {
|
|
755
|
+
get: (target, key) => (key === "config" ? config : own(target, key)),
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
|
|
563
759
|
async function receiveOver<T>(
|
|
564
760
|
remote: OpenedRepository,
|
|
565
761
|
run: (connection: ReceivePackConnection) => Promise<T>,
|
|
@@ -805,6 +1001,22 @@ function scriptReceiveHooks(hooks: HookSession): ReceivePackHooks {
|
|
|
805
1001
|
});
|
|
806
1002
|
return env;
|
|
807
1003
|
};
|
|
1004
|
+
// prepare_push_cert_sha1: the push certificate's variables for pre-receive, post-receive and
|
|
1005
|
+
// proc-receive (never update), computed when the first of them exists
|
|
1006
|
+
const certEnv = async (name: string, ctx: ReceivePackHookContext) => {
|
|
1007
|
+
if (!ctx.pushCertificate) return {};
|
|
1008
|
+
try {
|
|
1009
|
+
if (!(await hooks.exists(name))) return {};
|
|
1010
|
+
return pushCertificateEnv(await ctx.pushCertificate());
|
|
1011
|
+
} catch (error) {
|
|
1012
|
+
// receive-pack dies: a broken hook.* configuration found looking the hook up, or
|
|
1013
|
+
// check_signature on a signature of no known format (none at all)
|
|
1014
|
+
if (error instanceof GitApiError && error.message.startsWith("fatal: ")) {
|
|
1015
|
+
throw new ReceivePackDiedError(error.message.slice("fatal: ".length));
|
|
1016
|
+
}
|
|
1017
|
+
throw error;
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
808
1020
|
const run = async (
|
|
809
1021
|
name: string,
|
|
810
1022
|
ctx: ReceivePackHookContext,
|
|
@@ -817,6 +1029,7 @@ function scriptReceiveHooks(hooks: HookSession): ReceivePackHooks {
|
|
|
817
1029
|
...hookClientEnv(hooks, ctx),
|
|
818
1030
|
GIT_DIR: ".",
|
|
819
1031
|
...(await quarantineEnv(hooks, ctx)),
|
|
1032
|
+
...(name === "update" ? {} : await certEnv(name, ctx)),
|
|
820
1033
|
...(options.env ?? {}),
|
|
821
1034
|
},
|
|
822
1035
|
prefix: false,
|
|
@@ -849,11 +1062,46 @@ function scriptReceiveHooks(hooks: HookSession): ReceivePackHooks {
|
|
|
849
1062
|
const refs = commands.filter((c) => !c.report).map((c) => c.pushedRef ?? c.refName);
|
|
850
1063
|
if (refs.length > 0) await run("post-update", ctx, { args: refs });
|
|
851
1064
|
},
|
|
1065
|
+
// git master's receive-report hook (run_receive_report_hook, found as find_hook finds it):
|
|
1066
|
+
// the report on stdin, its stdout the new report, its stderr to the user; not in 2.43
|
|
1067
|
+
...(hooks.compatibility === "2.43"
|
|
1068
|
+
? {}
|
|
1069
|
+
: {
|
|
1070
|
+
receiveReport: async (report: Uint8Array, ctx: ReceivePackHookContext) => {
|
|
1071
|
+
const started = await hooks.start("receive-report", {
|
|
1072
|
+
env: { ...hookClientEnv(hooks, ctx), GIT_DIR: "." },
|
|
1073
|
+
prefix: false,
|
|
1074
|
+
onStderr: (text) => ctx.message(text),
|
|
1075
|
+
});
|
|
1076
|
+
if (!started) return undefined;
|
|
1077
|
+
const chunks: Uint8Array[] = [];
|
|
1078
|
+
const reading = (async () => {
|
|
1079
|
+
for await (const chunk of started.stdout) chunks.push(chunk);
|
|
1080
|
+
})().catch(() => {});
|
|
1081
|
+
// a hook that does not read its stdin: git ignores SIGPIPE there
|
|
1082
|
+
await started.write(report).catch(() => {});
|
|
1083
|
+
await started.closeStdin().catch(() => {});
|
|
1084
|
+
await reading;
|
|
1085
|
+
const code = await started.wait();
|
|
1086
|
+
if (code !== 0) return false;
|
|
1087
|
+
const out = new Uint8Array(chunks.reduce((n, c) => n + c.length, 0));
|
|
1088
|
+
let at = 0;
|
|
1089
|
+
for (const c of chunks) {
|
|
1090
|
+
out.set(c, at);
|
|
1091
|
+
at += c.length;
|
|
1092
|
+
}
|
|
1093
|
+
return out;
|
|
1094
|
+
},
|
|
1095
|
+
}),
|
|
852
1096
|
// run_proc_receive_hook: its stdin and stdout piped, its stderr relayed to the user; the
|
|
853
1097
|
// objects are published by now (no quarantine variables) and no push option variables
|
|
854
|
-
procReceive: (ctx) =>
|
|
1098
|
+
procReceive: async (ctx) =>
|
|
855
1099
|
hooks.start("proc-receive", {
|
|
856
|
-
env: {
|
|
1100
|
+
env: {
|
|
1101
|
+
...hookClientEnv(hooks, ctx),
|
|
1102
|
+
GIT_DIR: ".",
|
|
1103
|
+
...(await certEnv("proc-receive", ctx)),
|
|
1104
|
+
},
|
|
857
1105
|
prefix: false,
|
|
858
1106
|
onStderr: (text) => ctx.message(text),
|
|
859
1107
|
}),
|
|
@@ -2599,7 +2599,10 @@ export class LogCommand extends GitCommand<AsyncIterable<LogResult>> {
|
|
|
2599
2599
|
const shownIds = new Set<ObjectId>();
|
|
2600
2600
|
const unwalkedShown = new Set<ObjectId>();
|
|
2601
2601
|
let entries: LogOutputEntry[];
|
|
2602
|
-
if (this.
|
|
2602
|
+
if (this.noWalkCommits !== undefined) {
|
|
2603
|
+
entries = await this.noWalkEntries(this.noWalkCommits);
|
|
2604
|
+
for (const e of entries) shownIds.add(e.id);
|
|
2605
|
+
} else if (this.reflogWalkNames !== undefined) {
|
|
2603
2606
|
entries = await this.reflogEntries(this.reflogWalkNames);
|
|
2604
2607
|
for (const e of entries) shownIds.add(e.id);
|
|
2605
2608
|
} else if (topo) {
|
|
@@ -2878,6 +2881,36 @@ export class LogCommand extends GitCommand<AsyncIterable<LogResult>> {
|
|
|
2878
2881
|
* (`--since`/`--until` against the entry's date, path limiting against the commit's parents,
|
|
2879
2882
|
* get_commit_action), then skipped and counted.
|
|
2880
2883
|
*/
|
|
2884
|
+
/**
|
|
2885
|
+
* Show these commits as they are, nothing walked (`git diff-tree <commit>`, `--stdin`'s
|
|
2886
|
+
* lines): each with its own parents, or the ones given (a `--stdin` line's grafts)
|
|
2887
|
+
*
|
|
2888
|
+
* @internal
|
|
2889
|
+
*/
|
|
2890
|
+
setNoWalk(commits: readonly { id: ObjectId; parents?: readonly ObjectId[] }[]): this {
|
|
2891
|
+
this.checkCallable();
|
|
2892
|
+
this.noWalkCommits = commits;
|
|
2893
|
+
return this;
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
private noWalkCommits?: readonly { id: ObjectId; parents?: readonly ObjectId[] }[];
|
|
2897
|
+
|
|
2898
|
+
/** {@link setNoWalk}'s commits as the output shows them */
|
|
2899
|
+
private async noWalkEntries(
|
|
2900
|
+
commits: readonly { id: ObjectId; parents?: readonly ObjectId[] }[],
|
|
2901
|
+
): Promise<LogOutputEntry[]> {
|
|
2902
|
+
this.checkCallable();
|
|
2903
|
+
this.setCallable(false);
|
|
2904
|
+
readDiffSubmoduleConfig(this.workingCopy);
|
|
2905
|
+
const out: LogOutputEntry[] = [];
|
|
2906
|
+
for (const { id, parents } of commits) {
|
|
2907
|
+
const commit = await this.walkCommits.load(id);
|
|
2908
|
+
if (!commit) throw new GitApiError(`fatal: bad object ${id}`);
|
|
2909
|
+
out.push({ id, commit, parents: parents ? [...parents] : [...commit.parents] });
|
|
2910
|
+
}
|
|
2911
|
+
return out;
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2881
2914
|
private async reflogEntries(names: readonly string[], claim = true): Promise<LogOutputEntry[]> {
|
|
2882
2915
|
if (claim) {
|
|
2883
2916
|
this.checkCallable();
|
|
@@ -3009,6 +3042,7 @@ export class LogCommand extends GitCommand<AsyncIterable<LogResult>> {
|
|
|
3009
3042
|
.setNewTree(newTree)
|
|
3010
3043
|
// log's diffcore_rotate starts at the first path after a missing one
|
|
3011
3044
|
.setRotateStrict(false)
|
|
3045
|
+
.setTreeWalk(this.treeWalk)
|
|
3012
3046
|
.shareReadsOf(this);
|
|
3013
3047
|
if (this.colorSettings) diff.setColorSettings(this.colorSettings);
|
|
3014
3048
|
diff.setOptions({
|
|
@@ -3248,6 +3282,20 @@ export class LogCommand extends GitCommand<AsyncIterable<LogResult>> {
|
|
|
3248
3282
|
return true;
|
|
3249
3283
|
}
|
|
3250
3284
|
|
|
3285
|
+
/**
|
|
3286
|
+
* How the commits' trees are compared (`DiffCommand.setTreeWalk`): `git diff-tree` without
|
|
3287
|
+
* `-r` lists the top tree's differing entries
|
|
3288
|
+
*
|
|
3289
|
+
* @internal
|
|
3290
|
+
*/
|
|
3291
|
+
setTreeWalk(walk: "recursive" | "flat" | "show-trees"): this {
|
|
3292
|
+
this.checkCallable();
|
|
3293
|
+
this.treeWalk = walk;
|
|
3294
|
+
return this;
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
private treeWalk: "recursive" | "flat" | "show-trees" = "recursive";
|
|
3298
|
+
|
|
3251
3299
|
/** Options of the diffs {@link callBytes} prints (context, algorithm, `--stat` widths...) */
|
|
3252
3300
|
setDiffOptions(options: DiffTextOptions): this {
|
|
3253
3301
|
this.checkCallable();
|
|
@@ -3412,6 +3460,37 @@ export class LogCommand extends GitCommand<AsyncIterable<LogResult>> {
|
|
|
3412
3460
|
return kept;
|
|
3413
3461
|
}
|
|
3414
3462
|
|
|
3463
|
+
/**
|
|
3464
|
+
* The combined raw output's ids (`diff_aligned_abbrev`): full under `rawFullIds` without
|
|
3465
|
+
* `--abbrev`, else each abbreviated uniquely
|
|
3466
|
+
*/
|
|
3467
|
+
private async combinedRawAbbreviator(
|
|
3468
|
+
raw: boolean,
|
|
3469
|
+
paths: string[],
|
|
3470
|
+
result: Map<string, { mode: number; id: ObjectId }>,
|
|
3471
|
+
parents: Map<string, { mode: number; id: ObjectId }>[],
|
|
3472
|
+
): Promise<(id: ObjectId | undefined) => string> {
|
|
3473
|
+
const nullId = this.objectFormat.nullId;
|
|
3474
|
+
const o = this.diffOptions;
|
|
3475
|
+
if (!raw || (o.rawFullIds && o.abbrev === undefined)) return (id) => id ?? nullId;
|
|
3476
|
+
const ids = new Set<string>([nullId]);
|
|
3477
|
+
for (const path of paths) {
|
|
3478
|
+
const r = result.get(path);
|
|
3479
|
+
if (r) ids.add(r.id);
|
|
3480
|
+
for (const m of parents) {
|
|
3481
|
+
const side = m.get(path);
|
|
3482
|
+
if (side) ids.add(side.id);
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
const min =
|
|
3486
|
+
o.abbrev === undefined ? undefined : Math.min(40, Math.max(4, Math.trunc(o.abbrev)));
|
|
3487
|
+
const lengths = await this.idAbbreviator().lengths(ids, min);
|
|
3488
|
+
return (id) => {
|
|
3489
|
+
const full = id ?? nullId;
|
|
3490
|
+
return full.slice(0, lengths.get(full) ?? min ?? 7);
|
|
3491
|
+
};
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3415
3494
|
/**
|
|
3416
3495
|
* combine-diff.c's diff_tree_combined for a merge: the paths that differ from every
|
|
3417
3496
|
* parent (within the pathspec), each as a combined diff of the trees.
|
|
@@ -3420,7 +3499,7 @@ export class LogCommand extends GitCommand<AsyncIterable<LogResult>> {
|
|
|
3420
3499
|
entry: LogOutputEntry,
|
|
3421
3500
|
options: {
|
|
3422
3501
|
dense: boolean;
|
|
3423
|
-
names?: "name-only" | "name-status";
|
|
3502
|
+
names?: "name-only" | "name-status" | "raw";
|
|
3424
3503
|
patch: boolean;
|
|
3425
3504
|
follow?: string;
|
|
3426
3505
|
parentPaths?: string[];
|
|
@@ -3480,16 +3559,36 @@ export class LogCommand extends GitCommand<AsyncIterable<LogResult>> {
|
|
|
3480
3559
|
parseGitBool(RemoteConfigStore.from(this._workingCopy).value("core.quotePath")) ?? true;
|
|
3481
3560
|
const names = new ByteSink();
|
|
3482
3561
|
if (options.names) {
|
|
3562
|
+
// show_raw_diff: `-z` ends each field with a NUL, its paths unquoted
|
|
3563
|
+
const z = this.diffOptions.nullTerminated === true;
|
|
3564
|
+
const inter = z ? "\0" : "\t";
|
|
3565
|
+
const term = z ? "\0" : "\n";
|
|
3566
|
+
const rawId = await this.combinedRawAbbreviator(
|
|
3567
|
+
options.names === "raw",
|
|
3568
|
+
paths,
|
|
3569
|
+
result,
|
|
3570
|
+
parents,
|
|
3571
|
+
);
|
|
3572
|
+
const mode6 = (mode: number | undefined) => (mode ?? 0).toString(8).padStart(6, "0");
|
|
3483
3573
|
for (const path of paths) {
|
|
3484
|
-
if (options.names === "
|
|
3574
|
+
if (options.names === "raw") {
|
|
3575
|
+
const r = result.get(path);
|
|
3576
|
+
const sides = parents.map((m, k) => sideOf(m, k, path));
|
|
3577
|
+
names.text(":".repeat(parents.length));
|
|
3578
|
+
for (const side of sides) names.text(`${mode6(side?.mode)} `);
|
|
3579
|
+
names.text(mode6(r?.mode));
|
|
3580
|
+
for (const side of sides) names.text(` ${rawId(side?.id)}`);
|
|
3581
|
+
names.text(` ${rawId(r?.id)} `);
|
|
3582
|
+
}
|
|
3583
|
+
if (options.names === "name-status" || options.names === "raw") {
|
|
3485
3584
|
const r = result.get(path);
|
|
3486
3585
|
parents.forEach((m, k) => {
|
|
3487
3586
|
const found = options.parentStatus?.[k];
|
|
3488
3587
|
names.text(found ?? (!sideOf(m, k, path) ? "A" : !r ? "D" : "M"));
|
|
3489
3588
|
});
|
|
3490
|
-
names.text(
|
|
3589
|
+
names.text(inter);
|
|
3491
3590
|
}
|
|
3492
|
-
names.text(`${quotePath(path, quote)}
|
|
3591
|
+
names.text(`${z ? path : quotePath(path, quote)}${term}`);
|
|
3493
3592
|
}
|
|
3494
3593
|
}
|
|
3495
3594
|
if (paths.length === 0 || !options.patch) {
|