@goodfoot/git-mesh 1.0.77 → 1.0.80

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.
@@ -0,0 +1,6 @@
1
+ @goodfoot/git-mesh placeholder. scripts/postinstall.js replaces this file
2
+ with the native binary for your platform. The name ends in .exe and the
3
+ first line intentionally has NO "#!" shebang so npm/yarn/pnpm cmd-shim
4
+ generates a direct-exec wrapper that runs on Windows; Unix ignores the
5
+ .exe suffix and execs by mode bit. If you are seeing this text, the
6
+ postinstall step did not run.
package/man/git-mesh.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH git-mesh 1 "git-mesh 1.0.77"
3
+ .TH git-mesh 1 "git-mesh 1.0.80"
4
4
  .ie \n(.g .ds Aq \(aq
5
5
  .el .ds Aq '
6
6
  .SH NAME
@@ -8,7 +8,7 @@ git\-mesh \- Track implicit semantic dependencies in a git repo.
8
8
  .ie \n(.g .ds Aq \(aq
9
9
  .el .ds Aq '
10
10
  .SH SYNOPSIS
11
- \fBgit\-mesh\fR [\fB\-\-perf\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fIsubcommands\fR]
11
+ \fBgit\-mesh\fR [\fB\-\-perf\fR] [\fB\-\-mesh\-dir\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fIsubcommands\fR]
12
12
  .SH DESCRIPTION
13
13
  .B git mesh
14
14
  tracks implicit semantic dependencies in a Git repository: couplings between
@@ -45,18 +45,18 @@ If the relationship has changed, update the why with
45
45
  .B git mesh why
46
46
  before re-anchoring.
47
47
  .PP
48
- Meshes are stored in a catalog tree at
49
- .IR refs/meshes/v1/catalog
50
- as individual entries using a zero-copy archive format,
51
- so they travel with
52
- .B git fetch
53
- and
54
- .B git push
55
- like branches and tags.
56
- .B git mesh fetch
57
- and
58
- .B git mesh push
59
- keep remote mirrors in sync.
48
+ Each mesh is an ordinary tracked file under the mesh root (default
49
+ .IR .mesh ,
50
+ overridable with
51
+ .BR \-\-mesh\-dir ,
52
+ the
53
+ .I GIT_MESH_DIR
54
+ environment variable, or
55
+ .IR "git config git-mesh.dir" ).
56
+ Meshes are versioned, fetched, and pushed exactly like any other
57
+ tracked file \[em] stage and commit edits with
58
+ .B git add .mesh && git commit
59
+ \&.
60
60
  .PP
61
61
  Bare invocations:
62
62
  .RS 4
@@ -76,6 +76,9 @@ Emit performance timings for major git\-mesh operation groups to stderr.
76
76
 
77
77
  Can also be enabled with `GIT_MESH_PERF=1`.
78
78
  .TP
79
+ \fB\-\-mesh\-dir\fR \fI<MESH_DIR>\fR
80
+ Mesh root directory (default: .mesh). Overrides GIT_MESH_DIR and git config git\-mesh.dir
81
+ .TP
79
82
  \fB\-h\fR, \fB\-\-help\fR
80
83
  Print help (see a summary with \*(Aq\-h\*(Aq)
81
84
  .TP
@@ -85,6 +88,9 @@ Print version
85
88
  .el .ds Aq '
86
89
  .SH SUBCOMMANDS
87
90
  .TP
91
+ git\-mesh\-show(1)
92
+ Show the named mesh — its anchors, why, and config. Equivalent to the bare `git mesh <name>` positional form
93
+ .TP
88
94
  git\-mesh\-list(1)
89
95
  List files and anchors currently tracked by a mesh
90
96
  .TP
@@ -92,56 +98,32 @@ git\-mesh\-stale(1)
92
98
  Report anchors whose content has drifted from their anchored state
93
99
  .TP
94
100
  git\-mesh\-add(1)
95
- Stage anchors to add on the next mesh commit
101
+ Add anchors to a mesh, writing the mesh file under the mesh root. Stage and commit the change with `git add .mesh && git commit`
96
102
  .TP
97
103
  git\-mesh\-remove(1)
98
- Stage anchors to remove on the next mesh commit
104
+ Remove anchors from a mesh, editing the mesh file under the mesh root. Stage and commit the change with `git add .mesh && git commit`
99
105
  .TP
100
106
  git\-mesh\-why(1)
101
107
  Read or stage the mesh\*(Aqs why — a one\-sentence definition of the subsystem, flow, or concern the anchors collectively form
102
108
  .TP
103
- git\-mesh\-commit(1)
104
- Resolve staged operations and write a mesh commit
105
- .TP
106
- git\-mesh\-restore(1)
107
- Clear the staging area
108
- .TP
109
- git\-mesh\-revert(1)
110
- Fast\-forward a mesh to a past state
111
- .TP
112
109
  git\-mesh\-delete(1)
113
110
  Delete a mesh
114
111
  .TP
115
112
  git\-mesh\-move(1)
116
113
  Rename a mesh
117
114
  .TP
118
- git\-mesh\-config(1)
119
- Read or stage mesh\-level resolver options
120
- .TP
121
- git\-mesh\-fetch(1)
122
- Fetch mesh and anchor refs from a remote
123
- .TP
124
- git\-mesh\-push(1)
125
- Push mesh and anchor refs to a remote
126
- .TP
127
115
  git\-mesh\-doctor(1)
128
116
  Audit the local mesh setup
129
117
  .TP
130
- git\-mesh\-hooks(1)
131
- Git hook shortcuts (post\-commit, post\-rewrite)
132
- .TP
133
118
  git\-mesh\-advice(1)
134
119
  Append events and flush session\-scoped advice
135
120
  .TP
136
- git\-mesh\-rewrite(1)
137
- Advance anchor SHAs after a history rewrite (post\-rewrite hook)
138
- .TP
139
121
  git\-mesh\-help(1)
140
122
  Print this message or the help of the given subcommand(s)
141
123
  .ie \n(.g .ds Aq \(aq
142
124
  .el .ds Aq '
143
125
  .SH VERSION
144
- v1.0.77
126
+ v1.0.80
145
127
  .SH EXAMPLES
146
128
  Anchor a new mesh alongside a code change:
147
129
  .PP
@@ -152,8 +134,8 @@ git mesh add billing/charge-request-contract \e
152
134
  git mesh why billing/charge-request-contract \e
153
135
  -m "The doc states the request body shape the parser honors; \e
154
136
  the doc is the source of truth when they disagree."
137
+ git add .mesh
155
138
  git commit -m "Wire checkout to charge API"
156
- # post-commit hook runs: git mesh commit
157
139
  .fi
158
140
  .RE
159
141
  .PP
@@ -166,7 +148,7 @@ git mesh add auth/token-contract --at HEAD \e
166
148
  packages/auth/crypto.ts#L12-L40
167
149
  git mesh why auth/token-contract \e
168
150
  -m "Token verification depends on signature verification."
169
- git mesh commit auth/token-contract
151
+ git add .mesh && git commit -m "Document token/crypto coupling"
170
152
  .fi
171
153
  .RE
172
154
  .PP
@@ -176,7 +158,7 @@ Check for drift and inspect a mesh:
176
158
  .nf
177
159
  git mesh stale
178
160
  git mesh billing/charge-request-contract
179
- git mesh billing/charge-request-contract --log
161
+ git mesh show billing/charge-request-contract
180
162
  .fi
181
163
  .RE
182
164
  .SH SEE ALSO
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@goodfoot/git-mesh",
3
- "version": "1.0.77",
4
- "bin": "bin/git-mesh",
3
+ "version": "1.0.80",
4
+ "bin": "bin/git-mesh.exe",
5
5
  "man": [
6
6
  "man/git-mesh.1"
7
7
  ],
@@ -18,16 +18,16 @@
18
18
  "udeps": "bash scripts/cleanup-stale-target.sh && env CARGO_TARGET_DIR=\"${GIT_MESH_CARGO_TARGET_ROOT:-./target-cache}/udeps\" cargo +nightly udeps"
19
19
  },
20
20
  "files": [
21
- "bin/",
21
+ "bin/git-mesh.exe",
22
22
  "man/",
23
23
  "scripts/postinstall.js"
24
24
  ],
25
25
  "optionalDependencies": {
26
- "@goodfoot/git-mesh-darwin-arm64": "1.0.77",
27
- "@goodfoot/git-mesh-darwin-x64": "1.0.77",
28
- "@goodfoot/git-mesh-linux-arm64": "1.0.77",
29
- "@goodfoot/git-mesh-linux-x64": "1.0.77",
30
- "@goodfoot/git-mesh-win32-x64": "1.0.77"
26
+ "@goodfoot/git-mesh-darwin-arm64": "1.0.80",
27
+ "@goodfoot/git-mesh-darwin-x64": "1.0.80",
28
+ "@goodfoot/git-mesh-linux-arm64": "1.0.80",
29
+ "@goodfoot/git-mesh-linux-x64": "1.0.80",
30
+ "@goodfoot/git-mesh-win32-x64": "1.0.80"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
@@ -99,35 +99,44 @@ function main() {
99
99
  buildFromSource(sourceBinary, sourceBinaryName);
100
100
  }
101
101
 
102
- // Install the native binary at the single `bin` path npm wrapped. The
103
- // committed placeholder has no shebang, so npm/yarn/pnpm generated
104
- // direct-exec wrappers pointing here; replacing it in place makes them run
105
- // the real binary. Extensionless on every platform Windows CreateProcess
106
- // executes a valid PE by explicit path regardless of extension.
107
- const binGitMesh = path.join(__dirname, '..', 'bin', 'git-mesh');
108
-
102
+ // Always write to bin/git-mesh.exe the package.json `bin` field points
103
+ // here on every platform. The `.exe` extension plus a no-shebang stub makes
104
+ // npm's cmd-shim (generated at install time, before this postinstall) emit
105
+ // a direct exec on Windows; Unix executes by mode bit + ELF/Mach-O header
106
+ // and ignores the `.exe` suffix entirely. No resident Node process — the
107
+ // `git-mesh` command execs the native binary directly. Same pattern as
108
+ // Bun's and Claude Code's npm packages.
109
+ const binGitMesh = path.join(__dirname, '..', 'bin', 'git-mesh.exe');
110
+
111
+ // Hardlink first (instant, zero extra disk for the ~16MB binary; src and
112
+ // dest are both under node_modules so same-filesystem is the common case),
113
+ // then fall back to copy across devices / on link-permission errors.
109
114
  try {
110
- fs.unlinkSync(binGitMesh);
111
- } catch (error) {
112
- if (error.code !== 'ENOENT') {
113
- fail(`@goodfoot/git-mesh: Could not remove existing binary at ${binGitMesh}.`, error);
114
- }
115
- }
116
-
117
- // Try symlink first, fall back to copy
118
- try {
119
- fs.symlinkSync(sourceBinary, binGitMesh);
120
- } catch (symlinkError) {
121
- try {
115
+ fs.linkSync(sourceBinary, binGitMesh);
116
+ } catch (linkError) {
117
+ if (linkError.code === 'EEXIST') {
118
+ try {
119
+ fs.unlinkSync(binGitMesh);
120
+ fs.linkSync(sourceBinary, binGitMesh);
121
+ } catch {
122
+ fs.copyFileSync(sourceBinary, binGitMesh);
123
+ }
124
+ } else if (linkError.code === 'EXDEV' || linkError.code === 'EPERM') {
122
125
  fs.copyFileSync(sourceBinary, binGitMesh);
123
- fs.chmodSync(binGitMesh, 0o755);
124
- } catch (copyError) {
125
- fail(
126
- `@goodfoot/git-mesh: Could not install binary from ${sourceBinary} to ${binGitMesh}.`,
127
- new Error(`symlink failed: ${symlinkError.message}\ncopy failed: ${copyError.message}`)
128
- );
126
+ } else {
127
+ try {
128
+ fs.copyFileSync(sourceBinary, binGitMesh);
129
+ } catch (copyError) {
130
+ fail(
131
+ `@goodfoot/git-mesh: Could not install binary from ${sourceBinary} to ${binGitMesh}.`,
132
+ new Error(`link failed: ${linkError.message}\ncopy failed: ${copyError.message}`)
133
+ );
134
+ }
129
135
  }
130
136
  }
137
+ if (process.platform !== 'win32') {
138
+ fs.chmodSync(binGitMesh, 0o755);
139
+ }
131
140
 
132
141
  console.log(`@goodfoot/git-mesh: Installed git-mesh from ${packageName}`);
133
142
  }
package/bin/.gitkeep DELETED
File without changes
package/bin/git-mesh DELETED
@@ -1,5 +0,0 @@
1
- @goodfoot/git-mesh placeholder. This file is replaced by scripts/postinstall.js
2
- with the native binary for your platform. Its first line intentionally has NO
3
- "#!" shebang so npm/yarn/pnpm cmd-shim generates direct-exec .cmd/.ps1/sh
4
- wrappers (no /bin/sh, no node) that run the native binary installed here.
5
- If you are seeing this text executed, the postinstall step did not run.