Fork update
Look at upstream’s new version beside the note, then take it, keep it alongside, or wave it off. No merge.
Compare
Compare shows upstream’s version beside the fork: compare.md. Its actions are below.
Actions
| Action | Compared copy | Other copies of the file |
|---|---|---|
| Overwrite | Text replaced; fork_branch, fork_commit, fork_blob, fork_date rewritten; fork_seen removed | fork_seen = blob |
| Write alongside | fork_seen = blob | fork_seen = blob |
| Keep mine | fork_seen = blob | fork_seen = blob |
Each leaves every copy settled, so the file leaves the check view and the pane closes. Settled copies aren’t written.
- Overwrite asks first if the copy is edited or can’t tell. Same name and path. Invalid
upstream YAML is refused; a note that changes meanwhile is left; if keys can’t be written the
note is restored (
overwriteWithProvenance()). - Write alongside: a new fork (
writeFork()) in the copy’s folder named<name> (up-01),(up-02), … (an existing(up-nn)dropped first). Opens where the copy was; now the latest copy.
After either, the note’s links are converted (links.md).
Gone upstream: Detach removes fork_* from every copy after asking; Keep sets
fork_seen: gone (not listed until the file is back and differs).
Restart: the view’s state is source key, upstream path, blob, branch, commit and note path; the blob is read from the clone. If the note is gone or no longer that fork, or the source isn’t followed, it says so and offers nothing.
Update selected forks
Update selected forks (n) in the check view’s header: the ticked files with forks changed
upstream and still at head (selectedForks()); n counts those. Gone ones keep Detach and
Keep. A folder’s tick never ticks a forked file, so each is one the user picked; the
Forked filter narrows the lists to them.
Every copy of each file, the check’s and any found now, settled ones aside, is judged against its
own fork_blob: not edited, it is overwritten as Overwrite does; edited, or can’t tell, it is
left. Nothing gets fork_seen. A file leaves the list, and its tick clears, once all its copies
are settled; with one left, Compare is the way on. The versions are read in one go
(blobs()): those in the clone already, the rest fetched. Head’s versions are checked, and
asked about once, before any is written (copy-safety.md). One notice: the count, then what was
left and what failed (sticky if any). The updated notes’ links are converted.
Code
Pure: src/fork/update.ts; isSettled(), latestFirst() in src/check/check.ts; selectedForks() in src/check/selection.ts. Vault:
src/fork/update-run.ts (the actions), src/fork/compare-run.ts (the command); Compare from the check view is compareChange() in src/compare/run.ts.