@vibe-validate/git 0.18.4 → 0.19.0-rc.10
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/branch-cleanup.d.ts.map +1 -1
- package/dist/branch-cleanup.js +3 -2
- package/dist/branch-cleanup.js.map +1 -1
- package/dist/branch-sync.d.ts.map +1 -1
- package/dist/branch-sync.js +1 -0
- package/dist/branch-sync.js.map +1 -1
- package/dist/git-executor.d.ts +3 -1
- package/dist/git-executor.d.ts.map +1 -1
- package/dist/git-executor.js +8 -4
- package/dist/git-executor.js.map +1 -1
- package/dist/git-notes.d.ts +8 -7
- package/dist/git-notes.d.ts.map +1 -1
- package/dist/git-notes.js +25 -27
- package/dist/git-notes.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/post-merge-cleanup.js +4 -4
- package/dist/post-merge-cleanup.js.map +1 -1
- package/dist/staging.d.ts +18 -0
- package/dist/staging.d.ts.map +1 -1
- package/dist/staging.js +45 -2
- package/dist/staging.js.map +1 -1
- package/dist/test-helpers.d.ts +144 -0
- package/dist/test-helpers.d.ts.map +1 -0
- package/dist/test-helpers.js +195 -0
- package/dist/test-helpers.js.map +1 -0
- package/dist/tree-hash.d.ts +86 -4
- package/dist/tree-hash.d.ts.map +1 -1
- package/dist/tree-hash.js +180 -8
- package/dist/tree-hash.js.map +1 -1
- package/dist/types.d.ts +23 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -3
package/dist/tree-hash.js
CHANGED
|
@@ -124,23 +124,68 @@ function cleanupStaleIndexes(gitDir) {
|
|
|
124
124
|
* 2. Copy current index to temporary index
|
|
125
125
|
* 3. Mark untracked files with --intent-to-add in temp index
|
|
126
126
|
* 4. Calculate tree hash with git write-tree using temp index
|
|
127
|
-
* 5.
|
|
127
|
+
* 5. Detect and process git submodules (recursive)
|
|
128
|
+
* 6. Return parent hash + optional submodule hashes
|
|
129
|
+
* 7. Clean up temp index file
|
|
128
130
|
*
|
|
129
131
|
* Why this is better than git stash create:
|
|
130
132
|
* - git stash create: includes timestamps in commit → different hash each time
|
|
131
133
|
* - git write-tree: content-based only → same content = same hash (deterministic)
|
|
132
134
|
*
|
|
135
|
+
* Submodule Support (Issue #120):
|
|
136
|
+
* - Detects submodules via `git submodule status`
|
|
137
|
+
* - Recursively calculates tree hash for each submodule
|
|
138
|
+
* - Returns TreeHashResult with parent hash + submodule hashes
|
|
139
|
+
* - Working tree changes in submodules invalidate cache
|
|
140
|
+
* - Git notes store full result for state reconstruction
|
|
141
|
+
*
|
|
142
|
+
* IMPORTANT: This function returns a structured result object, NOT a composite hash.
|
|
143
|
+
* Git notes store the TreeHashResult as-is. The hash field is the parent repo's
|
|
144
|
+
* standard Git SHA-1 hash (40 hex characters). The optional submoduleHashes field
|
|
145
|
+
* records each submodule's tree hash separately.
|
|
146
|
+
*
|
|
147
|
+
* Cache key format in git notes (v0.19.0+):
|
|
148
|
+
* - Parent-only repos: Use parent hash directly (backward compatible)
|
|
149
|
+
* - Repos with submodules: Use parent hash + submodule metadata
|
|
150
|
+
* - Result structure stored in git notes for state reconstruction
|
|
151
|
+
*
|
|
133
152
|
* CRITICAL: Uses GIT_INDEX_FILE to avoid corrupting real index during git commit hooks
|
|
134
153
|
*
|
|
135
|
-
* @returns
|
|
154
|
+
* @returns TreeHashResult containing:
|
|
155
|
+
* - hash: Parent repository tree hash (Git SHA-1, 40 hex chars)
|
|
156
|
+
* - submoduleHashes: Optional record of submodule paths to tree hashes
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* // Repository without submodules (0.18.x compatible)
|
|
160
|
+
* const result = await getGitTreeHash();
|
|
161
|
+
* // { hash: 'abc123...' }
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* // Repository with submodules (v0.19.0+)
|
|
165
|
+
* const result = await getGitTreeHash();
|
|
166
|
+
* // {
|
|
167
|
+
* // hash: 'abc123...', // Parent repo hash
|
|
168
|
+
* // submoduleHashes: {
|
|
169
|
+
* // 'libs/auth': 'xyz789...'
|
|
170
|
+
* // }
|
|
171
|
+
* // }
|
|
172
|
+
*
|
|
136
173
|
* @throws Error if not in a git repository or git command fails
|
|
137
174
|
*/
|
|
175
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- Complexity 18 acceptable for main orchestration function (git operations + submodule handling + cleanup + error handling)
|
|
138
176
|
export async function getGitTreeHash() {
|
|
139
177
|
try {
|
|
140
178
|
// Check if we're in a git repository
|
|
141
179
|
executeGitCommand(['rev-parse', '--is-inside-work-tree'], { timeout: GIT_TIMEOUT });
|
|
142
|
-
// Get git directory and
|
|
143
|
-
|
|
180
|
+
// Get git directory and repository root
|
|
181
|
+
// CRITICAL: Use --absolute-git-dir instead of --git-dir for cross-platform consistency
|
|
182
|
+
// --git-dir returns relative paths (.git vs ../.git) on Windows depending on cwd
|
|
183
|
+
// --absolute-git-dir ensures same path regardless of subdirectory (Issue #127)
|
|
184
|
+
const gitDir = executeGitCommand(['rev-parse', '--absolute-git-dir'], { timeout: GIT_TIMEOUT }).stdout.trim();
|
|
185
|
+
// Get repository root (working tree top level)
|
|
186
|
+
// CRITICAL: git add --all must run from repo root, not subdirectory
|
|
187
|
+
// Running from subdirectory only stages files in that subdirectory (Issue #127)
|
|
188
|
+
const repoRoot = executeGitCommand(['rev-parse', '--show-toplevel'], { timeout: GIT_TIMEOUT }).stdout.trim();
|
|
144
189
|
cleanupStaleIndexes(gitDir);
|
|
145
190
|
const tempIndexFile = `${gitDir}/vibe-validate-temp-index-${process.pid}`;
|
|
146
191
|
try {
|
|
@@ -172,10 +217,13 @@ export async function getGitTreeHash() {
|
|
|
172
217
|
// - Non-deterministic: different devs have different ignored files
|
|
173
218
|
// - Breaks cache sharing: same code produces different hashes
|
|
174
219
|
//
|
|
220
|
+
// CRITICAL: Run from repo root, not subdirectory (Issue #127)
|
|
221
|
+
// Running from subdirectory only stages files in that subdirectory on Windows
|
|
175
222
|
// We need actual content staged so git write-tree includes working directory changes
|
|
176
223
|
const addResult = executeGitCommand(['add', '--all'], {
|
|
177
224
|
timeout: GIT_TIMEOUT,
|
|
178
225
|
env: tempIndexEnv,
|
|
226
|
+
cwd: repoRoot,
|
|
179
227
|
ignoreErrors: true
|
|
180
228
|
});
|
|
181
229
|
// If git add fails and it's not "nothing to add", throw error
|
|
@@ -184,11 +232,44 @@ export async function getGitTreeHash() {
|
|
|
184
232
|
throw new Error(`git add failed: ${addResult.stderr}`);
|
|
185
233
|
}
|
|
186
234
|
// Step 4: Get tree hash using temp index (content-based, no timestamps)
|
|
235
|
+
// Run from repo root for consistency with git add --all
|
|
187
236
|
const treeHash = executeGitCommand(['write-tree'], {
|
|
188
237
|
timeout: GIT_TIMEOUT,
|
|
189
|
-
env: tempIndexEnv
|
|
238
|
+
env: tempIndexEnv,
|
|
239
|
+
cwd: repoRoot
|
|
190
240
|
}).stdout.trim();
|
|
191
|
-
|
|
241
|
+
// Calculate main repo tree hash
|
|
242
|
+
const parentHash = treeHash;
|
|
243
|
+
// Detect submodules
|
|
244
|
+
const submodules = getSubmodules();
|
|
245
|
+
// No submodules - simple case (0.18.x compatible)
|
|
246
|
+
if (submodules.length === 0) {
|
|
247
|
+
return { hash: parentHash };
|
|
248
|
+
}
|
|
249
|
+
// Build submodule hashes record
|
|
250
|
+
const submoduleHashes = {};
|
|
251
|
+
// Add submodule hashes (sorted by path for determinism)
|
|
252
|
+
const sortedSubmodules = submodules.toSorted((a, b) => a.path.localeCompare(b.path));
|
|
253
|
+
for (const sub of sortedSubmodules) {
|
|
254
|
+
// Skip uninitialized submodules (status '-')
|
|
255
|
+
if (sub.status === '-') {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
try {
|
|
259
|
+
const subResult = await getSubmoduleTreeHash(sub.path);
|
|
260
|
+
// Store the submodule's hash in the record
|
|
261
|
+
submoduleHashes[sub.path] = subResult.hash;
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
// Log warning but continue with other submodules
|
|
265
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
266
|
+
console.warn(`⚠️ Failed to hash submodule ${sub.path}: ${errorMsg}`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
hash: parentHash,
|
|
271
|
+
submoduleHashes,
|
|
272
|
+
};
|
|
192
273
|
}
|
|
193
274
|
finally {
|
|
194
275
|
// Step 5: Always clean up temp index file
|
|
@@ -208,7 +289,9 @@ export async function getGitTreeHash() {
|
|
|
208
289
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
209
290
|
if (errorMessage.includes('not a git repository')) {
|
|
210
291
|
// Not in git repo - return "unknown" (caller should skip caching)
|
|
211
|
-
return
|
|
292
|
+
return {
|
|
293
|
+
hash: 'unknown'
|
|
294
|
+
};
|
|
212
295
|
}
|
|
213
296
|
// Other git errors
|
|
214
297
|
throw new Error(`Failed to calculate git tree hash: ${errorMessage}`);
|
|
@@ -243,11 +326,100 @@ export async function hasWorkingTreeChanges() {
|
|
|
243
326
|
try {
|
|
244
327
|
const workingTreeHash = await getGitTreeHash();
|
|
245
328
|
const headTreeHash = await getHeadTreeHash();
|
|
246
|
-
return workingTreeHash !== headTreeHash;
|
|
329
|
+
return workingTreeHash.hash !== headTreeHash;
|
|
247
330
|
}
|
|
248
331
|
catch {
|
|
249
332
|
// If we can't determine, assume there are changes (safe default)
|
|
250
333
|
return true;
|
|
251
334
|
}
|
|
252
335
|
}
|
|
336
|
+
/**
|
|
337
|
+
* Get list of git submodules in current repository
|
|
338
|
+
*
|
|
339
|
+
* Parses output of `git submodule status` to detect submodules.
|
|
340
|
+
* Returns empty array if no submodules or command fails.
|
|
341
|
+
*
|
|
342
|
+
* Output format: " abc123 libs/auth (heads/main)"
|
|
343
|
+
* ^^^^^^ ^^^^^^^^^ (description)
|
|
344
|
+
* hash path
|
|
345
|
+
*
|
|
346
|
+
* @returns Array of submodule information
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* const submodules = getSubmodules();
|
|
350
|
+
* // [{ path: 'libs/auth', status: ' ' }, { path: 'vendor/foo', status: '+' }]
|
|
351
|
+
*
|
|
352
|
+
* @internal Exported for testing
|
|
353
|
+
*/
|
|
354
|
+
export function getSubmodules() {
|
|
355
|
+
// Fast path: if .gitmodules doesn't exist, there are no submodules
|
|
356
|
+
// Avoids 684ms git submodule status call in repos without submodules
|
|
357
|
+
try {
|
|
358
|
+
const repoRoot = executeGitCommand(['rev-parse', '--show-toplevel'], {
|
|
359
|
+
timeout: 5000,
|
|
360
|
+
ignoreErrors: true,
|
|
361
|
+
});
|
|
362
|
+
if (repoRoot.success) {
|
|
363
|
+
const gitmodulesPath = join(repoRoot.stdout.trim(), '.gitmodules');
|
|
364
|
+
if (!existsSync(gitmodulesPath)) {
|
|
365
|
+
return [];
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
// Fall through to git submodule status
|
|
371
|
+
// Only log in debug mode to avoid noise
|
|
372
|
+
if (process.env.VV_DEBUG === '1') {
|
|
373
|
+
console.error('[vv debug] .gitmodules fast-path check failed:', error instanceof Error ? error.message : String(error));
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const result = executeGitCommand(['submodule', 'status'], {
|
|
377
|
+
ignoreErrors: true,
|
|
378
|
+
timeout: GIT_TIMEOUT
|
|
379
|
+
});
|
|
380
|
+
if (!result.success) {
|
|
381
|
+
return []; // No submodules or error
|
|
382
|
+
}
|
|
383
|
+
const submodules = [];
|
|
384
|
+
for (const line of result.stdout.split('\n')) {
|
|
385
|
+
if (!line.trim())
|
|
386
|
+
continue;
|
|
387
|
+
// Parse: " abc123 libs/auth (heads/main)"
|
|
388
|
+
// Group 1: commit hash, Group 2: path
|
|
389
|
+
const match = /^\s*[+-]?([a-f0-9]+)\s+(\S+)/.exec(line);
|
|
390
|
+
if (!match)
|
|
391
|
+
continue;
|
|
392
|
+
submodules.push({
|
|
393
|
+
path: match[2],
|
|
394
|
+
status: line[0] || ' ' // First char is status
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
return submodules;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Calculate tree hash for a git submodule (recursive)
|
|
401
|
+
*
|
|
402
|
+
* Changes to submodule directory, calculates tree hash, then returns to original directory.
|
|
403
|
+
* This is recursive - if the submodule has its own submodules, they will be included.
|
|
404
|
+
*
|
|
405
|
+
* @param submodulePath - Path to submodule relative to current directory
|
|
406
|
+
* @returns Tree hash result for the submodule
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* const result = await getSubmoduleTreeHash('libs/auth');
|
|
410
|
+
* // Returns TreeHashResult for libs/auth submodule
|
|
411
|
+
*
|
|
412
|
+
* @internal Exported for testing
|
|
413
|
+
*/
|
|
414
|
+
export async function getSubmoduleTreeHash(submodulePath) {
|
|
415
|
+
const originalCwd = process.cwd();
|
|
416
|
+
try {
|
|
417
|
+
process.chdir(submodulePath);
|
|
418
|
+
// Recursive! If submodule has submodules, they'll be included
|
|
419
|
+
return await getGitTreeHash();
|
|
420
|
+
}
|
|
421
|
+
finally {
|
|
422
|
+
process.chdir(originalCwd);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
253
425
|
//# sourceMappingURL=tree-hash.js.map
|
package/dist/tree-hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-hash.js","sourceRoot":"","sources":["../src/tree-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,iBAA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& {
|
|
|
42
42
|
export type NotesRef = string & {
|
|
43
43
|
readonly __brand: 'NotesRef';
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Result of git tree hash calculation with submodule support
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Single repo (no submodules)
|
|
50
|
+
* { hash: 'abc123...' }
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Repo with submodules
|
|
54
|
+
* {
|
|
55
|
+
* hash: 'abc123...',
|
|
56
|
+
* submoduleHashes: {
|
|
57
|
+
* 'libs/auth': 'def456...',
|
|
58
|
+
* 'vendor/foo': '789ghi...'
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
62
|
+
export interface TreeHashResult {
|
|
63
|
+
/** Root repository tree hash (40-char SHA-1, git object) */
|
|
64
|
+
hash: TreeHash;
|
|
65
|
+
/** Submodule tree hashes (path → tree hash mapping). Only present when submodules exist. */
|
|
66
|
+
submoduleHashes?: Record<string, TreeHash>;
|
|
67
|
+
}
|
|
45
68
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,IAAI,EAAE,QAAQ,CAAC;IAEf,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC5C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-validate/git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0-rc.10",
|
|
4
4
|
"description": "Git utilities for vibe-validate - tree hash calculation, branch sync, and post-merge cleanup",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"yaml": "^2.8.2",
|
|
42
|
-
"@vibe-validate/utils": "0.
|
|
42
|
+
"@vibe-validate/utils": "0.19.0-rc.10"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^22.19.2",
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsc",
|
|
51
|
-
"clean": "rm -rf dist",
|
|
52
51
|
"test": "vitest run",
|
|
53
52
|
"test:watch": "vitest"
|
|
54
53
|
}
|