Skip to content

refactor(core): one way to select tracked pages - #55

Merged
CameronBrooks11 merged 1 commit into
mainfrom
refactor/tracked-selection
Nov 13, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
refactor/tracked-selection

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Manifest.Select(names) splits names into the tracked titles (sorted, no repeats; no names means every page) and the untracked ones (in the order given). Push, Diff, Status and PullSet's refresh all use it, replacing their own copies of the select-and-sort code.

The old copies treated nil and empty differently: an empty, non-nil slice selected nothing, and main worked around that twice. Now Push and Diff return the untracked names, and both commands report them with reportUntracked, which cmdDiff used to copy inline.

Status and Diff now read each file once instead of a stat and then a read. Pull keeps its stat: there, a stat error and a read error lead to different outcomes.

TestUntrackedTitlesAreNamed pins the exact stdout, stderr and exit code of diff and push with untracked titles. It passed on the code before this change, and it fails if cmdDiff stops reporting. TestSelect covers nil, empty and mixed names.

No change to behaviour or output.

Closes #48

Push and Diff each picked and sorted tracked titles with their own
copy of the code, with opposite nil checks, and a non-nil empty slice
selected nothing, which main worked around twice. cmdDiff had its own
inline copy of reportUntracked.

Manifest.Select splits names into tracked titles (sorted, no repeats;
no names means all) and untracked ones (in the order given). Push and
Diff return the untracked names, and both commands report them with
reportUntracked. Status and PullSet's refresh use Select too. Status
and Diff read each file once instead of a stat and then a read.

TestUntrackedTitlesAreNamed pins the commands' exact output for
untracked titles; it passes on the code before and after this change.

Closes #48
@CameronBrooks11
CameronBrooks11 merged commit d08a881 into main Nov 13, 2026
9 checks passed
@CameronBrooks11
CameronBrooks11 deleted the refactor/tracked-selection branch November 13, 2026 17:18
CameronBrooks11 added a commit that referenced this pull request Nov 13, 2026
Prepares v0.5.1: the version constant becomes 0.5.1, and the CHANGELOG's
Unreleased section becomes 0.5.1. User-facing changes since v0.5.0: #52
(HTTP status on login and edit errors, #45), #53 (conflict check reads
the revision id only, #46), #61 (login failure and count wording, #56),
#62 (push read-back warning, #58). The rest are refactors with no change
in behaviour: #54, #55, #57, #59, #60. The tag is pushed after this
merges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: one way to select tracked pages

1 participant