REALM
REALM = \Drupal\strata\Journal\Realm::CONFIG
The realm a branch may carry.
A named line of configuration history forked off a commit.
A branch carries the configuration realm and nothing else, and that is a property of how each realm is captured rather than a feature that was left out. A configuration object is captured WHOLE on every save, so its value at any commit is one complete document and a three-way merge over it is an ordinary operation on complete values. Content entities and table rows are captured as FIELD DELTAS against a parent, so merging them would mean replaying two divergent delta chains and inventing a resolution wherever they disagree. That is not a merge; it is data loss with extra steps. So a branch that received a change in any other realm refuses the merge and names the subject rather than dropping it quietly.
A branch is a ref. refs/heads/main is the trunk, refs/heads/<name> is a branch, and everything
that already reads refs - reachability, prune, verify, strata:flush --ref - treats it as one
without being told about branching at all.
__construct(string $name, string $forkedFrom, string $tip, int|null $actor = null, int $createdAt = 0) : mixed
Constructs a branch.
| string | $name | The branch name, without the |
| string | $forkedFrom | Address of the commit the branch was cut from. |
| string | $tip | Address of the commit it currently points at, which is the fork point until something is flushed onto it. |
| int|null | $actor | Drupal user id that created it, or NULL for unattended work. |
| int | $createdAt | Unix microseconds it was created at. |
When the name is not usable, or either address is not a valid digest.
isValidName(string $name) : bool
Whether a name is one a branch may carry.
Two rules, both of which have to hold. RefStore refuses an empty or traversal segment, because
a ref name becomes an object key and heads/../../etc would write outside the site's own
prefix. On top of that a branch name is lowercase alphanumeric with -, _ and /, so the
name reads the same in a URL, a Drush argument and an object key, and so two names cannot differ
only by case on a store that is case-insensitive.
| string | $name | The candidate name. |
TRUE when the name is usable.
fromArray(array$data, string $tip) : self
Rebuilds a branch from its stored metadata and the ref that names its tip.
| array |
$data | The array produced by Branch::jsonSerialize(). |
| string | $tip | The commit the ref points at. |
When the metadata does not describe a branch.
The branch.