Skip to content

refactor(core): one naming pattern for status, diff and push outcomes - #57

Merged
CameronBrooks11 merged 1 commit into
mainfrom
refactor/outcome-names
Nov 13, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
refactor/outcome-names

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Every outcome constant in core now carries its type's prefix:

type before after
State Unchanged, Modified, Deleted, BaselineUnknown StatusUnchanged, StatusModified, StatusDeleted, StatusBaselineUnknown
DiffState Changed, DiffUnchanged, DiffDeleted, NoBaseline DiffChanged, DiffUnchanged, DiffDeleted, DiffNoBaseline
PushAction Pushed, WouldPush, SkipUnchanged, Conflict, PushError, NoBaselinePush PushPublished, PushPreviewed, PushUnchanged, PushConflict, PushError, PushNoBaseline

The renames were done with gofmt -r, which matches whole identifiers only. The string values stay the same, since status prints them.

pullset_test.go's hand-written equal is replaced by slices.Equal.

Closes #50

The three outcome types share package core, so their constants were
disambiguated case by case: Changed and DiffUnchanged, NoBaseline and
NoBaselinePush, Pushed and SkipUnchanged. Each constant now carries its
type's prefix: StatusModified, DiffChanged, PushConflict and so on. The
string values, which status prints, are unchanged.

pullset_test's hand-written equal is slices.Equal.

Closes #50
@CameronBrooks11
CameronBrooks11 merged commit dd503d1 into main Nov 13, 2026
9 checks passed
@CameronBrooks11
CameronBrooks11 deleted the refactor/outcome-names branch November 13, 2026 17:21
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 naming pattern for status, diff and push outcomes

1 participant