Skip to content

[v5] Let commits be on a branch, with ordinals unique per branch - #667

Merged
ldionne merged 4 commits into
llvm:mainfrom
ldionne:users/ldionne/v5-branches-1-server
Nov 17, 2026
Merged

ldionne merged 4 commits into
llvm:mainfrom
ldionne:users/ldionne/v5-branches-1-server

Conversation

@ldionne

@ldionne ldionne commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

A suite could only track one line of history: ordinals were unique
across the suite, so a release branch whose commits overlap main's
ordinals could not be submitted to it. A commit now has an optional
branch, a free-form string like its tag, and ordinals are unique
within each branch, the commits without a branch counting as one.
Everything that compares ordinals stays within a branch: a commit's
previous/next, the after_commit/before_commit bounds of the
commit list and of the series. The commit list, series and trends take
branch= and has_branch= filters, and the commit object, series lines
and trend items carry branch. search= on commits matches the branch,
as it does the tag.

This is the API side. The web UI only follows along so far; it learns to
show and pick branches in later PRs.

Deviations from the design in the issue:

  • The uniqueness is a partial unique index,
    (branch, ordinal) NULLS NOT DISTINCT WHERE ordinal IS NOT NULL,
    rather than UNIQUE NULLS NOT DISTINCT (branch, ordinal), which would
    allow only one commit without an ordinal per branch. ordinal also
    keeps an index of its own, since the commit list sorted by ordinal
    interleaves the branches.
  • Commits without a branch are asked for with has_branch=false, as
    with has_ordinal, rather than through a default branch.
  • Without a branch filter, a trend's last_n window is shared by every
    branch, by ordinal, rather than required or per branch.
  • lnt v5 submit gets no --branch option: it sends the submissions it
    reads as they are, and has no option for the ordinal or the tag
    either. A submission carries the branch in its commit object.
  • Listing a suite's branches, for the Graph's branch selector, is left
    to the PR that adds the selector.

Part of #665.

A suite could only track one line of history: ordinals were unique
across the suite, so a release branch whose commits overlap `main`'s
ordinals could not be submitted to it. A commit now has an optional
`branch`, a free-form string like its tag, and ordinals are unique
within each branch, the commits without a branch counting as one.
Everything that compares ordinals stays within a branch: a commit's
`previous`/`next`, the `after_commit`/`before_commit` bounds of the
commit list and of the series. The commit list, series and trends take
`branch=` and `has_branch=` filters, and the commit object, series lines
and trend items carry `branch`.

This is the API side. The web UI only follows along so far; it learns to
show and pick branches in later PRs.

Deviations from the design in the issue:

- The uniqueness is a partial unique index,
  `(branch, ordinal) NULLS NOT DISTINCT WHERE ordinal IS NOT NULL`,
  rather than `UNIQUE NULLS NOT DISTINCT (branch, ordinal)`, which would
  allow only one commit without an ordinal per branch. `ordinal` also
  keeps an index of its own, since the commit list sorted by ordinal
  interleaves the branches.
- Commits without a branch are asked for with `has_branch=false`, as
  with `has_ordinal`, rather than through a default branch.
- Without a branch filter, a trend's `last_n` window is shared by every
  branch, by ordinal, rather than required or per branch.
- `lnt v5 submit` gets no `--branch` option: it sends the submissions it
  reads as they are, and has no option for the ordinal or the tag
  either. A submission carries the branch in its `commit` object.
- `search=` does not match the branch: many commits share one, and
  `branch=` selects them.
- Listing a suite's branches, for the Graph's branch selector, is left
  to the PR that adds the selector.

Part of llvm#665.
- Word the 409 for an ordinal taken on an unknown branch without
  presupposing the commit exists, and drop the sentinel it used.
- Don't read the commit on a PATCH that clears its ordinal.
- Spell out commit_bounds, and tighten E3, I3, D5, O6 and llms.txt.
`search=` on the commit list now matches the branch the way it matches
the tag: case-insensitive substring. The run list's `search=` follows,
since it matches a run's commit as the commit list does. This reverses
the earlier choice to leave the branch to `branch=`, so that a commit
picker can find a release branch's commits by typing its name.
@ldionne
ldionne marked this pull request as ready for review November 17, 2026 17:40
- Test that a run list's `search=` matches the branch of a run's commit.
- Name the branch among a commit's always-searched columns in
  `search_condition`'s docstring.
- Say why a branch's name falling back to the run list's unresolved
  search stays bounded.
@ldionne
ldionne merged commit 7221fb8 into llvm:main Nov 17, 2026
26 checks passed
@ldionne
ldionne deleted the users/ldionne/v5-branches-1-server branch November 17, 2026 18:18
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.

1 participant