diffstalkerd 0.13.10 → 0.13.11
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 +27 -0
- package/README.md +8 -6
- package/dist/index.js +42 -41
- package/dist/web/assets/{index-D4eibMhy.js → index-CTvL9gui.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ 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.11] - 2026-10-20
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Switching repos is much faster.** On a follow-mode switch to a repo
|
|
13
|
+
the daemon already had open, the new repo's changes now show up in 90
|
|
14
|
+
to 140 ms instead of about 150 to 170, and a first open of a big repo
|
|
15
|
+
shows them in about 0.4 s instead of 1 to 1.4 s. What changed:
|
|
16
|
+
- The follow hook file is read on the first write instead of after a
|
|
17
|
+
100 ms debounce. A burst of writes still ends on the newest target.
|
|
18
|
+
- A repo released by every client stays warm for 10 minutes (at most
|
|
19
|
+
4 at once), so switching back to it is not a cold open. Clients see
|
|
20
|
+
it close and reopen exactly as before.
|
|
21
|
+
- The whole-tree diffs a switch asks for come from the last refresh
|
|
22
|
+
instead of running `git diff` again.
|
|
23
|
+
- The working-tree watcher's first crawl of a big repo costs about half
|
|
24
|
+
as much, and finding nested `.gitignore` files no longer walks
|
|
25
|
+
ignored directories like `node_modules`.
|
|
26
|
+
- The worktree list no longer freezes the daemon. On a repo with 50
|
|
27
|
+
worktrees it started about 300 git processes at once on every switch,
|
|
28
|
+
blocking every other answer for about half a second. Commits-ahead
|
|
29
|
+
counts are now cached until a HEAD or a remote mainline moves, so a
|
|
30
|
+
typical listing runs 3 git processes, and a cold one runs at most 8
|
|
31
|
+
at a time.
|
|
32
|
+
- The web UI asks for the new repo's diffs before re-reading the
|
|
33
|
+
daemon-wide state, so they no longer wait for a free connection.
|
|
34
|
+
|
|
8
35
|
## [0.13.10] - 2026-10-20
|
|
9
36
|
|
|
10
37
|
### Added
|
package/README.md
CHANGED
|
@@ -204,13 +204,13 @@ with a 400 so they can never be parsed as git flags.
|
|
|
204
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) |
|
|
205
205
|
| GET | `/version` | `{current, latest, status, install, restart}` — 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. `restart` is the command that restarts this daemon (`systemctl --user restart diffstalkerd`, or `sudo systemctl restart …` for a system unit), set only when systemd started this very process (`$SYSTEMD_EXEC_PID` is its pid) and `/proc/self/cgroup` names a plain `.service` unit; otherwise null |
|
|
206
206
|
| GET | `/repos` | List open repos (`id`, `path`, `branch`) |
|
|
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 |
|
|
208
|
-
| DELETE | `/repos/:id` | Close a repo (refcounted per open)
|
|
207
|
+
| POST | `/repos` | Open a repo: `{"path": "/abs/path"}` → `{id, path}` (201 created, 200 already open or still kept warm after its release). 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 |
|
|
208
|
+
| DELETE | `/repos/:id` | Close a repo (refcounted per open). At zero it is closed for every client at once (`repo-closed`, gone from `GET /repos`), but the daemon keeps its git state live for 10 minutes (up to 4 such repos) so a reopen in that window is warm |
|
|
209
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 |
|
|
210
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) |
|
|
211
211
|
| GET | `/resolve?path=` | `{openable, root}` — can this exact path be opened, and as which worktree, without opening it. Same resolver as `POST /repos`, but the path must EXIST (git resolves a missing path to its parent worktree, which would make a typo look openable). A relative path is a 400; not-a-repo is a 200 answer |
|
|
212
212
|
| GET | `/repos/:id/status` | Shared state: status, hunk counts, stash list, in-progress operation, error, working-file mtimes (path → mtimeMs; what browser clients build mtime-based auto mode on) |
|
|
213
|
-
| GET | `/repos/:id/diff?path=&staged=&whole=` | Diff; whole tree without `path`, staged side with `staged=true`. `whole=true` draws ONE file in full instead of as hunks (wide context, so every unchanged line is present and the changed ones are marked in place) — it **requires** `path` (400 without one: a wide whole-tree diff is unbounded work behind an unthrottled GET), it is never annotated with hunk edit times (see the note under this table), and it is ignored for an untracked file, whose diff is the whole file already. Per-file cap: a file's diff over 256 KB or 5,000 lines is withheld — its headers are kept and its body becomes one `Large file — diff not shown (…)` line, the same shape git uses for `Binary files … differ`. Applies to every diff-bearing response (compare, commit diffs, journal), and it is what bounds a whole-file diff |
|
|
213
|
+
| GET | `/repos/:id/diff?path=&staged=&whole=` | Diff; whole tree without `path`, staged side with `staged=true`. Without `path` it is the diff of the last refresh (the one the hunk counts came from), served as-is; with `path` git runs for the request. `whole=true` draws ONE file in full instead of as hunks (wide context, so every unchanged line is present and the changed ones are marked in place) — it **requires** `path` (400 without one: a wide whole-tree diff is unbounded work behind an unthrottled GET), it is never annotated with hunk edit times (see the note under this table), and it is ignored for an untracked file, whose diff is the whole file already. Per-file cap: a file's diff over 256 KB or 5,000 lines is withheld — its headers are kept and its body becomes one `Large file — diff not shown (…)` line, the same shape git uses for `Binary files … differ`. Applies to every diff-bearing response (compare, commit diffs, journal), and it is what bounds a whole-file diff |
|
|
214
214
|
| GET | `/repos/:id/history?count=` | Commit history (`CommitInfo[]`, default 100, ISO dates) |
|
|
215
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 |
|
|
216
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 |
|
|
@@ -359,9 +359,11 @@ stream), one event per observation (possibly several hunks), batched so
|
|
|
359
359
|
clients apply them atomically.
|
|
360
360
|
|
|
361
361
|
The journal store lives above the repo's manager lifecycle: closing a
|
|
362
|
-
repo's last client (a browser F5)
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
repo's last client (a browser F5) keeps the store, so a reopen resumes the
|
|
363
|
+
same chronology under the same epoch, even after the lingering manager is
|
|
364
|
+
disposed. While the manager lingers it keeps journaling edits as usual.
|
|
365
|
+
Stores are LRU-capped daemon-wide; the store of an open or lingering repo
|
|
366
|
+
is never evicted.
|
|
365
367
|
|
|
366
368
|
## Image bytes
|
|
367
369
|
|