@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,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git format-rev` (builtin/name-rev.c's cmd_format_rev, git 2.56+, experimental): each
|
|
3
|
+
* commit read from stdin, or each full object id in running text, replaced by a pretty format
|
|
4
|
+
* of the commit.
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const { stdout } = await git
|
|
8
|
+
* .formatRev()
|
|
9
|
+
* .setStdinMode("revs")
|
|
10
|
+
* .setFormat("%s")
|
|
11
|
+
* .setInput("HEAD\nHEAD~1\n")
|
|
12
|
+
* .callOutput();
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The formats are git's: user formats (`format:`, `tformat:`, a text with `%`, a `pretty.<name>`
|
|
16
|
+
* alias) and the builtin ones (`reference`, `oneline`, `medium`, `short`, `full`, `fuller`,
|
|
17
|
+
* `raw`, `email`, `mboxrd`), the latter as pretty.c's `pretty_print_commit` prints them: no
|
|
18
|
+
* `commit <id>` line (log-tree's), no notes, tabs kept, a mail's subject without `[PATCH]`.
|
|
19
|
+
* Each commit is formatted by `git log`'s pretty engine with no configuration of its own:
|
|
20
|
+
* `log.*` settings do not apply, as format-rev starts from a fresh `rev_info`.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { ObjectId } from "@statewalker/vcs-core";
|
|
24
|
+
import { decodeGitPath, encodeGitPath } from "@statewalker/vcs-utils/encoding";
|
|
25
|
+
import { RemoteConfigStore } from "../remote-config/index.js";
|
|
26
|
+
import { LogCommand } from "./log-command.js";
|
|
27
|
+
import { PlumbingCommand, PlumbingError } from "./plumbing-command.js";
|
|
28
|
+
|
|
29
|
+
/** `--stdin-mode`: lines of revisions, or running text holding object ids. */
|
|
30
|
+
export type FormatRevStdinMode = "text" | "revs";
|
|
31
|
+
|
|
32
|
+
/** A format as get_commit_format reads it: a user format, or a builtin `CMIT_FMT_*` one. */
|
|
33
|
+
type Pretty = { format: string; date?: string; builtin?: never } | { builtin: string };
|
|
34
|
+
|
|
35
|
+
/** A builtin format git's get_commit_format knows, with its default date mode. */
|
|
36
|
+
const BUILTIN_USER_FORMATS: Record<string, { format: string; date?: string }> = {
|
|
37
|
+
reference: { format: "%C(auto)%h (%s, %ad)", date: "short" },
|
|
38
|
+
};
|
|
39
|
+
const BUILTIN_OTHER = new Set([
|
|
40
|
+
"raw",
|
|
41
|
+
"medium",
|
|
42
|
+
"short",
|
|
43
|
+
"email",
|
|
44
|
+
"mboxrd",
|
|
45
|
+
"fuller",
|
|
46
|
+
"full",
|
|
47
|
+
"oneline",
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
export class FormatRevCommand extends PlumbingCommand {
|
|
51
|
+
private format?: string;
|
|
52
|
+
private stdinMode?: string;
|
|
53
|
+
private notes: string[] = [];
|
|
54
|
+
private nulInput = false;
|
|
55
|
+
private nulOutput = false;
|
|
56
|
+
private input: Uint8Array = new Uint8Array(0);
|
|
57
|
+
|
|
58
|
+
/** `--format=<pretty>` (required) */
|
|
59
|
+
setFormat(format: string): this {
|
|
60
|
+
this.checkCallable();
|
|
61
|
+
this.format = format;
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** `--stdin-mode=<mode>` (required): `text`, `revs` or `rev` */
|
|
66
|
+
setStdinMode(mode: string): this {
|
|
67
|
+
this.checkCallable();
|
|
68
|
+
this.stdinMode = mode;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** `--notes=<ref>`: a notes ref (or glob) `%N` shows; repeatable */
|
|
73
|
+
addNotes(ref: string): this {
|
|
74
|
+
this.checkCallable();
|
|
75
|
+
this.notes.push(ref);
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** `--no-notes`: forget the `--notes` given so far */
|
|
80
|
+
clearNotes(): this {
|
|
81
|
+
this.checkCallable();
|
|
82
|
+
this.notes = [];
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** `-z`: NUL-terminated input and output */
|
|
87
|
+
setNul(): this {
|
|
88
|
+
this.checkCallable();
|
|
89
|
+
this.nulInput = true;
|
|
90
|
+
this.nulOutput = true;
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** `--[no-]null-input` */
|
|
95
|
+
setNullInput(nul: boolean): this {
|
|
96
|
+
this.checkCallable();
|
|
97
|
+
this.nulInput = nul;
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** `--[no-]null-output` */
|
|
102
|
+
setNullOutput(nul: boolean): this {
|
|
103
|
+
this.checkCallable();
|
|
104
|
+
this.nulOutput = nul;
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** stdin */
|
|
109
|
+
setInput(input: string | Uint8Array): this {
|
|
110
|
+
this.checkCallable();
|
|
111
|
+
this.input = typeof input === "string" ? encodeGitPath(input) : input;
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
protected async run(): Promise<number> {
|
|
116
|
+
if (this.format === undefined) throw new PlumbingError("fatal: '--format' is required");
|
|
117
|
+
if (this.stdinMode === undefined) throw new PlumbingError("fatal: '--stdin-mode' is required");
|
|
118
|
+
const mode = this.stdinMode;
|
|
119
|
+
if (mode !== "text" && mode !== "revs" && mode !== "rev")
|
|
120
|
+
throw new PlumbingError("fatal: '--stdin-mode' needs to be either text, revs, or rev");
|
|
121
|
+
const pretty = this.prettyOf(this.format);
|
|
122
|
+
const terminator = this.nulOutput ? "\0" : "\n";
|
|
123
|
+
const lines = this.lines();
|
|
124
|
+
const hexLength = this.objectFormat.hexLength;
|
|
125
|
+
const formatted = new Map<ObjectId, string | undefined>();
|
|
126
|
+
const formatCommit = async (id: ObjectId): Promise<string | undefined> => {
|
|
127
|
+
if (formatted.has(id)) return formatted.get(id);
|
|
128
|
+
const text = await this.formatOne(id, pretty);
|
|
129
|
+
formatted.set(id, text);
|
|
130
|
+
return text;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
if (mode === "text") {
|
|
134
|
+
const hex = new RegExp(`(?<![0-9a-f])[0-9a-f]{${hexLength}}(?![0-9a-f])`, "g");
|
|
135
|
+
for (const line of lines) {
|
|
136
|
+
let out = "";
|
|
137
|
+
let last = 0;
|
|
138
|
+
for (const m of line.matchAll(hex)) {
|
|
139
|
+
const at = m.index ?? 0;
|
|
140
|
+
const id = m[0];
|
|
141
|
+
const type = await this.typeOf(id);
|
|
142
|
+
const text = type === "commit" ? await formatCommit(id) : undefined;
|
|
143
|
+
out += line.slice(last, at) + (text ?? id);
|
|
144
|
+
last = at + id.length;
|
|
145
|
+
}
|
|
146
|
+
out += line.slice(last);
|
|
147
|
+
await this.write(`${out}${terminator}`);
|
|
148
|
+
}
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
for (const line of lines) {
|
|
153
|
+
let id: ObjectId | undefined;
|
|
154
|
+
if (line.length === hexLength && /^[0-9a-fA-F]+$/.test(line)) id = line.toLowerCase();
|
|
155
|
+
else {
|
|
156
|
+
try {
|
|
157
|
+
id = await this.revisionResolver().resolve(line);
|
|
158
|
+
} catch {
|
|
159
|
+
id = undefined;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (!id) {
|
|
163
|
+
this.warnRaw(`Could not get object name for ${line}. Skipping.\n`);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
let type = await this.typeOf(id);
|
|
167
|
+
if (!type) {
|
|
168
|
+
this.warnRaw(`Could not get object for ${line}. Skipping.\n`);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
let peeled: ObjectId | undefined = id;
|
|
172
|
+
while (type === "tag" && peeled) {
|
|
173
|
+
peeled = await this.tagTarget(peeled);
|
|
174
|
+
type = peeled ? await this.typeOf(peeled) : undefined;
|
|
175
|
+
}
|
|
176
|
+
if (!peeled || type !== "commit") {
|
|
177
|
+
this.warnRaw(`Could not get commit for ${line}. Skipping.\n`);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
await this.write(`${(await formatCommit(peeled)) ?? ""}${terminator}`);
|
|
181
|
+
}
|
|
182
|
+
return 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** stderr as given (git's fprintf, not an `error:` line) */
|
|
186
|
+
private warnRaw(text: string): void {
|
|
187
|
+
this.warn(text.replace(/\n$/, ""));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** stdin split as strbuf_getline_lf / strbuf_getline_nul: a last line without terminator kept */
|
|
191
|
+
private lines(): string[] {
|
|
192
|
+
const text = decodeGitPath(this.input);
|
|
193
|
+
if (!text) return [];
|
|
194
|
+
const parts = text.split(this.nulInput ? "\0" : "\n");
|
|
195
|
+
if (parts[parts.length - 1] === "") parts.pop();
|
|
196
|
+
return parts;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** get_commit_format: the user format and its date mode. */
|
|
200
|
+
private prettyOf(format: string, depth = 0): Pretty {
|
|
201
|
+
if (format.startsWith("format:")) return { format: format.slice(7) };
|
|
202
|
+
if (format.startsWith("tformat:")) return { format: format.slice(8) };
|
|
203
|
+
if (format.includes("%")) return { format };
|
|
204
|
+
const builtin = BUILTIN_USER_FORMATS[format];
|
|
205
|
+
if (builtin) return builtin;
|
|
206
|
+
if (!BUILTIN_OTHER.has(format) && depth < 10) {
|
|
207
|
+
const alias = RemoteConfigStore.from(this.workingCopy).value(`pretty.${format}`);
|
|
208
|
+
if (alias !== undefined) return this.prettyOf(alias, depth + 1);
|
|
209
|
+
}
|
|
210
|
+
if (BUILTIN_OTHER.has(format)) return { builtin: format };
|
|
211
|
+
throw new PlumbingError(`fatal: invalid --pretty format: ${format}`);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** pretty_print_commit of one commit (with its notes when the format shows `%N`). */
|
|
215
|
+
private async formatOne(id: ObjectId, pretty: Pretty): Promise<string | undefined> {
|
|
216
|
+
const log = new LogCommand(this.workingCopy).setNoWalk([{ id }]).setLogConfig(false);
|
|
217
|
+
try {
|
|
218
|
+
if (pretty.builtin !== undefined) {
|
|
219
|
+
// pretty_print_commit with format-rev's context: fmt_output_email_subject of a
|
|
220
|
+
// rev_info without a subject prefix, encode_email_headers off, no mailmap, and the
|
|
221
|
+
// default date mode of a fresh rev_info (`log.date` is never read)
|
|
222
|
+
return decodeGitPath(
|
|
223
|
+
await log.callBytes({
|
|
224
|
+
pretty: pretty.builtin,
|
|
225
|
+
prettyOnly: true,
|
|
226
|
+
notes: false,
|
|
227
|
+
mailmap: false,
|
|
228
|
+
date: "default",
|
|
229
|
+
mail: { subject: () => "Subject: ", encodeHeaders: false },
|
|
230
|
+
}),
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
const wantsNotes = /%N/.test(pretty.format);
|
|
234
|
+
return decodeGitPath(
|
|
235
|
+
await log.callBytes({
|
|
236
|
+
pretty: `format:${pretty.format}`,
|
|
237
|
+
...(pretty.date ? { date: pretty.date } : {}),
|
|
238
|
+
...(!wantsNotes
|
|
239
|
+
? { notes: false }
|
|
240
|
+
: this.notes.length > 0
|
|
241
|
+
? { notesRefs: [...this.notes] }
|
|
242
|
+
: { notes: true }),
|
|
243
|
+
}),
|
|
244
|
+
);
|
|
245
|
+
} catch {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
private async typeOf(id: ObjectId): Promise<string | undefined> {
|
|
251
|
+
const objects = this.workingCopy.history.objects;
|
|
252
|
+
if (!objects) return undefined;
|
|
253
|
+
try {
|
|
254
|
+
return (await objects.header?.(id))?.type ?? (await objects.get(id))?.type;
|
|
255
|
+
} catch {
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private async tagTarget(id: ObjectId): Promise<ObjectId | undefined> {
|
|
261
|
+
try {
|
|
262
|
+
return (await this.workingCopy.history.tags.load(id))?.object;
|
|
263
|
+
} catch {
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
verifyReverseIndexFile,
|
|
30
30
|
} from "@statewalker/vcs-core";
|
|
31
31
|
import { multiPackIndexVerify } from "@statewalker/vcs-store-files";
|
|
32
|
+
import { type ProgressMonitor, startProgress } from "@statewalker/vcs-utils";
|
|
32
33
|
import { decodeGitPath } from "@statewalker/vcs-utils/encoding";
|
|
33
34
|
import { readFile } from "@statewalker/vcs-utils/files";
|
|
34
35
|
import { isNullObjectId, type ObjectFormat } from "@statewalker/vcs-utils/hash";
|
|
@@ -189,7 +190,10 @@ export interface FsckRepositoryFiles {
|
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
const OID = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
192
|
-
|
|
193
|
+
/** every `*.idx` of a pack directory, as git's prepare_packed_git_one (`custom-<id>.idx` too) */
|
|
194
|
+
const PACK_IDX = /^[^/\\]+\.idx$/;
|
|
195
|
+
/** a `pack-<hex>.idx` name, whose id length tells its object format */
|
|
196
|
+
const PACK_ID_IDX = /^pack-[0-9a-f]+\.idx$/;
|
|
193
197
|
/** Refs one worktree has of its own (git's `is_per_worktree_ref`). */
|
|
194
198
|
const PER_WORKTREE = /^(?:refs\/(?:bisect|worktree|rewritten)\/|[A-Z_]+$)/;
|
|
195
199
|
const dec = new TextDecoder();
|
|
@@ -466,6 +470,7 @@ export class FsckCommand extends GitCommand<FsckResult> {
|
|
|
466
470
|
const run = new FsckRun(stores, objects, types, {
|
|
467
471
|
...(loadPromised ? { loadPromised } : {}),
|
|
468
472
|
connectivityOnly: this._connectivityOnly,
|
|
473
|
+
...(this.progress ? { progress: this.progress } : {}),
|
|
469
474
|
dangling: this._dangling,
|
|
470
475
|
unreachable: this._unreachable,
|
|
471
476
|
reflogs: this._reflogs && !this._lostFound,
|
|
@@ -543,6 +548,8 @@ interface RunOptions {
|
|
|
543
548
|
* no set then)
|
|
544
549
|
*/
|
|
545
550
|
loadPromised?: (skipUnreadable?: boolean) => Promise<ReadonlySet<string>>;
|
|
551
|
+
/** `--progress`: git's phases (see `GitCommand.setProgress`) */
|
|
552
|
+
progress?: ProgressMonitor;
|
|
546
553
|
connectivityOnly: boolean;
|
|
547
554
|
dangling: boolean;
|
|
548
555
|
unreachable: boolean;
|
|
@@ -851,6 +858,14 @@ class FsckRun {
|
|
|
851
858
|
}
|
|
852
859
|
if (this.o.connectivityOnly) this.graph = await this.loadCommitGraph();
|
|
853
860
|
if (packed) await this.scanPacks(packed, loose ?? []);
|
|
861
|
+
// 2.43's check_pack_rev_indexes, then verify_bitmap_files, after the indexes and before
|
|
862
|
+
// the connectivity walk, --connectivity-only too (ERROR_PACK_REV_INDEX 0100, ERROR_BITMAP
|
|
863
|
+
// 0200)
|
|
864
|
+
if (this.files && this.o.compatibility === "2.43") {
|
|
865
|
+
if (await this.verifyReverseIndexes(this.packs))
|
|
866
|
+
this.errorsFound |= FSCK_ERROR_PACK_REV_INDEX_243;
|
|
867
|
+
if (await this.verifyBitmapFiles(this.packs)) this.errorsFound |= FSCK_ERROR_BITMAP_243;
|
|
868
|
+
}
|
|
854
869
|
try {
|
|
855
870
|
await this.checkConnectivity();
|
|
856
871
|
// the walk reads through the midx what it parses again (every object but blobs when
|
|
@@ -868,20 +883,6 @@ class FsckRun {
|
|
|
868
883
|
}
|
|
869
884
|
}
|
|
870
885
|
await this.verifyCommitGraph();
|
|
871
|
-
// 2.43's check_pack_rev_indexes, --connectivity-only too (ERROR_PACK_REV_INDEX, 0100)
|
|
872
|
-
if (
|
|
873
|
-
this.files &&
|
|
874
|
-
this.o.compatibility === "2.43" &&
|
|
875
|
-
(await this.verifyReverseIndexes(this.packs))
|
|
876
|
-
)
|
|
877
|
-
this.errorsFound |= FSCK_ERROR_PACK_REV_INDEX_243;
|
|
878
|
-
// 2.43 checks every pack's bitmap last, --connectivity-only too (ERROR_BITMAP, 0200)
|
|
879
|
-
if (
|
|
880
|
-
this.files &&
|
|
881
|
-
this.o.compatibility === "2.43" &&
|
|
882
|
-
(await this.verifyBitmapFiles(this.packs))
|
|
883
|
-
)
|
|
884
|
-
this.errorsFound |= FSCK_ERROR_BITMAP_243;
|
|
885
886
|
// 2.43 runs `git multi-pack-index verify` for every source last (ERROR_MULTI_PACK_INDEX)
|
|
886
887
|
if (this.files && this.o.compatibility === "2.43") {
|
|
887
888
|
for (const dir of this.sourceDirs())
|
|
@@ -1552,7 +1553,8 @@ class FsckRun {
|
|
|
1552
1553
|
for await (const e of files.list(dir)) {
|
|
1553
1554
|
// the repository's format: a pack named in another is not one of its packs
|
|
1554
1555
|
if (e.kind !== "file" || !PACK_IDX.test(e.name)) continue;
|
|
1555
|
-
if (e.name.length !== "pack-.idx".length + this.format.hexLength)
|
|
1556
|
+
if (PACK_ID_IDX.test(e.name) && e.name.length !== "pack-.idx".length + this.format.hexLength)
|
|
1557
|
+
continue;
|
|
1556
1558
|
const idxPath = pathOf(dir, e.name);
|
|
1557
1559
|
const packPath = `${idxPath.slice(0, -4)}.pack`;
|
|
1558
1560
|
const stats = await files.stats(packPath);
|
|
@@ -1576,7 +1578,7 @@ class FsckRun {
|
|
|
1576
1578
|
*/
|
|
1577
1579
|
private async *looseEntries(
|
|
1578
1580
|
objectsDir = this.looseDir(),
|
|
1579
|
-
): AsyncIterable<{ id?: string; path: string; name: string }> {
|
|
1581
|
+
): AsyncIterable<{ id?: string; path: string; name: string; fanout: number }> {
|
|
1580
1582
|
const files = this.files as FilesApi;
|
|
1581
1583
|
for (let i = 0; i < 256; i++) {
|
|
1582
1584
|
const sub = i.toString(16).padStart(2, "0");
|
|
@@ -1588,8 +1590,8 @@ class FsckRun {
|
|
|
1588
1590
|
for (const e of entries) {
|
|
1589
1591
|
const path = pathOf(dir, e.name);
|
|
1590
1592
|
yield this.looseName.test(e.name)
|
|
1591
|
-
? { id: sub + e.name, path, name: e.name }
|
|
1592
|
-
: { path, name: e.name };
|
|
1593
|
+
? { id: sub + e.name, path, name: e.name, fanout: i }
|
|
1594
|
+
: { path, name: e.name, fanout: i };
|
|
1593
1595
|
}
|
|
1594
1596
|
}
|
|
1595
1597
|
}
|
|
@@ -2089,7 +2091,14 @@ class FsckRun {
|
|
|
2089
2091
|
/** git's `fsck_object_dir`: every loose object file of `objectsDir`. */
|
|
2090
2092
|
private async fsckLooseObjects(objectsDir: string): Promise<void> {
|
|
2091
2093
|
const files = this.files as FilesApi;
|
|
2094
|
+
// fsck_source: "Checking object directories", one unit per fan-out directory, 256 at the end
|
|
2095
|
+
const progress = startProgress(this.o.progress, "Checking object directories", 256);
|
|
2096
|
+
let directory = -1;
|
|
2092
2097
|
for await (const e of this.looseEntries(objectsDir)) {
|
|
2098
|
+
if (e.fanout > directory) {
|
|
2099
|
+
if (directory >= 0) progress.update(directory + 1);
|
|
2100
|
+
directory = e.fanout;
|
|
2101
|
+
}
|
|
2093
2102
|
if (!e.id) {
|
|
2094
2103
|
if (!e.name.startsWith("tmp_obj_")) {
|
|
2095
2104
|
this.emit({ kind: "notice", stream: "stderr", text: `bad sha1 file: ${e.path}` });
|
|
@@ -2121,6 +2130,9 @@ class FsckRun {
|
|
|
2121
2130
|
);
|
|
2122
2131
|
if (r > 0) this.errorsFound |= FSCK_ERROR_OBJECT;
|
|
2123
2132
|
}
|
|
2133
|
+
if (directory >= 0) progress.update(directory + 1);
|
|
2134
|
+
progress.update(256);
|
|
2135
|
+
progress.stop();
|
|
2124
2136
|
}
|
|
2125
2137
|
|
|
2126
2138
|
/**
|
|
@@ -2130,6 +2142,7 @@ class FsckRun {
|
|
|
2130
2142
|
private async verifyReverseIndexes(packs: readonly RepoPack[]): Promise<boolean> {
|
|
2131
2143
|
const files = this.files as FilesApi;
|
|
2132
2144
|
let bad = false;
|
|
2145
|
+
const progress = startProgress(this.o.progress, "Verifying reverse pack-indexes", packs.length);
|
|
2133
2146
|
for (const p of packs) {
|
|
2134
2147
|
const lines = await verifyReverseIndexFile(
|
|
2135
2148
|
files,
|
|
@@ -2138,10 +2151,12 @@ class FsckRun {
|
|
|
2138
2151
|
(i) => p.idx.getOffset(i),
|
|
2139
2152
|
this.format,
|
|
2140
2153
|
);
|
|
2154
|
+
progress.tick();
|
|
2141
2155
|
if (!lines) continue;
|
|
2142
2156
|
for (const line of lines) this.error(line.replace(/^error: /, ""));
|
|
2143
2157
|
bad = true;
|
|
2144
2158
|
}
|
|
2159
|
+
progress.stop();
|
|
2145
2160
|
return bad;
|
|
2146
2161
|
}
|
|
2147
2162
|
|
|
@@ -2173,7 +2188,7 @@ class FsckRun {
|
|
|
2173
2188
|
const raw = this.format.rawLength;
|
|
2174
2189
|
let valid = size >= raw;
|
|
2175
2190
|
if (valid) {
|
|
2176
|
-
const hasher = this.format.
|
|
2191
|
+
const hasher = this.format.createUnsafeHasher();
|
|
2177
2192
|
for await (const c of files.read(path, { start: 0, length: size - raw })) hasher.update(c);
|
|
2178
2193
|
const sum = hasher.digest();
|
|
2179
2194
|
const tail: number[] = [];
|
|
@@ -2191,6 +2206,12 @@ class FsckRun {
|
|
|
2191
2206
|
/** git's `verify_pack` for each of `packs`, with `fsck_obj_buffer` for each object. */
|
|
2192
2207
|
private async fsckPacks(packs: readonly RepoPack[]): Promise<void> {
|
|
2193
2208
|
const files = this.files as FilesApi;
|
|
2209
|
+
// verify_packs: "Checking objects" over every object of the packs
|
|
2210
|
+
const progress = startProgress(
|
|
2211
|
+
this.o.progress,
|
|
2212
|
+
"Checking objects",
|
|
2213
|
+
packs.reduce((n, p) => n + p.idx.objectCount, 0),
|
|
2214
|
+
);
|
|
2194
2215
|
for (const p of packs) {
|
|
2195
2216
|
let err = 0;
|
|
2196
2217
|
// git prints the pack checksum errors before any entry's output
|
|
@@ -2213,6 +2234,7 @@ class FsckRun {
|
|
|
2213
2234
|
});
|
|
2214
2235
|
},
|
|
2215
2236
|
entry: (entry, unpacked) => {
|
|
2237
|
+
progress.tick();
|
|
2216
2238
|
if (p.idx.version > 1 && !entry.crcOk) {
|
|
2217
2239
|
this.error(
|
|
2218
2240
|
`index CRC mismatch for object ${entry.id} from ${p.packPath} at offset ${entry.offset}`,
|
|
@@ -2260,6 +2282,7 @@ class FsckRun {
|
|
|
2260
2282
|
this.errorsFound |= this.o.compatibility === "2.56" ? FSCK_ERROR_OBJECT : FSCK_ERROR_PACK;
|
|
2261
2283
|
}
|
|
2262
2284
|
}
|
|
2285
|
+
progress.stop();
|
|
2263
2286
|
}
|
|
2264
2287
|
|
|
2265
2288
|
/** Every object of a store without files: read, hash-checked and checked. */
|
|
@@ -3341,8 +3364,11 @@ class FsckRun {
|
|
|
3341
3364
|
const t = this.t;
|
|
3342
3365
|
const pending = this.pending;
|
|
3343
3366
|
const scanAt = this.scanAt;
|
|
3367
|
+
// traverse_reachable: one unit per object popped, no total
|
|
3368
|
+
const progress = startProgress(this.o.progress, "Checking connectivity");
|
|
3344
3369
|
while (pending.length > 0) {
|
|
3345
3370
|
const n = pending.pop() as number;
|
|
3371
|
+
progress.tick();
|
|
3346
3372
|
// fsck_walk returns at once for a blob
|
|
3347
3373
|
if (t.type(n) === OBJ_BLOB) continue;
|
|
3348
3374
|
// a tree the scan kept, walked without steps while it needs no await
|
|
@@ -3363,6 +3389,7 @@ class FsckRun {
|
|
|
3363
3389
|
const r = runSteps(this.traverseOne(n));
|
|
3364
3390
|
if (r instanceof Promise) await r;
|
|
3365
3391
|
}
|
|
3392
|
+
progress.stop();
|
|
3366
3393
|
if (this.o.connectivityOnly && (this.o.dangling || this.o.lostFound)) {
|
|
3367
3394
|
await this.forEachStored((raw, at) => this.markUnreachableReferents(raw, at));
|
|
3368
3395
|
}
|
|
@@ -23,9 +23,8 @@ export type FsckMsgLevel = "fatal" | "error" | "warn" | "info" | "ignore";
|
|
|
23
23
|
export type FsckSeverity = "error" | "warning" | "ignore";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Every
|
|
27
|
-
*
|
|
28
|
-
* checks are not done.
|
|
26
|
+
* Every message id git knows, with its default level: the object ids in git's order, then
|
|
27
|
+
* the ref ids `git refs verify` reports (git 2.47+: `badRefContent`, ...; `RefsVerifyCommand`).
|
|
29
28
|
*/
|
|
30
29
|
export const FSCK_MSG_IDS = {
|
|
31
30
|
// fatal errors
|
|
@@ -93,6 +92,23 @@ export const FSCK_MSG_IDS = {
|
|
|
93
92
|
missingTaggerEntry: "info",
|
|
94
93
|
// ignored unless asked for
|
|
95
94
|
extraHeaderEntry: "ignore",
|
|
95
|
+
// the ref database's (`git refs verify`)
|
|
96
|
+
badHeadTarget: "error",
|
|
97
|
+
badPackedRefEntry: "error",
|
|
98
|
+
badPackedRefHeader: "error",
|
|
99
|
+
badReferentName: "error",
|
|
100
|
+
badRefContent: "error",
|
|
101
|
+
badRefFiletype: "error",
|
|
102
|
+
badRefName: "error",
|
|
103
|
+
badRefOid: "error",
|
|
104
|
+
packedRefEntryNotTerminated: "error",
|
|
105
|
+
packedRefUnsorted: "error",
|
|
106
|
+
badReftableTableName: "warn",
|
|
107
|
+
emptyPackedRefsFile: "info",
|
|
108
|
+
refMissingNewline: "info",
|
|
109
|
+
symlinkRef: "info",
|
|
110
|
+
symrefTargetIsNotARef: "info",
|
|
111
|
+
trailingRefContent: "info",
|
|
96
112
|
} as const satisfies Record<string, FsckMsgLevel>;
|
|
97
113
|
|
|
98
114
|
/** A message id, in git's camel case. */
|
|
@@ -173,7 +173,7 @@ export async function checkPack(
|
|
|
173
173
|
}
|
|
174
174
|
// verify_pack_index
|
|
175
175
|
const idxSum = format
|
|
176
|
-
.
|
|
176
|
+
.createUnsafeHasher()
|
|
177
177
|
.update(idxBytes.subarray(0, idxBytes.length - raw))
|
|
178
178
|
.digest();
|
|
179
179
|
if (!sameBytes(idxSum, 0, idxBytes, idxBytes.length - raw, raw)) {
|
|
@@ -337,7 +337,7 @@ export async function checkPack(
|
|
|
337
337
|
};
|
|
338
338
|
|
|
339
339
|
// One pass: the pack's hash, each entry's CRC-32 and bytes
|
|
340
|
-
const sha = format.
|
|
340
|
+
const sha = format.createUnsafeHasher();
|
|
341
341
|
const trailer = new Uint8Array(raw);
|
|
342
342
|
let at = 0;
|
|
343
343
|
let k = 0;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's builtin file system monitor daemon asked over a `MessagePort` (fsmonitor-ipc.c's
|
|
3
|
+
* `fsmonitor_ipc__send_query` over simple-ipc): the request is the token, the answer the new
|
|
4
|
+
* token and the changed paths, both sent as pkt-lines ended by a flush packet.
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const port = await environment.openIpcPort({ service: "fsmonitor--daemon", path });
|
|
8
|
+
* const answer = await queryFsmonitorDaemon(port, "builtin:fake");
|
|
9
|
+
* // answer: "<token>\0<path>\0<path>\0..." as the daemon wrote it, or undefined on failure
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* The protocol code never sees a socket: the port speaks webrun-rpc's stream tier (one
|
|
13
|
+
* stream per port, bounded both ways), whatever carries it (a Unix socket through
|
|
14
|
+
* `connectSocketPort` of `@statewalker/vcs-utils-node`, a `MessageChannel`, a worker).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { duplexOverPort } from "@statewalker/webrun-rpc";
|
|
18
|
+
|
|
19
|
+
/** git's `LARGE_PACKET_DATA_MAX`: the largest payload of one pkt-line. */
|
|
20
|
+
const LARGE_PACKET_DATA_MAX = 65520 - 4;
|
|
21
|
+
|
|
22
|
+
/** The daemon's socket in the git directory (`fsmonitor_ipc__get_default_path`). */
|
|
23
|
+
export const FSMONITOR_DAEMON_IPC_NAME = "fsmonitor--daemon.ipc";
|
|
24
|
+
|
|
25
|
+
const hex = (n: number) => n.toString(16).padStart(4, "0");
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* `write_packetized_from_buf_no_flush` then `packet_flush`: `payload` as pkt-lines of at
|
|
29
|
+
* most {@link LARGE_PACKET_DATA_MAX} bytes (none for an empty payload), then `0000`.
|
|
30
|
+
*/
|
|
31
|
+
export function encodePacketized(payload: Uint8Array): Uint8Array {
|
|
32
|
+
const lines = Math.ceil(payload.byteLength / LARGE_PACKET_DATA_MAX);
|
|
33
|
+
const out = new Uint8Array(payload.byteLength + lines * 4 + 4);
|
|
34
|
+
let at = 0;
|
|
35
|
+
for (let from = 0; from < payload.byteLength; from += LARGE_PACKET_DATA_MAX) {
|
|
36
|
+
const chunk = payload.subarray(from, from + LARGE_PACKET_DATA_MAX);
|
|
37
|
+
for (const c of hex(chunk.byteLength + 4)) out[at++] = c.charCodeAt(0);
|
|
38
|
+
out.set(chunk, at);
|
|
39
|
+
at += chunk.byteLength;
|
|
40
|
+
}
|
|
41
|
+
for (let i = 0; i < 4; i++) out[at++] = 0x30;
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Reads pkt-lines from `chunks` up to the first flush packet (`read_packetized_to_strbuf`):
|
|
47
|
+
* their payloads joined, or undefined when the stream ends first or a length is malformed.
|
|
48
|
+
*/
|
|
49
|
+
async function readPacketized(chunks: AsyncIterator<Uint8Array>): Promise<Uint8Array | undefined> {
|
|
50
|
+
let buffer = new Uint8Array(0);
|
|
51
|
+
const parts: Uint8Array[] = [];
|
|
52
|
+
let size = 0;
|
|
53
|
+
const fill = async (need: number): Promise<boolean> => {
|
|
54
|
+
while (buffer.byteLength < need) {
|
|
55
|
+
const next = await chunks.next();
|
|
56
|
+
if (next.done) return false;
|
|
57
|
+
const joined = new Uint8Array(buffer.byteLength + next.value.byteLength);
|
|
58
|
+
joined.set(buffer);
|
|
59
|
+
joined.set(next.value, buffer.byteLength);
|
|
60
|
+
buffer = joined;
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
};
|
|
64
|
+
for (;;) {
|
|
65
|
+
if (!(await fill(4))) return undefined;
|
|
66
|
+
let length = 0;
|
|
67
|
+
for (let i = 0; i < 4; i++) {
|
|
68
|
+
const digit = Number.parseInt(String.fromCharCode(buffer[i] as number), 16);
|
|
69
|
+
if (Number.isNaN(digit)) return undefined;
|
|
70
|
+
length = length * 16 + digit;
|
|
71
|
+
}
|
|
72
|
+
if (length === 0) break;
|
|
73
|
+
// a delimiter or response-end packet, or a length shorter than its header: protocol error
|
|
74
|
+
if (length < 4) return undefined;
|
|
75
|
+
if (!(await fill(length))) return undefined;
|
|
76
|
+
const payload = buffer.slice(4, length);
|
|
77
|
+
parts.push(payload);
|
|
78
|
+
size += payload.byteLength;
|
|
79
|
+
buffer = buffer.subarray(length);
|
|
80
|
+
}
|
|
81
|
+
const out = new Uint8Array(size);
|
|
82
|
+
let at = 0;
|
|
83
|
+
for (const part of parts) {
|
|
84
|
+
out.set(part, at);
|
|
85
|
+
at += part.byteLength;
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Sends `token` to the daemon behind `port` and returns its answer (the new token, a NUL,
|
|
92
|
+
* then the changed paths, each ended by a NUL); undefined when the exchange fails (the
|
|
93
|
+
* stream fails or ends before the answer's flush packet), as git's
|
|
94
|
+
* `ipc_client_send_command_to_connection` fails. The port is closed afterwards.
|
|
95
|
+
*/
|
|
96
|
+
export async function queryFsmonitorDaemon(
|
|
97
|
+
port: MessagePort,
|
|
98
|
+
token: string,
|
|
99
|
+
): Promise<Uint8Array | undefined> {
|
|
100
|
+
let answered: () => void = () => {};
|
|
101
|
+
const done = new Promise<void>((resolve) => {
|
|
102
|
+
answered = resolve;
|
|
103
|
+
});
|
|
104
|
+
// as git's client: the request and its flush, then the connection held open (no
|
|
105
|
+
// half-close) until the answer is read
|
|
106
|
+
async function* request() {
|
|
107
|
+
yield encodePacketized(new TextEncoder().encode(token));
|
|
108
|
+
await done;
|
|
109
|
+
}
|
|
110
|
+
const output = duplexOverPort(port)(request());
|
|
111
|
+
port.start();
|
|
112
|
+
try {
|
|
113
|
+
return await readPacketized(output);
|
|
114
|
+
} catch {
|
|
115
|
+
return undefined;
|
|
116
|
+
} finally {
|
|
117
|
+
answered();
|
|
118
|
+
await output.return(undefined).catch(() => undefined);
|
|
119
|
+
port.close();
|
|
120
|
+
}
|
|
121
|
+
}
|