git-span 1.0.145 → 1.1.1

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 CHANGED
@@ -8,7 +8,7 @@ The primary CLI surface lives in `src/cli/mod.rs`. Run `git span --help` or `git
8
8
 
9
9
  `git span drift` (and related resolution paths) are backed by a single persistent cache: a SQLite database at `<common_dir>/span/store.db` (plus its `-wal` and `-shm` companions), implemented in `src/resolver/store/`. This is the whole on-disk cache footprint — remove `store.db*` to reset it. Setting `GIT_SPAN_CACHE=0` disables it for a run.
10
10
 
11
- The store is bounded by a byte high-water mark (256 MiB by default; override with `GIT_SPAN_STORE_MAX_BYTES` or `git config git-span.storeMaxBytes`), with transactional GC that runs only when a publish crosses the cap. It lives in the Git *common* directory, so it is shared across linked worktrees of one clone on one host; it is not shared cross-host or cross-clone. Earlier releases kept two separate caches (a `cache/v1/` filesystem trail store and a `stale-cache.db`); both were replaced by this one store and leave no files behind on a fresh clone.
11
+ The store is bounded by a count-based sweep: stale non-live generations are swept to a 16-generation reuse buffer, and maintenance runs after a publish and at drift open. It lives in the Git *common* directory, so it is shared across linked worktrees of one clone on one host; it is not shared cross-host or cross-clone. Earlier releases kept two separate caches (a `cache/v1/` filesystem trail store and a `stale-cache.db`); both were replaced by this one store and leave no files behind on a fresh clone.
12
12
 
13
13
  ### The shared executable-digest store
14
14
 
package/bin/git-span.exe CHANGED
@@ -2,5 +2,11 @@ git-span placeholder. scripts/postinstall.js replaces this file
2
2
  with the native binary for your platform. The name ends in .exe and the
3
3
  first line intentionally has NO "#!" shebang so npm/yarn/pnpm cmd-shim
4
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.
5
+ .exe suffix and execs by mode bit. This file is tracked NON-executable
6
+ (mode 644) on purpose: without a shebang, execvp()'s ENOEXEC fallback
7
+ would otherwise re-exec it via /bin/sh, which parses this very sentence
8
+ as a command line and recurses into itself indefinitely (a fork bomb —
9
+ see the git-span-fork-bomb incident report). Non-executable makes execvp
10
+ fail fast with EACCES instead. postinstall.js re-chmods to 0755 only
11
+ after replacing this text with the real binary. If you are seeing this
12
+ text, the postinstall step did not run.
package/man/git-span.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH git-span 1 "git-span 1.0.145"
3
+ .TH git-span 1 "git-span 1.1.1"
4
4
  .ie \n(.g .ds Aq \(aq
5
5
  .el .ds Aq '
6
6
  .SH NAME
@@ -136,7 +136,7 @@ Print this message or the help of the given subcommand(s)
136
136
  .ie \n(.g .ds Aq \(aq
137
137
  .el .ds Aq '
138
138
  .SH VERSION
139
- v1.0.145
139
+ v1.1.1
140
140
  .SH EXAMPLES
141
141
  Anchor a new span alongside a code change:
142
142
  .PP
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "git-span",
3
- "version": "1.0.145",
3
+ "version": "1.1.1",
4
4
  "bin": "bin/git-span.exe",
5
5
  "man": [
6
6
  "man/git-span.1"
7
7
  ],
8
8
  "scripts": {
9
9
  "postinstall": "node scripts/postinstall.js",
10
- "build:man": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo run --quiet --locked --bin gen-manpage -- man/git-span.1",
11
- "build": "yarn build:man && bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo build --release --locked",
10
+ "build:man": "bash scripts/with-target-lock.sh shared env CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-/var/cache/git-span/cargo-target}/git-span/build\" cargo run --quiet --locked --bin gen-manpage -- man/git-span.1",
11
+ "build": "yarn build:man",
12
12
  "build:local": "bash scripts/build-local.sh",
13
13
  "build:clean": "bash scripts/cleanup-stale-target.sh && bash scripts/clean-shared-build.sh && yarn build",
14
- "test": "bash scripts/with-target-lock.sh shared env CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo nextest run --build-jobs 1 --locked",
15
- "lint": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 RUSTFLAGS=\"-W unused -W dead-code\" CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/check\" cargo clippy --quiet --locked -- -D warnings",
16
- "typecheck": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 RUSTFLAGS=\"-W unused -W dead-code\" CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/check\" cargo check --quiet --locked",
17
- "bench:check": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo bench --no-run --locked --features bench-corpus",
18
- "bench": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo bench --locked",
19
- "udeps": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/udeps\" cargo +nightly udeps"
14
+ "test": "bash scripts/with-target-lock.sh shared env CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-/var/cache/git-span/cargo-target}/git-span/build\" cargo nextest run --locked",
15
+ "lint": "bash scripts/with-target-lock.sh shared env RUSTFLAGS=\"-W unused -W dead-code\" CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-/var/cache/git-span/cargo-target}/git-span/check\" cargo clippy --quiet --locked -- -D warnings",
16
+ "typecheck": "bash scripts/with-target-lock.sh shared env RUSTFLAGS=\"-W unused -W dead-code\" CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-/var/cache/git-span/cargo-target}/git-span/check\" cargo clippy --quiet --locked -- -D warnings",
17
+ "bench:check": "bash scripts/with-target-lock.sh shared env CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-/var/cache/git-span/cargo-target}/git-span/build\" cargo bench --no-run --locked --features bench-corpus",
18
+ "bench": "bash scripts/with-target-lock.sh shared env CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-/var/cache/git-span/cargo-target}/git-span/build\" cargo bench --locked",
19
+ "udeps": "bash scripts/with-target-lock.sh shared env CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-/var/cache/git-span/cargo-target}/git-span/udeps\" cargo +nightly udeps"
20
20
  },
21
21
  "files": [
22
22
  "bin/git-span.exe",
@@ -24,11 +24,11 @@
24
24
  "scripts/postinstall.js"
25
25
  ],
26
26
  "optionalDependencies": {
27
- "git-span-darwin-arm64": "1.0.145",
28
- "git-span-darwin-x64": "1.0.145",
29
- "git-span-linux-arm64": "1.0.145",
30
- "git-span-linux-x64": "1.0.145",
31
- "git-span-win32-x64": "1.0.145"
27
+ "git-span-darwin-arm64": "1.1.1",
28
+ "git-span-darwin-x64": "1.1.1",
29
+ "git-span-linux-arm64": "1.1.1",
30
+ "git-span-linux-x64": "1.1.1",
31
+ "git-span-win32-x64": "1.1.1"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
@@ -71,9 +71,31 @@ function isInsideSourceTree() {
71
71
  return false;
72
72
  }
73
73
 
74
+ function hasUsableBinaryInSourceTree() {
75
+ const platform = PLATFORM_MAP[process.platform];
76
+ const arch = ARCH_MAP[process.arch];
77
+ if (!platform || !arch) {
78
+ return false;
79
+ }
80
+ const sourceBinaryName = process.platform === 'win32' ? 'git-span.exe' : 'git-span';
81
+ try {
82
+ const packageDir = path.dirname(require.resolve(`git-span-${platform}-${arch}/package.json`));
83
+ return fs.existsSync(path.join(packageDir, 'bin', sourceBinaryName));
84
+ } catch {
85
+ return false;
86
+ }
87
+ }
88
+
74
89
  function main() {
75
90
  if (isInsideSourceTree()) {
76
91
  console.log('git-span: postinstall skipped (running inside source tree).');
92
+ if (!hasUsableBinaryInSourceTree()) {
93
+ console.warn(
94
+ 'git-span: warning: bin/git-span.exe is still the tracked placeholder and no ' +
95
+ 'prebuilt platform binary was found either. `git span` will fail (not run) until ' +
96
+ 'you run `yarn build:local` from packages/git-span.'
97
+ );
98
+ }
77
99
  return;
78
100
  }
79
101