@vibe-validate/git 0.11.0 → 0.12.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/tree-hash.d.ts.map +1 -1
- package/dist/tree-hash.js +19 -5
- package/dist/tree-hash.js.map +1 -1
- package/package.json +8 -8
- package/LICENSE +0 -21
package/dist/tree-hash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-hash.d.ts","sourceRoot":"","sources":["../src/tree-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"tree-hash.d.ts","sourceRoot":"","sources":["../src/tree-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CA6EtD;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAQvD;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAS9D"}
|
package/dist/tree-hash.js
CHANGED
|
@@ -15,7 +15,7 @@ const GIT_TIMEOUT = 30000; // 30 seconds timeout for git operations
|
|
|
15
15
|
const GIT_OPTIONS = {
|
|
16
16
|
encoding: 'utf8',
|
|
17
17
|
timeout: GIT_TIMEOUT,
|
|
18
|
-
stdio: ['pipe', 'pipe', '
|
|
18
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Get deterministic git tree hash representing current working tree state
|
|
@@ -52,16 +52,30 @@ export async function getGitTreeHash() {
|
|
|
52
52
|
...GIT_OPTIONS,
|
|
53
53
|
env: { ...process.env, GIT_INDEX_FILE: tempIndexFile }
|
|
54
54
|
};
|
|
55
|
-
// Step 3:
|
|
55
|
+
// Step 3: Stage all changes (tracked + untracked) in temp index
|
|
56
|
+
// CRITICAL: Must use `git add --all` (NOT `--intent-to-add` or `--force`)
|
|
57
|
+
//
|
|
58
|
+
// Why NOT --intent-to-add:
|
|
59
|
+
// - Only adds empty placeholders, not actual file content
|
|
60
|
+
// - git write-tree skips intent-to-add entries (treats as non-existent)
|
|
61
|
+
// - Result: unstaged modifications NOT included in tree hash
|
|
62
|
+
//
|
|
63
|
+
// Why NOT --force:
|
|
64
|
+
// - Includes files in .gitignore (secrets, build artifacts, etc.)
|
|
65
|
+
// - Security risk: checksums API keys, passwords, credentials
|
|
66
|
+
// - Non-deterministic: different devs have different ignored files
|
|
67
|
+
// - Breaks cache sharing: same code produces different hashes
|
|
68
|
+
//
|
|
69
|
+
// We need actual content staged so git write-tree includes working directory changes
|
|
56
70
|
try {
|
|
57
|
-
execSync('git add --
|
|
71
|
+
execSync('git add --all', {
|
|
58
72
|
...tempIndexOptions,
|
|
59
73
|
stdio: ['pipe', 'pipe', 'pipe'] // Capture stderr for error handling
|
|
60
74
|
});
|
|
61
75
|
}
|
|
62
76
|
catch (addError) {
|
|
63
|
-
// If no
|
|
64
|
-
// This is fine - just means we
|
|
77
|
+
// If no changes to add, git add fails with "nothing to add"
|
|
78
|
+
// This is fine - just means we have no modifications
|
|
65
79
|
const errorMessage = addError instanceof Error ? addError.message : String(addError);
|
|
66
80
|
if (!errorMessage.includes('nothing')) {
|
|
67
81
|
// Real error - re-throw
|
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,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,wCAAwC;AACnE,MAAM,WAAW,GA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AG,EAAE,EAAE,CAAC;QAC/B,CAAC;QAED,mBAAmB;QACnB,MAAM,IAAI,KAAK,CAAC,sCAAsC,YAAY,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,2BAA2B,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3E,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,IAAI,KAAK,CAAC,iCAAiC,YAAY,EAAE,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,MAAM,cAAc,EAAE,CAAC;QAC/C,MAAM,YAAY,GAAG,MAAM,eAAe,EAAE,CAAC;QAC7C,OAAO,eAAe,KAAK,YAAY,CAAC;IAC1C,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,iEAAiE;QACjE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-validate/git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
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",
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
"README.md",
|
|
17
17
|
"LICENSE"
|
|
18
18
|
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"clean": "rm -rf dist",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
19
25
|
"keywords": [
|
|
20
26
|
"git",
|
|
21
27
|
"validation",
|
|
@@ -41,11 +47,5 @@
|
|
|
41
47
|
"@types/node": "^22.0.0",
|
|
42
48
|
"typescript": "^5.6.0",
|
|
43
49
|
"vitest": "^2.0.0"
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"build": "tsc",
|
|
47
|
-
"clean": "rm -rf dist",
|
|
48
|
-
"test": "vitest run",
|
|
49
|
-
"test:watch": "vitest"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Jeff Dutton
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|