diffstalkerd 0.13.7 → 0.13.9
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,39 @@ 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.9] - 2026-10-16
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Compare now defaults to the mainline the branch forked from.** The
|
|
13
|
+
default base was the first `main` or `master` among the remote-tracking
|
|
14
|
+
branches, preferring any remote not named `origin`. That suits a clone
|
|
15
|
+
where `origin` is your fork and `upstream` the real repo, but with the
|
|
16
|
+
names the other way round (`origin` the real repo, `fork` your fork) it
|
|
17
|
+
picked the fork's `main`. When that `main` was years old, Compare showed
|
|
18
|
+
dozens of commits that were never part of the branch. Now each remote
|
|
19
|
+
offers its default branch (its `HEAD`, else `main`, else `master`), and
|
|
20
|
+
the one with the fewest commits between it and the branch wins. A tie
|
|
21
|
+
goes to `upstream`, then `origin`. The worktree switcher's commits-ahead
|
|
22
|
+
count uses the same default, now worked out per worktree. The base
|
|
23
|
+
picker no longer puts non-`origin` remotes first either.
|
|
24
|
+
|
|
25
|
+
## [0.13.8] - 2026-10-15
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **Compare now folds uncommitted work into the branch's rows.** With
|
|
30
|
+
staged, unstaged or untracked ticked, a file the branch's commits touched
|
|
31
|
+
that also has uncommitted edits was listed twice: once for the commits,
|
|
32
|
+
once for the edits, each against a different base. Now each file is one
|
|
33
|
+
row, from the merge-base to the index (staged) or the working tree
|
|
34
|
+
(staged and unstaged), so Compare reads as the pull request would if you
|
|
35
|
+
committed that work too. An edit that undoes a commit leaves no row. A
|
|
36
|
+
row holding uncommitted work keeps its tag, and its header says where it
|
|
37
|
+
ends (`origin/main…working tree`). Ticking unstaged now ticks staged as
|
|
38
|
+
well: unstaged edits sit on top of staged ones, and no tree holds only
|
|
39
|
+
them.
|
|
40
|
+
|
|
8
41
|
## [0.13.7] - 2026-10-13
|
|
9
42
|
|
|
10
43
|
### Fixed
|
package/README.md
CHANGED
|
@@ -220,10 +220,10 @@ with a 400 so they can never be parsed as git flags.
|
|
|
220
220
|
| GET | `/repos/:id/base-branches` | Candidate compare bases (remote branches in recent history) |
|
|
221
221
|
| GET | `/repos/:id/compare/base` | Effective compare base: `{base}` (persisted choice or discovered default, null when none) |
|
|
222
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) |
|
|
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
|
|
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 flags each default to false. With `staged` the diff runs from the same merge-base to the index instead of HEAD, and with `staged` and `unstaged` to the working tree, so each file is still ONE row: the compare reads as the PR would if that work were committed too. `unstaged` without `staged` is a 400, since unstaged edits sit on top of staged ones and no tree holds only the unstaged ones. `untracked` adds each untracked file, read from disk, as a new file. A row that holds uncommitted work carries `uncommitted: 'staged' \| 'unstaged' \| 'both' \| 'untracked'`, naming which. The one path listed twice is a file the branch deleted that is back on disk untracked: git's deleted row, plus the untracked one. Uncommitted work only exists on top of HEAD, so any of the three flags together with `head` is a 400 |
|
|
224
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
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`
|
|
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` is the word the row carries in `/compare`'s `files[].uncommitted`, and it sets where the diff ends: `staged` at the index, `unstaged` or `both` at the working tree, absent at the head. It starts at the merge-base either way, like the row itself. `untracked` is read from disk, since git diff would answer empty. (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
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
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
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) |
|