diffstalkerd 0.13.4 → 0.13.6

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/CHANGELOG.md CHANGED
@@ -5,6 +5,95 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.13.6] - 2026-10-01
9
+
10
+ ### Added
11
+
12
+ - **The daemon's errors can be traced now.** Before, a failed stage or push,
13
+ a watcher error or a broken refresh left no line anywhere, and a daemon the
14
+ terminal UI started threw all its output away. Now every log line has a
15
+ timestamp and a level, errors print their stack and cause, and each failure
16
+ names its repo and file. A daemon the terminal UI starts writes to
17
+ `~/.local/state/diffstalker/diffstalkerd.log` (moved to `.log.1` past 1 MB
18
+ when the next one starts); under systemd it is the journal. `--debug` also
19
+ logs every refused request. File names and remote URLs are made safe in the
20
+ log: newlines are escaped and credentials are removed. In the web UI, every
21
+ error the page shows also lands in the browser console with its detail. See
22
+ `docs/logging.md`.
23
+ - **Compare can show one PR of a stack.** If the branches between the base
24
+ and HEAD form a stack of pull requests (for example made with `gh stack`),
25
+ Compare lists them in a strip. Pick one and the diff shows just that PR:
26
+ its own branch against the branch below it. The stack comes from git, not
27
+ from GitHub, so no network or login is needed.
28
+
29
+ ### Changed
30
+
31
+ - **Wire changes in the daemon API.** `GET /media` takes `staged=true|false`
32
+ (was `0|1`). `GET /compare/file` names its row with `uncommitted=` (was
33
+ `side=`); `side` now only means the tree on `/blob`. `POST /repos` answers
34
+ 404 for a path that does not exist (was 400). A repo whose directory is
35
+ deleted while open answers 410 with the reason, instead of a 500 on every
36
+ request. Unknown API paths get a JSON 404 instead of the web page.
37
+ `?base=` is checked like every other ref. A pull or push with no upstream
38
+ is a 409 with git's message (was a 500).
39
+ - **bun 1.4.2** for development and CI. bun 1.3 could deadlock on a named
40
+ pipe in a watched folder, which is what hung the 0.13.5 release run.
41
+ - **Faster:** the lists compute their keyboard tab stop once per render
42
+ instead of once per row (2000 rows: from 108 ms to under 0.1 ms per
43
+ render); a refresh runs three fewer git processes; Compare runs its git
44
+ reads in parallel (about 20% faster).
45
+
46
+ ### Fixed
47
+
48
+ - **Files with a tab, a quote, a backslash or a non-ASCII letter in their
49
+ name** disappeared from Compare and History, and could lose their counts in
50
+ Changes: git quotes such names and nothing unquoted them.
51
+ - **Compare no longer offers `refs/stash` or local branches as a base.** Only
52
+ remote-tracking branches qualify.
53
+ - **Opening a History link highlights its commit.** When the log loaded while
54
+ the link's commit was being looked up, the files showed but no row was
55
+ selected.
56
+ - **A connection error from the repo you just left** could no longer push the
57
+ repo you switched to into reconnecting.
58
+
59
+ ## [0.13.5] - 2026-09-29
60
+
61
+ ### Added
62
+
63
+ - **History shows the commit's files as a tree.** History was a commit list
64
+ beside one long diff, with no way to see which files a commit touched or to
65
+ jump to one. It now has the same file tree and diff stack as Compare: each
66
+ file with its status and `+`/`-` counts, folders that collapse, and a click
67
+ that jumps to the file's diff. On a narrow or vertical screen the commit list
68
+ and the file tree sit side by side above the diffs, so the diffs keep the
69
+ full width. The daemon has a new `GET /repos/:id/commits/:hash/files` for it.
70
+
71
+ ### Fixed
72
+
73
+ - **Many web tabs no longer hang the UI.** Each tab held two live event
74
+ streams: one for the daemon and one for the open repo. Browsers allow only
75
+ six open connections per host, so three tabs used them all, and every
76
+ request after that waited forever. The page looked frozen while the daemon
77
+ sat idle. Two changes fix it. A tab now holds one stream:
78
+ `GET /events?repo=<id>` carries the daemon events and the repo events
79
+ together. And a tab that stays hidden for ten seconds closes its stream;
80
+ when you come back it reopens, gets fresh state and fills the journal gap.
81
+ So only the tabs you can see hold a connection, however many are open.
82
+ `GET /repos/:id/events` stays for the terminal UI, which has no such limit.
83
+ - **A deep link survives a slow or failed first load.** Opening a link like
84
+ `/compare/<repo>?at=<file>` wrote `/` into the address bar before the repo
85
+ had opened. Normally that lasted a few milliseconds; when requests stalled it
86
+ lasted minutes, and a reload then lost the link. If the open failed and the
87
+ tab reconnected later, the repo came back in the background but the page
88
+ stayed on "Open a repository". Now the link stays put until the repo opens,
89
+ a reconnect shows the repo it reopened, and the `?at=` file is still
90
+ selected afterwards.
91
+ - **Opening a commit from a link no longer sticks on "Loading diff…".** The
92
+ history reload swapped in a new copy of the same commit while its diff was
93
+ loading, and the diff was thrown away as stale. It is now matched by hash.
94
+ - **Compare starts with the top file of the tree selected**, not the first by
95
+ flat path sort, which could be the last row in the tree.
96
+
8
97
  ## [0.13.4] - 2026-09-23
9
98
 
10
99
  ### Fixed
package/README.md CHANGED
@@ -55,6 +55,8 @@ Options:
55
55
  package ships it there. Missing dir → API-only, non-fatal)
56
56
  --no-update-check Never ask npm which version is latest; GET /version
57
57
  then reports the running version only
58
+ --debug Also log debug lines (every refused request, every
59
+ ignored follow target) to stderr. See docs/logging.md
58
60
  --version, -v Print the running version and exit
59
61
  --help, -h Show this help
60
62
  ```
@@ -78,7 +80,10 @@ A browser can only reach the daemon over TCP (`--port`), not a unix socket, and
78
80
  the daemon sends no CORS headers — so the web UI is served same-origin from the
79
81
  daemon itself. `GET /` and any unmatched non-API GET path return the SPA's
80
82
  `index.html` (client-side routing); hashed `/assets/*` are served with a long
81
- immutable cache. The REST/SSE API always takes precedence over static files.
83
+ immutable cache. The REST/SSE API always takes precedence over static files,
84
+ and an unknown path under an API prefix (`/health`, `/version`, `/repos`,
85
+ `/resolve`, `/worktrees`, `/events`, `/follow`, `/settings`, `/discovered`,
86
+ `/browse`) is a JSON 404, never the SPA page.
82
87
 
83
88
  Without `--socket`, the daemon binds a unix socket at
84
89
  `$XDG_RUNTIME_DIR/diffstalker/diffstalkerd.sock`. The directory is created
@@ -182,11 +187,15 @@ Every mutation responds with the unified envelope `{state, result?}`:
182
187
  operations. Status codes: 400 for invalid input (missing fields,
183
188
  flag-shaped refs, resets past the root), 404 for unknown repo ids / files
184
189
  not in status, 409 when the repo state refuses the operation (conflicts,
185
- rejected pushes, an operation already in progress, nothing to abort), 500
190
+ rejected pushes, an operation already in progress, nothing to abort), 410
191
+ when the repo is open but its directory is gone or is no longer a git repo
192
+ (`{error}` says which; `GET /status`, `GET /repos/:id/events` and
193
+ `DELETE /repos/:id` still answer, so a client can see why and let go), 500
186
194
  for real failures.
187
195
 
188
- Ref-like fields (`name`, `hash`, `branch`) must not start with `-`; such
189
- values are rejected with a 400 so they can never be parsed as git flags.
196
+ Ref-like values (the body fields `name`, `hash`, `branch` and the `base`
197
+ query param) must not be empty or start with `-`; such values are rejected
198
+ with a 400 so they can never be parsed as git flags.
190
199
 
191
200
  ### Reads
192
201
 
@@ -195,7 +204,7 @@ values are rejected with a 400 so they can never be parsed as git flags.
195
204
  | GET | `/health` | `{ok, ready, home, http: {port}, symbols}` — `http.port` is the loopback port a browser reaches the web UI on, or null when only a socket is bound (what `diffstalker link` needs to build a URL at all) |
196
205
  | GET | `/version` | `{current, latest, status, install}` — the running version against npm's `latest` dist-tag (`current` \| `outdated` \| `ahead` \| `unknown`). The npm lookup is cached (6h, 5min after a failure) and only ever runs when this endpoint is called; `--no-update-check` skips it, leaving `latest: null`. `install` is `{method, package, command}` — how this daemon was installed (`npm` \| `bun` \| `pnpm` \| `yarn` \| `pacman` \| `unknown`) and the one command that updates it, detected once from where the daemon's own files live. An install nothing owns reports `unknown` with a null command rather than a guess |
197
206
  | GET | `/repos` | List open repos (`id`, `path`, `branch`) |
198
- | POST | `/repos` | Open a repo: `{"path": "/abs/path"}` → `{id, path}` (201 created, 200 already open) |
207
+ | POST | `/repos` | Open a repo: `{"path": "/abs/path"}` → `{id, path}` (201 created, 200 already open). 400 for a relative path or a directory that is not a git repository, 404 when the path does not exist. One missing last segment under a repo still opens the repo above it (`<repo>/nope` opens `<repo>`); a path missing more than one level deep (`<repo>/nope/deeper`) is a 404 |
199
208
  | DELETE | `/repos/:id` | Close a repo (refcounted per open) |
200
209
  | GET | `/repos/:id/worktrees` | Registered worktrees (`path`, `branch`, `head`, `isBare`, `lastActivity`, `aheadOfBase`): main worktree, linked worktrees, and the bare entry in a bare-worktree layout |
201
210
  | GET | `/worktrees?path=` | Same as above, but for a raw filesystem path instead of an already-opened repo id (e.g. a recently-visited repo a client hasn't opened on this daemon) |
@@ -205,21 +214,24 @@ values are rejected with a 400 so they can never be parsed as git flags.
205
214
  | GET | `/repos/:id/history?count=` | Commit history (`CommitInfo[]`, default 100, ISO dates) |
206
215
  | GET | `/repos/:id/commits/:hash` | One commit by hash or short hash (404 on unknown) — what a link to a commit outside a client's loaded log resolves through |
207
216
  | GET | `/repos/:id/commits/:hash/diff?path=&whole=` | Diff introduced by one commit (404 on unknown hash; merge and `--allow-empty` commits are 200 with an empty diff, matching the CLI). `path` narrows to one file and `whole=true` widens its context to the whole file (400 without `path`). The pathspec carries BOTH sides of a rename, because scoping to the new path alone makes git report a rename as a plain add |
217
+ | GET | `/repos/:id/commits/:hash/files` | The same commit's changes split per file, each with git's status and `+`/`-` counts (same row shape as `/compare`'s `files`). 404 on unknown hash; a merge commit is 200 with no rows |
208
218
  | GET | `/repos/:id/head-message` | HEAD commit message for amend prefill: `{message}` (`""` when the repo has no commits) |
209
219
  | GET | `/repos/:id/branches` | Local branches (`name`, `current`, `tracking`) |
210
220
  | GET | `/repos/:id/base-branches` | Candidate compare bases (remote branches in recent history) |
211
221
  | GET | `/repos/:id/compare/base` | Effective compare base: `{base}` (persisted choice or discovered default, null when none) |
212
222
  | PUT | `/repos/:id/compare/base` | Persist the compare base: `{"branch": "origin/main"}` → `{base}`; the ref is validated first (400 on an unknown ref, nothing persisted) |
213
- | GET | `/repos/:id/compare?base=&staged=&unstaged=&untracked=` | Base-vs-HEAD `CompareDiff` (three-dot); base defaults to the effective base — a stale persisted base falls back to the discovered default, 422 when nothing usable resolves; an explicit unknown `base` is a 400; a base with no common history is a 422. The three uncommitted categories are independent flags, each defaulting to false; a row folded in carries `uncommitted: 'staged' \| 'unstaged' \| 'both' \| 'untracked'`. `staged` and `unstaged` together are read as ONE `git diff HEAD` (side `both`), never two diffs |
214
- | GET | `/repos/:id/compare/file?path=&base=&side=&whole=` | One file's diff inside a comparison, as a `DiffResult`. The stacked views pull a range whole and split it client-side, so they have no per-file request of their own to widen. `side` names the row's own comparison — `staged` (HEAD vs index), `unstaged` (index vs working tree), `both` (HEAD vs working tree) or `untracked` (read from disk, git diff would answer empty) — and absent means a committed row against the base. Compare's stack mixes them and they are genuinely different comparisons. Same rename-preserving pathspec as above. 400 without `path`, or on an unknown `side` |
215
- | GET | `/repos/:id/tree?dir=&hidden=&ignored=` | One directory level (`name`, `path`, `type`), gitignored/hidden filtered by default (`hidden=true` / `ignored=true` include them, mirroring the TUI toggles), files annotated with `gitStatus` + `staged`, changed dirs with `hasChanges` (400 outside the repo root, on a file, or on the git directory, 404 unknown dir). The git directory is never listed, even with `hidden=true` |
216
- | GET | `/repos/:id/file?path=` | File content for display with flags: `{content, binary, truncated, tooLarge, size, totalLines, media?}` — binary/oversized come back with empty content and the flag set, never prose; `media` carries the image verdict (`{image, refusal, version}`) when the bytes say something about it; 400 for anything that is not a regular file (directory, FIFO, device), resolves outside the repo root, or addresses the git directory |
217
- | GET | `/repos/:id/media?path=&staged=` | Image metadata for one changed file, both sides resolved server-side (renames included): `{old, new}`, each side `{path, side, bytes, oid, image, refusal, version}` or `null` when the file does not exist there. `staged` must be spelled `0` or `1`. 404 when the path is not in status. See [Image bytes](#image-bytes) |
223
+ | GET | `/repos/:id/compare?base=&head=&staged=&unstaged=&untracked=` | Base-vs-head `CompareDiff` (three-dot: `merge-base(base, head)...head`); base defaults to the effective base — a stale persisted base falls back to the discovered default, 422 when nothing usable resolves; an explicit unknown `base` is a 400; a base with no common history is a 422. `head` defaults to HEAD and is checked exactly as `base` is (400 `Unknown head ref: …`); naming one reads a single layer of a stack (see `/compare/stack`). The three uncommitted categories are independent flags, each defaulting to false; a row folded in carries `uncommitted: 'staged' \| 'unstaged' \| 'both' \| 'untracked'`. `staged` and `unstaged` together are read as ONE `git diff HEAD` (side `both`), never two diffs. Uncommitted work only exists against HEAD, so any of the three flags together with `head` is a 400 |
224
+ | GET | `/repos/:id/compare/count?base=&head=` | How many commits `/compare` would list, as `{baseBranch, commits}`, without building the diff (what badges the Compare tab). Same `base` and `head` resolution and the same 400/422 answers as `/compare` |
225
+ | GET | `/repos/:id/compare/stack?base=` | The stack of branches from the base (the trunk) up to HEAD and above it, as git topology shows it: `{trunk, layers, forkedAbove}`, layers bottom to top, each `{name, refs, tip, commits, isHead}` (`CompareStack` in `@diffstalker/core/types/stack`; rules in `docs/stacked-compare.md`). `base` resolves exactly as on `/compare`; a base with no common history is an empty `layers`, not a 422. The HEAD layer is always present, named after the checked-out branch or `HEAD` when detached. Branches above HEAD that fork are left out and `forkedAbove` says so. A remote-tracking copy of a local branch is folded into that branch's layer, never a layer of its own. The walk is capped at 1000 first-parent commits from the merge-base: a layer deeper than that is not seen, and the lowest layer that is seen then counts its commits from the cut |
226
+ | GET | `/repos/:id/compare/file?path=&base=&head=&uncommitted=&whole=` | One file's diff inside a comparison, as a `DiffResult`. The stacked views pull a range whole and split it client-side, so they have no per-file request of their own to widen. `uncommitted` names the row's own comparison with the same word the row carries in `/compare`'s `files[].uncommitted` — `staged` (HEAD vs index), `unstaged` (index vs working tree), `both` (HEAD vs working tree) or `untracked` (read from disk, git diff would answer empty) — and absent means a committed row against the base. Compare's stack mixes them and they are genuinely different comparisons. (It is not called `side`: on this API `side` is always one tree, `worktree` \| `index` \| `head`, as on `/blob` and `/media`.) Same rename-preserving pathspec as above. `head` narrows the committed range as on `/compare`, and is a 400 together with `uncommitted`. 400 without `path`, or on an unknown `uncommitted` |
227
+ | GET | `/repos/:id/tree?dir=&hidden=&ignored=` | One directory level (`name`, `path`, `type`), gitignored/hidden filtered by default (`hidden=true` / `ignored=true` include them, mirroring the TUI toggles), files annotated with `gitStatus` + `staged`, changed dirs with `hasChanges` (400 outside the repo root or on the git directory; 404 when the dir does not exist; 400 `Not a directory (a file): …` when the path exists but is not a directory). The git directory is never listed, even with `hidden=true` |
228
+ | GET | `/repos/:id/file?path=` | File content for display with flags: `{content, binary, truncated, tooLarge, size, totalLines, media?}` — binary/oversized come back with empty content and the flag set, never prose; `media` carries the image verdict (`{image, refusal, version}`) when the bytes say something about it; 404 when the path does not exist; 400 `Not a regular file (a directory): …` (or a FIFO, a socket, a device) when it exists but is not a regular file, and 400 when it resolves outside the repo root or addresses the git directory |
229
+ | GET | `/repos/:id/media?path=&staged=` | Image metadata for one changed file, both sides resolved server-side (renames included): `{old, new}`, each side `{path, side, bytes, oid, image, refusal, version}` or `null` when the file does not exist there. `staged` is required and spelled `true` or `false` like every boolean param. 404 when the path is not in status. See [Image bytes](#image-bytes) |
218
230
  | GET | `/repos/:id/blob?path=&side=&v=` | Raw image bytes for `<img src>`; `side` is `worktree` \| `index` \| `head`, `v` is an ignored cache key. Only PNG/JPEG/GIF, typed from magic bytes. Status-independent (no `git status`), so a clean committed image is reachable. See [Image bytes](#image-bytes) |
219
231
  | GET | `/repos/:id/files` | All tracked + untracked (not ignored) paths: the fuzzy-finder source |
220
232
  | GET | `/repos/:id/journal?since=` | Append-only edit journal: `{epoch, prunedBefore, entries}`; `since=<seq>` returns only entries with a higher seq (all when omitted) |
221
233
  | GET | `/repos/:id/events` | SSE: `snapshot` on connect, then `state-change` events from the file watcher and `journal-append {entries}` per journal observation |
222
- | GET | `/events` | Daemon-scope SSE: `snapshot` (open repos) on connect, then `repo-opened` / `repo-closed` / `follow-change` / `settings-change` / `discovery-change` |
234
+ | GET | `/events?repo=` | Daemon-scope SSE: `snapshot` (open repos) on connect, then `repo-opened` / `repo-closed` / `follow-change` / `settings-change` / `discovery-change`. With `repo=<id>` the same stream also carries that repo's events — `repo-snapshot` right after the daemon `snapshot`, then `state-change` / `journal-append` as on `/repos/:id/events`. An id that is not open is still a 200: one `repo-missing {id}` follows the snapshot; an empty `repo=` is the same as none. See [One stream per tab](#one-stream-per-tab) |
223
235
  | GET | `/follow` | Follow state: `{targetFile, enabled, followedRepoId, followedPath}` |
224
236
  | GET | `/settings` | Daemon settings: `{watchRoots, persisted}`. `persisted: false` means this daemon holds them in memory only (no settings file) |
225
237
  | GET | `/discovered` | Repos found under the watch directories: `{roots: [{path, repos: [{path, name, branch, lastActivity}], error, capped}]}`. See [Watch directories](#watch-directories) |
@@ -254,7 +266,15 @@ values are rejected with a 400 so they can never be parsed as git flags.
254
266
 
255
267
  A conflicted `pull`/`cherry-pick` leaves the repo stopped mid-operation;
256
268
  `GET /status` reports it in `operationInProgress` and `POST /abort`
257
- returns the repo to its pre-operation state — no shell required.
269
+ returns the repo to its pre-operation state — no shell required. The
270
+ failing mutation refreshes the shared state before it answers, so the
271
+ `state-change` event carries the wedge too, and `/status` serves that same
272
+ cached state rather than re-reading the git dir. For an operation started
273
+ from a shell the value lags by the watcher's debounce plus one refresh
274
+ (roughly 150–250 ms after HEAD or the index changes): a `/status` read in
275
+ that window still shows the previous value. A failed git operation's
276
+ `{error}` is git's own message (a rejected push, a patch that does not
277
+ apply); the daemon log records the same text.
258
278
 
259
279
  History, compare, and explorer data are stateless, pulled on demand: the
260
280
  daemon never holds a client's selection, loaded history, or tree expansion.
@@ -279,6 +299,43 @@ included: the response is byte-identical to the plain one.
279
299
  Repo ids are stable hashes of the worktree root, so a cached id still
280
300
  addresses the same repo after a daemon restart.
281
301
 
302
+ Every `path` on the wire — in status entries, hunk counts, compare and
303
+ commit rows — is the raw path, exactly as `git status` spells it, even when
304
+ git C-quotes it in patch text (a tab, a double quote, a backslash, a
305
+ non-ASCII name): the daemon reads git's list outputs with `-z` and unquotes
306
+ `diff --git` headers. The header lines inside a `DiffResult` keep git's
307
+ quoting, because a hunk patch built from them must be one `git apply`
308
+ accepts.
309
+
310
+ ### One stream per tab
311
+
312
+ There are two event streams: `GET /events` for the daemon (open repos,
313
+ follow, settings, discovery) and `GET /repos/:id/events` for one repo
314
+ (status, journal). The CLI opens both. A browser must not: Chrome allows
315
+ six HTTP/1.1 connections per host, so two streams per tab meant three tabs
316
+ used them all up and every later request queued forever — the page looked
317
+ hung. `GET /events?repo=<id>` folds both into ONE stream:
318
+
319
+ - On connect: the daemon `snapshot` first, then the repo's `repo-snapshot`
320
+ (renamed only because `snapshot` is already taken on this stream). After
321
+ that, `state-change` and `journal-append` exactly as on
322
+ `/repos/:id/events`, with the same payloads and the same dedup.
323
+ - An id that is not open (the daemon restarted and the browser's
324
+ EventSource reconnected before the page re-POSTed `/repos`) is still a
325
+ 200 with the normal daemon stream, plus one `repo-missing {id}` after the
326
+ snapshot. It is never a 404: a non-200 makes EventSource give up for
327
+ good, which would also cut off the daemon events.
328
+ - If the repo is closed while the stream is live (its last ref released),
329
+ the stream stays up: it gets `repo-missing {id}` (before the daemon's
330
+ `repo-closed`) and stops carrying repo events. A `/repos/:id/events`
331
+ stream is ended in that case, as before.
332
+
333
+ Even one stream per tab fills the pool once six tabs are open, so the
334
+ web UI also closes its stream in a tab that has been hidden for ten
335
+ seconds and reopens it when the tab is shown again (the repo ref is
336
+ kept; the daemon resends both snapshots on the reopen). A browser
337
+ client of your own should do the same.
338
+
282
339
  ### Journal
283
340
 
284
341
  `GET /repos/:id/journal` serves the repo's append-only edit journal: an
@@ -297,8 +354,9 @@ as `/diff` responses.
297
354
  refetch.
298
355
 
299
356
  New entries stream as `journal-append {entries}` on the per-repo
300
- `GET /repos/:id/events` channel, one event per observation (possibly
301
- several hunks), batched so clients apply them atomically.
357
+ `GET /repos/:id/events` channel (and on a combined `GET /events?repo=`
358
+ stream), one event per observation (possibly several hunks), batched so
359
+ clients apply them atomically.
302
360
 
303
361
  The journal store lives above the repo's manager lifecycle: closing a
304
362
  repo's last client (a browser F5) disposes the manager but keeps the
@@ -390,7 +448,7 @@ bytes it is going to write.
390
448
 
391
449
  | Status | Cause |
392
450
  | ------ | ----- |
393
- | 400 | empty/NUL path, a leading `-` (git option) or `:` (pathspec magic), traversal, a symlink escaping the root, any `.git` path, a non-regular file (directory, symlink, gitlink, FIFO), a bad `side`, a `staged` that is not `0`/`1` |
451
+ | 400 | empty/NUL path, a leading `-` (git option) or `:` (pathspec magic), traversal, a symlink escaping the root, any `.git` path, a non-regular file (directory, symlink, gitlink, FIFO), a bad `side`, a `staged` that is missing or not `true`/`false` |
394
452
  | 403 | `Sec-Fetch-Site` present and cross-site, or `Sec-Fetch-Dest` present and not `image` (`/blob` only — `/media` is JSON and the SPA's own `fetch` sends `Sec-Fetch-Dest: empty`). Both absent passes, so `curl` and the Node client are unaffected |
395
453
  | 404 | unknown repo, or the path does not exist on that side. `/media` also 404s a path with no status entry |
396
454
  | 413 | over the byte, dimension, pixel or frame cap |