@ibgib/vcs-gib 0.0.47 → 0.0.51
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/VCS_CLI_USER_GUIDE.md +12 -7
- package/dist/AUTO-GENERATED-version.d.mts +1 -1
- package/dist/AUTO-GENERATED-version.mjs +1 -1
- package/dist/bootstrap/node-bootstrap.mjs +6 -6
- package/dist/bootstrap/node-bootstrap.mjs.map +1 -1
- package/dist/cli/cli-arg-parser.d.mts +2 -0
- package/dist/cli/cli-arg-parser.d.mts.map +1 -1
- package/dist/cli/cli-arg-parser.mjs +12 -1
- package/dist/cli/cli-arg-parser.mjs.map +1 -1
- package/dist/cli/cli-constants.d.mts +2 -0
- package/dist/cli/cli-constants.d.mts.map +1 -1
- package/dist/cli/cli-constants.mjs +15 -1
- package/dist/cli/cli-constants.mjs.map +1 -1
- package/dist/cli/commands/cli-add-cmd.mjs +3 -3
- package/dist/cli/commands/cli-add-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-branch-cmd.mjs +3 -3
- package/dist/cli/commands/cli-branch-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-commit-cmd.d.mts +2 -1
- package/dist/cli/commands/cli-commit-cmd.d.mts.map +1 -1
- package/dist/cli/commands/cli-commit-cmd.mjs +4 -3
- package/dist/cli/commands/cli-commit-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-init-cmd.mjs +6 -6
- package/dist/cli/commands/cli-init-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-log-cmd.d.mts.map +1 -1
- package/dist/cli/commands/cli-log-cmd.mjs +2 -18
- package/dist/cli/commands/cli-log-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-merge-cmd.mjs +3 -3
- package/dist/cli/commands/cli-merge-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-reset-cmd.d.mts +1 -1
- package/dist/cli/commands/cli-reset-cmd.mjs +9 -9
- package/dist/cli/commands/cli-reset-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-restore-cmd.mjs +3 -3
- package/dist/cli/commands/cli-restore-cmd.mjs.map +1 -1
- package/dist/cli/commands/cli-status-cmd.d.mts +1 -1
- package/dist/cli/commands/cli-status-cmd.d.mts.map +1 -1
- package/dist/cli/commands/cli-status-cmd.mjs +5 -2
- package/dist/cli/commands/cli-status-cmd.mjs.map +1 -1
- package/dist/cli/vcs-cli-main.d.mts.map +1 -1
- package/dist/cli/vcs-cli-main.mjs +6 -5
- package/dist/cli/vcs-cli-main.mjs.map +1 -1
- package/dist/cli/vcs-repo-helper.d.mts.map +1 -1
- package/dist/cli/vcs-repo-helper.mjs +7 -7
- package/dist/cli/vcs-repo-helper.mjs.map +1 -1
- package/package.json +6 -6
- package/src/AUTO-GENERATED-version.mts +1 -1
- package/src/bootstrap/node-bootstrap.mts +6 -6
- package/src/cli/cli-arg-parser.mts +14 -0
- package/src/cli/cli-constants.mts +19 -2
- package/src/cli/cli-e2e.respec.mts +7 -7
- package/src/cli/commands/cli-add-cmd.mts +3 -3
- package/src/cli/commands/cli-branch-cmd.mts +3 -3
- package/src/cli/commands/cli-commit-cmd.mts +5 -2
- package/src/cli/commands/cli-init-cmd.mts +6 -6
- package/src/cli/commands/cli-log-cmd.mts +2 -23
- package/src/cli/commands/cli-merge-cmd.mts +3 -3
- package/src/cli/commands/cli-reset-cmd.mts +9 -9
- package/src/cli/commands/cli-restore-cmd.mts +3 -3
- package/src/cli/commands/cli-status-cmd.mts +5 -2
- package/src/cli/commands/commit-log-cmd.respec.mts +11 -11
- package/src/cli/commands/delete-files.respec.mts +366 -0
- package/src/cli/commands/init-cmd.respec.mts +1 -1
- package/src/cli/commands/reset-restore-cmd.respec.mts +3 -3
- package/src/cli/commands/status-add-cmd.respec.mts +4 -4
- package/src/cli/vcs-cli-main.mts +6 -5
- package/src/cli/vcs-repo-helper.mts +7 -8
- package/src/vcs-gib.respec.mts +9 -9
- package/tsconfig.test.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vcs-gib_test_output.md +18 -18
package/src/cli/vcs-cli-main.mts
CHANGED
|
@@ -48,7 +48,7 @@ Commands:
|
|
|
48
48
|
branch [name] List or create branches
|
|
49
49
|
checkout <branch> Switch to a specified branch and project worktree
|
|
50
50
|
merge <branch> Merge specified branch into active branch
|
|
51
|
-
reset [path...] Unstage specified files from
|
|
51
|
+
reset [path...] Unstage specified files from galaxy (-a, --all for all)
|
|
52
52
|
restore [path...] Restore working tree files or unstage (--staged)
|
|
53
53
|
|
|
54
54
|
Flags:
|
|
@@ -58,7 +58,7 @@ Flags:
|
|
|
58
58
|
-b <branch> Target branch name
|
|
59
59
|
-c, --comments Show full comment content in status
|
|
60
60
|
-a, --all Stage all tracked/untracked files (for add/reset)
|
|
61
|
-
-s, --staged Unstage specified files from
|
|
61
|
+
-s, --staged Unstage specified files from galaxy (for restore)
|
|
62
62
|
-w, --worktree Revert physical working tree files (for restore)
|
|
63
63
|
-y, --yes Automatically confirm interactive prompts
|
|
64
64
|
-f, --force Force operation execution
|
|
@@ -76,7 +76,7 @@ export async function main({
|
|
|
76
76
|
const lc = `${lcFile}[${main.name}]`;
|
|
77
77
|
try {
|
|
78
78
|
if (logalot) {
|
|
79
|
-
console.log(`${lc} starting... (I:
|
|
79
|
+
console.log(`${lc} starting... (I: 600b85201b637bb3581aa4eff3c37826)`);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const parsed = parseVcsArgs(argv);
|
|
@@ -120,6 +120,7 @@ export async function main({
|
|
|
120
120
|
case VCS_SUBCOMMANDS.COMMIT: {
|
|
121
121
|
await executeCommitCmd({
|
|
122
122
|
message: parsed.flags.message,
|
|
123
|
+
keepEmptyFolders: parsed.flags.keepEmptyFolders,
|
|
123
124
|
});
|
|
124
125
|
break;
|
|
125
126
|
}
|
|
@@ -197,7 +198,7 @@ export async function main({
|
|
|
197
198
|
const branchMatch = cleanMsg.match(/["']([^"']+)["']/);
|
|
198
199
|
const name = branchMatch ? branchMatch[1] : '';
|
|
199
200
|
console.error(name ? `fatal: a branch named '${name}' already exists.` : `fatal: ${cleanMsg}`);
|
|
200
|
-
} else if (cleanMsg.toLowerCase().includes('not found in
|
|
201
|
+
} else if (cleanMsg.toLowerCase().includes('not found in galaxyIbgib') || cleanMsg.toLowerCase().includes('not found on branch')) {
|
|
201
202
|
const branchMatch = cleanMsg.match(/\(([^)]+)\)/) || cleanMsg.match(/['"]([^'"]+)['"]/);
|
|
202
203
|
const name = branchMatch ? branchMatch[1] : '';
|
|
203
204
|
console.error(name ? `error: pathspec '${name}' did not match any file(s) known to ibgib` : `error: ${cleanMsg}`);
|
|
@@ -207,7 +208,7 @@ export async function main({
|
|
|
207
208
|
return 1;
|
|
208
209
|
} finally {
|
|
209
210
|
if (logalot) {
|
|
210
|
-
console.log(`${lc} complete. (I:
|
|
211
|
+
console.log(`${lc} complete. (I: d68908b0f736b838ef4ac3b8d266d826)`);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
}
|
|
@@ -5,18 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import path from 'node:path';
|
|
8
|
-
import fs from 'node:fs/promises';
|
|
9
8
|
|
|
10
9
|
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
11
10
|
import { VcsRepository, WorkspaceProjectionSpaceFactory } from '@ibgib/core-gib/dist/vcs/vcs-repository.mjs';
|
|
12
11
|
import { resolveContextualBranchName } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
|
|
13
|
-
import {
|
|
12
|
+
import { getB2tFSGalaxyIbGib } from '@ibgib/core-gib/dist/vcs/galaxy/galaxy-helper.mjs';
|
|
14
13
|
import { getOrCreateBranchSpace } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
|
|
14
|
+
import { B2TFS_BRANCH_DEFAULT_NAME } from '@ibgib/core-gib/dist/vcs/branch/branch-constants.mjs';
|
|
15
15
|
import { getOrCreateWorkspaceProjectionSpace } from '@ibgib/node-gib/dist/vcs/workspace-space-helper.mjs';
|
|
16
16
|
|
|
17
17
|
import { GLOBAL_LOG_A_LOT } from '../vcs-gib-constants.mjs';
|
|
18
18
|
import { bootstrapVcsMetaspace } from '../bootstrap/node-bootstrap.mjs';
|
|
19
|
-
import { B2TFS_BRANCH_DEFAULT_NAME } from '@ibgib/core-gib/dist/vcs/branch/branch-constants.mjs';
|
|
20
19
|
|
|
21
20
|
const logalot = GLOBAL_LOG_A_LOT;
|
|
22
21
|
|
|
@@ -55,17 +54,17 @@ export async function openVcsRepository({
|
|
|
55
54
|
throw new Error(`fatal: not an ibgib repository (or any of the parent directories): ${vcsFolderName}`);
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
// 2. Fetch authoritative in-band
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
throw new Error(`fatal: not an ibgib repository (
|
|
57
|
+
// 2. Fetch authoritative in-band galaxy from localSpace
|
|
58
|
+
const galaxyIbGib = await getB2tFSGalaxyIbGib({ space: localSpace, metaspace });
|
|
59
|
+
if (!galaxyIbGib) {
|
|
60
|
+
throw new Error(`fatal: not an ibgib repository (galaxy not found in ${vcsPath}) (E: 615a88627ba8daf8cbb9684bbd8d3826)`);
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
// 3. Determine active branch and worktree directory
|
|
65
64
|
const activeBranchName = branchName || resolveContextualBranchName({
|
|
66
65
|
targetDir: absTargetDir,
|
|
67
66
|
repoRoot,
|
|
68
|
-
|
|
67
|
+
galaxyIbGib,
|
|
69
68
|
});
|
|
70
69
|
|
|
71
70
|
const activeWorktreeDir = activeBranchName === B2TFS_BRANCH_DEFAULT_NAME
|
package/src/vcs-gib.respec.mts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module vcs-gib.respec.node
|
|
3
3
|
*
|
|
4
4
|
* Full Engine Cycle Integration Tests for @ibgib/vcs-gib.
|
|
5
|
-
* Tests Metaspace bootstrap, canonical ib atoms, item creation, branch spaces, and
|
|
5
|
+
* Tests Metaspace bootstrap, canonical ib atoms, item creation, branch spaces, and galaxy tracking.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import path from 'node:path';
|
|
@@ -14,7 +14,7 @@ import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
|
|
|
14
14
|
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
15
15
|
import { getB2tFSItemIb } from '@ibgib/core-gib/dist/vcs/item/item-atom-helper.mjs';
|
|
16
16
|
import { createB2tFSBranchIbGib, getB2tFSBranchSpaceName } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
|
|
17
|
-
import {
|
|
17
|
+
import { createB2tFSGalaxyIbGib, } from '@ibgib/core-gib/dist/vcs/galaxy/galaxy-helper.mjs';
|
|
18
18
|
import { B2tFSItemIbGib_V1 } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
|
|
19
19
|
import { getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
|
|
20
20
|
import { getSpaceIdFromIb } from '@ibgib/core-gib/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs';
|
|
@@ -43,8 +43,8 @@ await respecfully(lc, `vcs-gib Full Engine Cycle`, async () => {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
await respecfully(lc, `Branch Spaces &
|
|
47
|
-
await ifWe(lc, `initializes metaspace, creates branch, and registers
|
|
46
|
+
await respecfully(lc, `Branch Spaces & Galaxy Tracking`, async () => {
|
|
47
|
+
await ifWe(lc, `initializes metaspace, creates branch, and registers galaxy`, async () => {
|
|
48
48
|
const testDir = path.join(process.cwd(), '.test_cycle_repo');
|
|
49
49
|
try {
|
|
50
50
|
const { metaspace, localSpace } = await bootstrapVcsMetaspace({
|
|
@@ -86,17 +86,17 @@ await respecfully(lc, `vcs-gib Full Engine Cycle`, async () => {
|
|
|
86
86
|
spaceId: localSpaceId,
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
// Create
|
|
90
|
-
const
|
|
89
|
+
// Create Galaxy IbGib
|
|
90
|
+
const galaxyIbGib = await createB2tFSGalaxyIbGib({
|
|
91
91
|
activeSpaceId: localSpaceId,
|
|
92
92
|
space: localSpace,
|
|
93
93
|
activeBranchName: branchName,
|
|
94
94
|
sqBranchAddr,
|
|
95
95
|
metaspace,
|
|
96
96
|
});
|
|
97
|
-
iReckon(lc,
|
|
98
|
-
iReckon(lc,
|
|
99
|
-
iReckon(lc,
|
|
97
|
+
iReckon(lc, galaxyIbGib.data?.mySpaceId).willEqual(localSpaceId);
|
|
98
|
+
iReckon(lc, galaxyIbGib.data?.staged_item).willEqual([]);
|
|
99
|
+
iReckon(lc, galaxyIbGib.rel8ns?.staged_item).isGonnaBeFalsy();
|
|
100
100
|
} finally {
|
|
101
101
|
await fs.rm(testDir, { recursive: true, force: true });
|
|
102
102
|
}
|