@statewalker/vcs-commands 0.14.0 → 0.15.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/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-backend.d.ts +1 -1
- package/dist/commands/add-patch/patch-backend.d.ts.map +1 -1
- package/dist/commands/archive/remote-archive-command.d.ts +4 -1
- package/dist/commands/archive/remote-archive-command.d.ts.map +1 -1
- package/dist/commands/branch-command.d.ts +14 -2
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/cat-file/batch-format.d.ts +8 -12
- package/dist/commands/cat-file/batch-format.d.ts.map +1 -1
- package/dist/commands/cat-file/cat-file-command.d.ts +39 -5
- package/dist/commands/cat-file/cat-file-command.d.ts.map +1 -1
- package/dist/commands/check-ignore-command.d.ts.map +1 -1
- package/dist/commands/checkout-command.d.ts +4 -0
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/checkout-paths.d.ts +9 -0
- package/dist/commands/checkout-paths.d.ts.map +1 -1
- package/dist/commands/cherry-pick-command.d.ts +3 -0
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-interactive.d.ts +0 -9
- package/dist/commands/clean-interactive.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +2 -0
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/column/column-config.d.ts +23 -0
- package/dist/commands/column/column-config.d.ts.map +1 -0
- package/dist/commands/column/column-layout.d.ts +129 -0
- package/dist/commands/column/column-layout.d.ts.map +1 -0
- package/dist/commands/column/index.d.ts +3 -0
- package/dist/commands/column/index.d.ts.map +1 -0
- package/dist/commands/column-command.d.ts +59 -0
- package/dist/commands/column-command.d.ts.map +1 -0
- package/dist/commands/comment-char-config.d.ts +15 -0
- package/dist/commands/comment-char-config.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +21 -2
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/config-command.d.ts +12 -0
- package/dist/commands/config-command.d.ts.map +1 -1
- package/dist/commands/credential-helper.d.ts +214 -0
- package/dist/commands/credential-helper.d.ts.map +1 -0
- package/dist/commands/default-branch.d.ts +17 -1
- package/dist/commands/default-branch.d.ts.map +1 -1
- package/dist/commands/diff-color-config.d.ts +4 -0
- package/dist/commands/diff-color-config.d.ts.map +1 -1
- package/dist/commands/diff-command.d.ts +12 -0
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-export-command.d.ts +89 -2
- package/dist/commands/fast-export/fast-export-command.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-import-command.d.ts +113 -8
- package/dist/commands/fast-export/fast-import-command.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-stream-support.d.ts +0 -9
- package/dist/commands/fast-export/fast-stream-support.d.ts.map +1 -1
- package/dist/commands/fetch-command.d.ts +21 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +28 -0
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/history-command.d.ts +173 -7
- package/dist/commands/history-command.d.ts.map +1 -1
- package/dist/commands/index-host.d.ts +19 -0
- package/dist/commands/index-host.d.ts.map +1 -1
- package/dist/commands/index-refresh.d.ts +36 -0
- package/dist/commands/index-refresh.d.ts.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +7 -6
- package/dist/commands/init-command.d.ts +20 -0
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/local-transport.d.ts +29 -1
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +7 -0
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +11 -0
- package/dist/commands/log-output.d.ts.map +1 -1
- package/dist/commands/maintenance-schedule-command.d.ts +122 -0
- package/dist/commands/maintenance-schedule-command.d.ts.map +1 -0
- package/dist/commands/merge-command.d.ts +2 -0
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-index-command.d.ts +42 -0
- package/dist/commands/merge-index-command.d.ts.map +1 -0
- package/dist/commands/merge-one-file.d.ts +129 -0
- package/dist/commands/merge-one-file.d.ts.map +1 -0
- package/dist/commands/merge-support.d.ts +21 -2
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/object-disk-info.d.ts +35 -0
- package/dist/commands/object-disk-info.d.ts.map +1 -0
- package/dist/commands/octopus-merge.d.ts +3 -3
- package/dist/commands/octopus-merge.d.ts.map +1 -1
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/pull-command.d.ts +55 -7
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +18 -1
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/range-diff/range-diff-command.d.ts +37 -1
- package/dist/commands/range-diff/range-diff-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +13 -1
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/for-each-ref-command.d.ts +3 -2
- package/dist/commands/ref-filter/for-each-ref-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/ref-filter.d.ts.map +1 -1
- package/dist/commands/ref-filter/ref-format.d.ts +26 -1
- package/dist/commands/ref-filter/ref-format.d.ts.map +1 -1
- package/dist/commands/ref-filter/ref-listing-command.d.ts +9 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts.map +1 -1
- package/dist/commands/remote-transport.d.ts +27 -0
- package/dist/commands/remote-transport.d.ts.map +1 -1
- package/dist/commands/repack-command.d.ts +18 -2
- package/dist/commands/repack-command.d.ts.map +1 -1
- package/dist/commands/repo-command.d.ts +2 -7
- package/dist/commands/repo-command.d.ts.map +1 -1
- package/dist/commands/reset-command.d.ts +4 -1
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts.map +1 -1
- package/dist/commands/rev-list-command.d.ts +65 -0
- package/dist/commands/rev-list-command.d.ts.map +1 -1
- package/dist/commands/revert-command.d.ts +3 -0
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-filenames.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +17 -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/serve-repository.d.ts +17 -1
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/served-lazy-fetch.d.ts +61 -0
- package/dist/commands/served-lazy-fetch.d.ts.map +1 -0
- package/dist/commands/signing.d.ts +10 -4
- package/dist/commands/signing.d.ts.map +1 -1
- package/dist/commands/status-color-config.d.ts +33 -0
- package/dist/commands/status-color-config.d.ts.map +1 -0
- package/dist/commands/status-command.d.ts +15 -0
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-format.d.ts +46 -4
- package/dist/commands/status-format.d.ts.map +1 -1
- package/dist/commands/tag-command.d.ts +15 -1
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/tree-restore.d.ts +14 -0
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/verify-command.d.ts +22 -2
- package/dist/commands/verify-command.d.ts.map +1 -1
- package/dist/commands/worktree-add-command.d.ts.map +1 -1
- package/dist/commands/worktree-overwrite-checks.d.ts +31 -6
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
- package/dist/{commands-C9M78Chn.js → commands-DT3VEv50.js} +14879 -16703
- package/dist/errors/commit-errors.d.ts +23 -3
- package/dist/errors/commit-errors.d.ts.map +1 -1
- package/dist/errors/git-api-error.d.ts +6 -0
- package/dist/errors/git-api-error.d.ts.map +1 -1
- package/dist/errors/index.js +30 -4
- package/dist/{fsck-C4US3l0B.js → fsck-BZ508Elg.js} +1 -1
- package/dist/git-command.d.ts +33 -1
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +104 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/{remote-transport-C43eykfK.js → local-transport-D98U6p4d.js} +184 -683
- package/dist/{maintenance-run-command-CoJFKr2p.js → maintenance-run-command-DZFnbnbo.js} +2285 -79
- package/dist/remote-config/remote-config-store.d.ts +6 -0
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/remote-transport-zvSqwpOB.js +4865 -0
- package/dist/results/cherry-pick-result.d.ts +4 -3
- package/dist/results/cherry-pick-result.d.ts.map +1 -1
- package/dist/results/diff-output.d.ts +7 -0
- package/dist/results/diff-output.d.ts.map +1 -1
- package/dist/results/diff-words.d.ts +14 -3
- package/dist/results/diff-words.d.ts.map +1 -1
- package/dist/results/index.js +1 -1
- package/dist/results/line-prefix-sink.d.ts +50 -0
- package/dist/results/line-prefix-sink.d.ts.map +1 -0
- package/dist/results/merge-result.d.ts +4 -3
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/rebase-result.d.ts +5 -0
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/revert-result.d.ts +4 -3
- package/dist/results/revert-result.d.ts.map +1 -1
- package/dist/{results-B0CWLCAp.js → results-rF81cQse.js} +1425 -202
- package/dist/transport-command.d.ts +10 -0
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/commands/add-command.ts +15 -2
- package/src/commands/add-patch/patch-backend.ts +6 -44
- package/src/commands/archive/remote-archive-command.ts +10 -3
- package/src/commands/branch-command.ts +57 -4
- package/src/commands/cat-file/batch-format.ts +17 -18
- package/src/commands/cat-file/cat-file-command.ts +181 -15
- package/src/commands/check-ignore-command.ts +61 -17
- package/src/commands/checkout-command.ts +149 -21
- package/src/commands/checkout-index-command.ts +2 -1
- package/src/commands/checkout-paths.ts +13 -0
- package/src/commands/cherry-pick-command.ts +9 -0
- package/src/commands/clean-interactive.ts +20 -74
- package/src/commands/clone-command.ts +13 -0
- package/src/commands/column/column-config.ts +63 -0
- package/src/commands/column/column-layout.ts +396 -0
- package/src/commands/column/index.ts +2 -0
- package/src/commands/column-command.ts +171 -0
- package/src/commands/comment-char-config.ts +42 -0
- package/src/commands/commit-command.ts +61 -21
- package/src/commands/config-command.ts +28 -0
- package/src/commands/credential-helper.ts +807 -0
- package/src/commands/default-branch.ts +38 -0
- package/src/commands/diff-color-config.ts +23 -10
- package/src/commands/diff-command.ts +25 -2
- package/src/commands/fast-export/fast-export-command.ts +661 -35
- package/src/commands/fast-export/fast-import-command.ts +694 -94
- package/src/commands/fast-export/fast-stream-support.ts +18 -1
- package/src/commands/fetch-command.ts +103 -14
- package/src/commands/git-hooks.ts +85 -0
- package/src/commands/history-command.ts +952 -20
- package/src/commands/index-host.ts +51 -0
- package/src/commands/index-refresh.ts +121 -0
- package/src/commands/index.ts +9 -0
- package/src/commands/init-command.ts +34 -1
- package/src/commands/legacy-remotes.ts +4 -20
- package/src/commands/local-transport.ts +130 -9
- package/src/commands/log-command.ts +39 -1
- package/src/commands/log-output.ts +31 -4
- package/src/commands/maintenance-schedule-command.ts +418 -0
- package/src/commands/merge-command.ts +10 -0
- package/src/commands/merge-index-command.ts +202 -0
- package/src/commands/merge-one-file.ts +451 -0
- package/src/commands/merge-support.ts +127 -11
- package/src/commands/object-disk-info.ts +169 -0
- package/src/commands/octopus-merge.ts +37 -128
- package/src/commands/promisor-remote.ts +14 -3
- package/src/commands/pull-command.ts +173 -27
- package/src/commands/push-command.ts +50 -5
- package/src/commands/range-diff/range-diff-command.ts +86 -3
- package/src/commands/rebase-command.ts +46 -1
- package/src/commands/ref-filter/for-each-ref-command.ts +4 -3
- package/src/commands/ref-filter/ref-filter.ts +59 -4
- package/src/commands/ref-filter/ref-format.ts +83 -10
- package/src/commands/ref-filter/ref-listing-command.ts +30 -0
- package/src/commands/remote-command.ts +2 -2
- package/src/commands/remote-transport.ts +66 -3
- package/src/commands/repack-command.ts +75 -9
- package/src/commands/repo-command.ts +6 -70
- package/src/commands/reset-command.ts +11 -1
- package/src/commands/restore-command.ts +1 -0
- package/src/commands/rev-list-command.ts +205 -3
- package/src/commands/revert-command.ts +9 -0
- package/src/commands/revision-filenames.ts +32 -4
- package/src/commands/revision-range.ts +2 -2
- package/src/commands/revision-resolver.ts +21 -1
- package/src/commands/serve-repository.ts +34 -8
- package/src/commands/served-lazy-fetch.ts +164 -0
- package/src/commands/signing.ts +18 -10
- package/src/commands/status-color-config.ts +92 -0
- package/src/commands/status-command.ts +50 -2
- package/src/commands/status-format.ts +198 -50
- package/src/commands/tag-command.ts +57 -2
- package/src/commands/tree-restore.ts +17 -0
- package/src/commands/verify-command.ts +84 -12
- package/src/commands/worktree-add-command.ts +2 -0
- package/src/commands/worktree-overwrite-checks.ts +75 -14
- package/src/errors/commit-errors.ts +31 -3
- package/src/errors/git-api-error.ts +7 -0
- package/src/git-command.ts +105 -4
- package/src/git.ts +153 -0
- package/src/remote-config/remote-config-store.ts +16 -0
- package/src/results/cherry-pick-result.ts +4 -3
- package/src/results/diff-output.ts +8 -0
- package/src/results/diff-words.ts +160 -32
- package/src/results/line-prefix-sink.ts +102 -0
- package/src/results/merge-result.ts +4 -3
- package/src/results/rebase-result.ts +5 -0
- package/src/results/revert-result.ts +4 -3
- package/src/transport-command.ts +48 -2
|
@@ -52,6 +52,8 @@ export declare abstract class TransportCommand<T> extends GitCommand<T> {
|
|
|
52
52
|
protected credentialHelper?: HttpCredentialHelper;
|
|
53
53
|
/** git's `warning:` lines of the HTTP client */
|
|
54
54
|
protected warningCallback?: (line: string) => void;
|
|
55
|
+
/** The helper built from `credential.helper` for this command (see {@link httpCredentialHelper}) */
|
|
56
|
+
private configCredentialHelper?;
|
|
55
57
|
constructor(workingCopy: WorkingCopy);
|
|
56
58
|
/**
|
|
57
59
|
* What a lazy fetch during the call reaches the promisor remote with: this command's
|
|
@@ -129,6 +131,14 @@ export declare abstract class TransportCommand<T> extends GitCommand<T> {
|
|
|
129
131
|
* ```
|
|
130
132
|
*/
|
|
131
133
|
setCredentialHelper(helper: HttpCredentialHelper): this;
|
|
134
|
+
/**
|
|
135
|
+
* The credential helper this command's HTTP requests ask: the one given to
|
|
136
|
+
* {@link setCredentialHelper}, else, when the configuration names a `credential.helper`
|
|
137
|
+
* and the host has a hook runner, git's helpers of that configuration (credential.c through
|
|
138
|
+
* {@link credentialHelperOf}: their stderr in the hook output), as git's transports read
|
|
139
|
+
* them; else none.
|
|
140
|
+
*/
|
|
141
|
+
protected httpCredentialHelper(): HttpCredentialHelper | undefined;
|
|
132
142
|
/**
|
|
133
143
|
* Receives the `warning:` lines git's HTTP client prints on stderr (`rate limited, waiting
|
|
134
144
|
* <n> seconds before retry`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-command.d.ts","sourceRoot":"","sources":["../src/transport-command.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"transport-command.d.ts","sourceRoot":"","sources":["../src/transport-command.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,4BAA4B,CAAC;AAOpC,OAAO,EAKL,KAAK,c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;QACnB,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,cAAc,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3D,YAAY,CAAC,IAAI,MAAM,CAAC;QACxB,qEAAqE;QACrE,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B,GAAG,aAAa,CA8ChB;IAED;;;;OAIG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAI9B;IAED,mCAAmC;IACnC,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAErC;;;;;OAKG;IACH,UAAgB,sBAAsB,CACpC,aAAa,GAAE,MAAM,GAAG,MAAiC,GACxD,OAAO,CAAC,MAAM,EAAE,CAAC,CAYnB;IAED;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,gBAAgB,CAShD;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statewalker/vcs-commands",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Git-like VCS commands (commit, checkout, merge, diff, log)",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/statewalker/webrun-vcs/issues"
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@statewalker/webrun-rpc": "^0.15.0",
|
|
58
|
-
"@statewalker/vcs-core": "^0.
|
|
59
|
-
"@statewalker/vcs-
|
|
60
|
-
"@statewalker/vcs-
|
|
61
|
-
"@statewalker/vcs-
|
|
62
|
-
"@statewalker/vcs-
|
|
63
|
-
"@statewalker/vcs-working-tree": "^0.
|
|
58
|
+
"@statewalker/vcs-core": "^0.14.0",
|
|
59
|
+
"@statewalker/vcs-transport": "^0.15.0",
|
|
60
|
+
"@statewalker/vcs-store-mem": "^0.14.0",
|
|
61
|
+
"@statewalker/vcs-store-files": "^0.14.0",
|
|
62
|
+
"@statewalker/vcs-utils": "^0.12.0",
|
|
63
|
+
"@statewalker/vcs-working-tree": "^0.14.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^26.6.4",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"typescript": "^7.0.2",
|
|
70
70
|
"vitest": "^5.1.0",
|
|
71
71
|
"ws": "^8.22.0",
|
|
72
|
-
"@statewalker/vcs-store-
|
|
73
|
-
"@statewalker/vcs-
|
|
74
|
-
"@statewalker/vcs-
|
|
75
|
-
"@statewalker/vcs-transport-lfs": "^0.
|
|
76
|
-
"@statewalker/vcs-utils-node": "^0.
|
|
72
|
+
"@statewalker/vcs-store-sql": "^0.14.0",
|
|
73
|
+
"@statewalker/vcs-store-kv": "^0.14.0",
|
|
74
|
+
"@statewalker/vcs-transport-adapters": "^0.15.0",
|
|
75
|
+
"@statewalker/vcs-transport-lfs": "^0.11.0",
|
|
76
|
+
"@statewalker/vcs-utils-node": "^0.13.0"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"build": "rm -rf dist && rolldown -c && tsc --emitDeclarationOnly --declaration",
|
|
@@ -3,6 +3,7 @@ import { compareGitPaths } from "@statewalker/vcs-utils/encoding";
|
|
|
3
3
|
import {
|
|
4
4
|
applyStatUpdate,
|
|
5
5
|
compareWithWorktree,
|
|
6
|
+
FilterDriverError,
|
|
6
7
|
IndexPathLookup,
|
|
7
8
|
type IndexStatUpdate,
|
|
8
9
|
type NestedRepositoryState,
|
|
@@ -994,7 +995,7 @@ export class AddCommand extends GitCommand<AddResult> {
|
|
|
994
995
|
if (outcome === "added") output.push(`add '${displayPath}'`);
|
|
995
996
|
return "ok";
|
|
996
997
|
} catch (error) {
|
|
997
|
-
if (!(error instanceof AddToIndexError)) throw error;
|
|
998
|
+
if (!(error instanceof AddToIndexError)) throw withEarlierWarnings(error, warnings);
|
|
998
999
|
errors.push(...error.lines);
|
|
999
1000
|
failed.push(path);
|
|
1000
1001
|
return "failed";
|
|
@@ -1666,7 +1667,7 @@ export class AddCommand extends GitCommand<AddResult> {
|
|
|
1666
1667
|
onWarning: (message) => warnings.push(message),
|
|
1667
1668
|
});
|
|
1668
1669
|
} catch (error) {
|
|
1669
|
-
if (!(error instanceof AddToIndexError)) throw error;
|
|
1670
|
+
if (!(error instanceof AddToIndexError)) throw withEarlierWarnings(error, warnings);
|
|
1670
1671
|
errors.push(...error.lines);
|
|
1671
1672
|
failed.push(path);
|
|
1672
1673
|
continue;
|
|
@@ -1829,3 +1830,15 @@ function embeddedRepoAdvice(path: string): string[] {
|
|
|
1829
1830
|
'hint: See "git help submodule" for more information.',
|
|
1830
1831
|
];
|
|
1831
1832
|
}
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* A required filter's death (`FilterDriverError`) with the lines git printed before it (the
|
|
1836
|
+
* conversion's warnings so far: a filter's `error:` lines and stderr); other errors as
|
|
1837
|
+
* they are.
|
|
1838
|
+
*/
|
|
1839
|
+
function withEarlierWarnings(error: unknown, warnings: readonly string[]): unknown {
|
|
1840
|
+
if (error instanceof FilterDriverError && warnings.length > 0) {
|
|
1841
|
+
error.warnings = [...warnings, ...(error.warnings ?? [])];
|
|
1842
|
+
}
|
|
1843
|
+
return error;
|
|
1844
|
+
}
|
|
@@ -8,20 +8,14 @@ import { EMPTY_TREE_ID, FileMode } from "@statewalker/vcs-core";
|
|
|
8
8
|
import { MemoryStagingStore } from "@statewalker/vcs-store-mem";
|
|
9
9
|
import type { XdiffAlgorithm } from "@statewalker/vcs-utils";
|
|
10
10
|
import { compareGitPaths } from "@statewalker/vcs-utils/encoding";
|
|
11
|
-
import {
|
|
12
|
-
applyStatUpdate,
|
|
13
|
-
compareWithWorktree,
|
|
14
|
-
type IndexStatUpdate,
|
|
15
|
-
type StagingEntry,
|
|
16
|
-
statUpdateOf,
|
|
17
|
-
withWorktreeEntries,
|
|
18
|
-
} from "@statewalker/vcs-working-tree";
|
|
11
|
+
import type { StagingEntry } from "@statewalker/vcs-working-tree";
|
|
19
12
|
|
|
20
13
|
import { GitCommand } from "../../git-command.js";
|
|
21
14
|
import type { WorkingCopy } from "../../types.js";
|
|
22
15
|
import { ApplyCommand, bytesToLatin1, latin1ToBytes } from "../apply/index.js";
|
|
23
16
|
import { worktreeModeTrust } from "../core-config.js";
|
|
24
17
|
import { DiffCommand } from "../diff-command.js";
|
|
18
|
+
import { applyIndexStatUpdates, refreshIndexEntries } from "../index-refresh.js";
|
|
25
19
|
import type { PatchBackend } from "./add-patch.js";
|
|
26
20
|
import type { PatchMode } from "./patch-modes.js";
|
|
27
21
|
|
|
@@ -207,46 +201,14 @@ export class IndexRefresh extends GitCommand<string> {
|
|
|
207
201
|
await this.readCurrentIndex(false);
|
|
208
202
|
const staging = this.staging;
|
|
209
203
|
const worktree = this.workingCopy.worktree;
|
|
210
|
-
const entries: StagingEntry[] = [];
|
|
211
|
-
for await (const entry of staging.entryList?.() ?? staging.entries()) entries.push(entry);
|
|
212
204
|
let out = "";
|
|
213
205
|
let hasErrors = false;
|
|
214
|
-
const updates: IndexStatUpdate[] = [];
|
|
215
206
|
if (worktree) {
|
|
216
207
|
const trust = worktreeModeTrust(this.workingCopy, worktree);
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
!entry.skipWorktree &&
|
|
222
|
-
!entry.assumeValid &&
|
|
223
|
-
!entry.intentToAdd &&
|
|
224
|
-
entry.mode !== FileMode.GITLINK;
|
|
225
|
-
let lastUnmerged: string | undefined;
|
|
226
|
-
for await (const { item: entry, current } of withWorktreeEntries(worktree, entries, stated)) {
|
|
227
|
-
if (entry.stage !== 0) {
|
|
228
|
-
if (entry.path !== lastUnmerged) out += `${entry.path}: needs merge\n`;
|
|
229
|
-
hasErrors = true;
|
|
230
|
-
lastUnmerged = entry.path;
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
if (!stated(entry)) continue;
|
|
234
|
-
const compared = await compareWithWorktree(worktree, entry, { trust, indexTime }, current);
|
|
235
|
-
if (compared.kind) continue;
|
|
236
|
-
const update = statUpdateOf(entry, compared);
|
|
237
|
-
if (update && !update.smudge) updates.push(update);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
if (updates.length > 0) {
|
|
241
|
-
const now = Date.now();
|
|
242
|
-
const editor = staging.createEditor();
|
|
243
|
-
for (const update of updates) {
|
|
244
|
-
editor.add({
|
|
245
|
-
path: update.path,
|
|
246
|
-
apply: (existing) => applyStatUpdate(existing, update, now) ?? existing,
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
await editor.finish();
|
|
208
|
+
const refresh = await refreshIndexEntries(staging, worktree, { trust });
|
|
209
|
+
for (const path of refresh.unmerged) out += `${path}: needs merge\n`;
|
|
210
|
+
hasErrors = refresh.unmerged.length > 0;
|
|
211
|
+
await applyIndexStatUpdates(staging, refresh.updates);
|
|
250
212
|
}
|
|
251
213
|
// written whether or not an entry changed (write_locked_index); a gentle refresh that
|
|
252
214
|
// cannot take the lock keeps its result in memory
|
|
@@ -19,12 +19,19 @@ import { withRemoteSession } from "../remote-transport.js";
|
|
|
19
19
|
import { ArchiveCommand } from "./archive-command.js";
|
|
20
20
|
import { uploadArchiveWriterOf } from "./upload-archive-writer.js";
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* What either end of the in-process upload-archive may write ahead of the other: a Linux
|
|
24
|
+
* pipe's capacity, as git's pipes to its upload-archive child (so a request the writer stops
|
|
25
|
+
* reading fails the client as git's does, statewalker/webrun-vcs#516).
|
|
26
|
+
*/
|
|
27
|
+
const LOCAL_HIGH_WATER_MARK = 1 << 16;
|
|
24
28
|
|
|
25
29
|
/** What `git archive --remote` gave. */
|
|
26
30
|
export interface RemoteArchiveResult {
|
|
27
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* 0; 1 when the remote reported an error; 128 when the client died; 141 when the request
|
|
33
|
+
* could not be written (git's client killed by SIGPIPE)
|
|
34
|
+
*/
|
|
28
35
|
exitCode: number;
|
|
29
36
|
/**
|
|
30
37
|
* The archive (git's stdout, or `-o`'s file), the `--list` lines for `--list`; empty when
|
|
@@ -28,6 +28,16 @@ import {
|
|
|
28
28
|
trackableStart,
|
|
29
29
|
upstreamMissingError,
|
|
30
30
|
} from "./branch-tracking.js";
|
|
31
|
+
import {
|
|
32
|
+
applyColumnOption,
|
|
33
|
+
ColumnOptionError,
|
|
34
|
+
columnActive,
|
|
35
|
+
columnConfigOf,
|
|
36
|
+
explicitlyEnableColumn,
|
|
37
|
+
finalizeColopts,
|
|
38
|
+
printColumns,
|
|
39
|
+
terminalColumnsOf,
|
|
40
|
+
} from "./column/index.js";
|
|
31
41
|
import { configBool } from "./merge-config.js";
|
|
32
42
|
import { OperationState } from "./merge-support.js";
|
|
33
43
|
import { canonicalObjectId } from "./object-id-input.js";
|
|
@@ -508,8 +518,10 @@ const quoteLiteral = (s: string) => s.replaceAll("%", "%%");
|
|
|
508
518
|
* `for-each-ref` language, and the reachability filters (`setContains`, `setNoContains`,
|
|
509
519
|
* `setMerged`, `setNoMerged`, `setPointsAt`) take revision names (HEAD when none is given).
|
|
510
520
|
* Colors follow `--color` or `color.branch`/`color.ui` set to `always` (no terminal is
|
|
511
|
-
* assumed), with `color.branch.<slot>`.
|
|
512
|
-
*
|
|
521
|
+
* assumed), with `color.branch.<slot>`. `setColumn` and `column.ui`/`column.branch` lay the
|
|
522
|
+
* lines out in columns as column.c does (`auto` never: no terminal), {@link setColumns} wide
|
|
523
|
+
* (else the host's `$COLUMNS`, else 80); `-v` turns a configured layout off and dies with an
|
|
524
|
+
* explicit `--column`.
|
|
513
525
|
*
|
|
514
526
|
* Based on JGit's ListBranchCommand and git's builtin/branch.c.
|
|
515
527
|
*
|
|
@@ -549,6 +561,8 @@ export class ListBranchCommand extends RefListingCommand<Ref[]> {
|
|
|
549
561
|
private merged: string[] = [];
|
|
550
562
|
private noMerged: string[] = [];
|
|
551
563
|
private compatibility: "2.43" | "2.56" = "2.56";
|
|
564
|
+
private columnOptions: (string | boolean)[] = [];
|
|
565
|
+
private columns?: number;
|
|
552
566
|
|
|
553
567
|
/**
|
|
554
568
|
* Set the listing mode: local branches (default), `-r` (remote-tracking) or `-a` (both).
|
|
@@ -568,6 +582,24 @@ export class ListBranchCommand extends RefListingCommand<Ref[]> {
|
|
|
568
582
|
return this;
|
|
569
583
|
}
|
|
570
584
|
|
|
585
|
+
/**
|
|
586
|
+
* `--column` (`true`: `always`), `--column=<options>` (`column`, `row`, `plain`, `dense`,
|
|
587
|
+
* `nodense`, `always`, `never`, `auto`) or `--no-column` (`false`), over `column.ui` and
|
|
588
|
+
* `column.branch`; each call applies after the previous ones, as git's options do.
|
|
589
|
+
*/
|
|
590
|
+
setColumn(option: string | boolean = true): this {
|
|
591
|
+
this.checkCallable();
|
|
592
|
+
this.columnOptions.push(option);
|
|
593
|
+
return this;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/** The terminal's width columns fill (`$COLUMNS`; default the host's, else 80). */
|
|
597
|
+
setColumns(columns: number): this {
|
|
598
|
+
this.checkCallable();
|
|
599
|
+
this.columns = columns;
|
|
600
|
+
return this;
|
|
601
|
+
}
|
|
602
|
+
|
|
571
603
|
/** `-v` (1) or `-vv` (2): ids and subjects, then upstreams and worktree paths. */
|
|
572
604
|
setVerbose(level: number): this {
|
|
573
605
|
this.checkCallable();
|
|
@@ -727,6 +759,8 @@ export class ListBranchCommand extends RefListingCommand<Ref[]> {
|
|
|
727
759
|
this.checkCallable();
|
|
728
760
|
this.setCallable(false);
|
|
729
761
|
const config = RemoteConfigStore.from(this.workingCopy);
|
|
762
|
+
// git_branch_config: column.ui and column.branch die on a value git refuses
|
|
763
|
+
let colopts = columnConfigOf(this.workingCopy, "branch");
|
|
730
764
|
// refs_resolve_refdup("HEAD")
|
|
731
765
|
const head = await this.refsStore.get("HEAD").catch(() => undefined);
|
|
732
766
|
if (!head) throw new RefFilterError("fatal: failed to resolve HEAD as a valid ref", 128);
|
|
@@ -734,6 +768,18 @@ export class ListBranchCommand extends RefListingCommand<Ref[]> {
|
|
|
734
768
|
if (!detached && !head.target.startsWith("refs/heads/")) {
|
|
735
769
|
throw new RefFilterError("fatal: HEAD not found below refs/heads!", 128);
|
|
736
770
|
}
|
|
771
|
+
// parse_options, then finalize_colopts and -v's check
|
|
772
|
+
for (const option of this.columnOptions) colopts = applyColumnOption(colopts, option);
|
|
773
|
+
colopts = finalizeColopts(colopts);
|
|
774
|
+
if (this.verbose) {
|
|
775
|
+
if (explicitlyEnableColumn(colopts)) {
|
|
776
|
+
throw new ColumnOptionError(
|
|
777
|
+
"fatal: options '--column' and '--verbose' cannot be used together",
|
|
778
|
+
128,
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
colopts = 0;
|
|
782
|
+
}
|
|
737
783
|
// branch.sort keys first, then --sort (parse_opt_ref_sorting appends)
|
|
738
784
|
const sortKeys = [...config.values("branch.sort"), ...this.sortKeys];
|
|
739
785
|
if (sortKeys.length === 0) sortKeys.push("refname");
|
|
@@ -806,13 +852,20 @@ export class ListBranchCommand extends RefListingCommand<Ref[]> {
|
|
|
806
852
|
await sortRefs(items, sorting, format, source, warnings);
|
|
807
853
|
const lines: string[] = [];
|
|
808
854
|
let output = "";
|
|
855
|
+
const columns = columnActive(colopts);
|
|
809
856
|
for (const item of items) {
|
|
810
857
|
const line = await format.format(item);
|
|
811
|
-
|
|
858
|
+
// the column layout keeps every line (print_columns, no --omit-empty)
|
|
859
|
+
if (columns || line.length || !this.omitEmpty) {
|
|
812
860
|
lines.push(line);
|
|
813
|
-
output += `${line}\n`;
|
|
861
|
+
if (!columns) output += `${line}\n`;
|
|
814
862
|
}
|
|
815
863
|
}
|
|
864
|
+
if (columns) {
|
|
865
|
+
output = printColumns(lines, colopts, {
|
|
866
|
+
termColumns: terminalColumnsOf(this.workingCopy, this.columns),
|
|
867
|
+
});
|
|
868
|
+
}
|
|
816
869
|
return {
|
|
817
870
|
output,
|
|
818
871
|
lines,
|
|
@@ -15,6 +15,10 @@ export interface BatchObjectData {
|
|
|
15
15
|
mode?: number;
|
|
16
16
|
/** `%(rest)`: the input line after the object name and its whitespace */
|
|
17
17
|
rest?: string;
|
|
18
|
+
/** `%(objectsize:disk)`: its pack entry's or loose file's size */
|
|
19
|
+
diskSize?: number;
|
|
20
|
+
/** `%(deltabase)`: its pack entry's delta base, else the null id */
|
|
21
|
+
deltaBase?: string;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
type Part =
|
|
@@ -38,12 +42,8 @@ export interface BatchFormat {
|
|
|
38
42
|
needsSize: boolean;
|
|
39
43
|
/** `%(rest)`: input lines are split at their first whitespace */
|
|
40
44
|
splitOnWhitespace: boolean;
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
* `deferUnsupported`: refused only when a local object needs it (`remote-object-info`
|
|
44
|
-
* expands it to nothing, as git)
|
|
45
|
-
*/
|
|
46
|
-
unsupported?: string;
|
|
45
|
+
/** `%(objectsize:disk)` or `%(deltabase)`: the object's pack entry or loose file is asked */
|
|
46
|
+
needsDisk: boolean;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/** The default format, `%(objectname) %(objecttype) %(objectsize)`. */
|
|
@@ -52,20 +52,15 @@ export const DEFAULT_BATCH_FORMAT = "%(objectname) %(objecttype) %(objectsize)";
|
|
|
52
52
|
/**
|
|
53
53
|
* Parses `format` as git's mark_query pass reads it: an atom git does not know dies there
|
|
54
54
|
* (2.43 `unknown format element: <atom>`, 2.5x `bad cat-file format: %(<atom>)`).
|
|
55
|
-
* `%(objectsize:disk)` and `%(deltabase)` are refused: the stores do not report on-disk sizes
|
|
56
|
-
* or delta bases, and printing a made-up value would lie.
|
|
57
55
|
*/
|
|
58
|
-
export function parseBatchFormat(
|
|
59
|
-
format: string,
|
|
60
|
-
compatibility: "2.43" | "2.56",
|
|
61
|
-
options: { deferUnsupported?: boolean } = {},
|
|
62
|
-
): BatchFormat {
|
|
56
|
+
export function parseBatchFormat(format: string, compatibility: "2.43" | "2.56"): BatchFormat {
|
|
63
57
|
const parts: Part[] = [];
|
|
64
58
|
const result: BatchFormat = {
|
|
65
59
|
parts,
|
|
66
60
|
needsType: false,
|
|
67
61
|
needsSize: false,
|
|
68
62
|
splitOnWhitespace: false,
|
|
63
|
+
needsDisk: false,
|
|
69
64
|
};
|
|
70
65
|
let literal = "";
|
|
71
66
|
let at = 0;
|
|
@@ -114,8 +109,7 @@ export function parseBatchFormat(
|
|
|
114
109
|
break;
|
|
115
110
|
case "objectsize:disk":
|
|
116
111
|
case "deltabase":
|
|
117
|
-
|
|
118
|
-
result.unsupported ??= atom;
|
|
112
|
+
result.needsDisk = true;
|
|
119
113
|
break;
|
|
120
114
|
default:
|
|
121
115
|
throw unknownAtom(atom, compatibility);
|
|
@@ -129,9 +123,9 @@ export function parseBatchFormat(
|
|
|
129
123
|
return result;
|
|
130
124
|
}
|
|
131
125
|
|
|
132
|
-
/** The refusal of an atom the
|
|
126
|
+
/** The refusal of an on-disk atom where the store keeps no pack or loose file. */
|
|
133
127
|
export function unsupportedAtom(atom: string): PlumbingError {
|
|
134
|
-
return new PlumbingError(`fatal: cat-file: %(${atom}) is not supported`);
|
|
128
|
+
return new PlumbingError(`fatal: cat-file: %(${atom}) is not supported by this store`);
|
|
135
129
|
}
|
|
136
130
|
|
|
137
131
|
function unknownAtom(atom: string, compatibility: "2.43" | "2.56"): PlumbingError {
|
|
@@ -185,8 +179,13 @@ export function expandBatchFormat(
|
|
|
185
179
|
if (data.mode !== undefined) out += data.mode.toString(8).padStart(6, "0");
|
|
186
180
|
break;
|
|
187
181
|
case "objectsize:disk":
|
|
182
|
+
if (data.diskSize === undefined) throw unsupportedAtom(part.atom);
|
|
183
|
+
out += String(data.diskSize);
|
|
184
|
+
break;
|
|
188
185
|
case "deltabase":
|
|
189
|
-
throw unsupportedAtom(part.atom);
|
|
186
|
+
if (data.deltaBase === undefined) throw unsupportedAtom(part.atom);
|
|
187
|
+
out += data.deltaBase;
|
|
188
|
+
break;
|
|
190
189
|
}
|
|
191
190
|
}
|
|
192
191
|
return out;
|