Skip to content
rlsbl.prepush_utils
On this page

Pre-push check utilities for commit enumeration and JSONL changelog coverage verification, shared across the prepush and workspace checks.

#rlsbl.prepush_utils

#rlsbl.prepush_utils

Pre-push check utilities shared between checks/prepush.py and checks/workspace.py, providing commit enumeration and JSONL coverage verification.

Extracted from commands/pre_push_check.py to break the checks/ -> commands/ circular dependency. The original module existed solely to host these functions after the pre-push-check CLI command was removed.

#_get_release_branches

python
def _get_release_branches(ctx)

Return the configured release-branch list.

Reads release_branches from .rlsbl/config.json if present; falls back to ["main", "master"] when the key is absent.

Branch-role semantics:

  • Branches in this list are release-only: manual pushes

trigger a warning (prepush-manual-warning), and rlsbl release run targets them as the release branch.

  • Everything else is a shareable (dev) branch: sessions push

freely; rlsbl release run from a dev branch fast-forward merges into the first release branch before releasing.

Changelog coverage (prepush-changelog-coverage) is enforced on every push regardless of target branch -- dev branches are not exempt.

In monorepos the dev branch is workspace-global (no per-project dev branches).

Raises :class:ConfigError if the key is present but malformed (empty list or non-list value). An empty list would silently disable the manual-release-push warning, which is almost never what the user wants; require explicit removal of the key instead.

#_check_gitignore_guard

python
def _check_gitignore_guard(dir_path, *, extra_paths=None)

Check that rlsbl-managed files are not gitignored.

When extra_paths is provided, those paths are also checked (e.g., releasable-level changes files in explicit monorepo mode).

Returns an error string listing gitignored paths, or None if all clear.

#_check_jsonl_changelog

python
def _check_jsonl_changelog(dir_path, refs, pushed_commits=None, *, changes_dir=None)

Check JSONL changelog coverage for commits being pushed.

Verifies that every commit in the push range exists in at least one unreleased.jsonl entry's commits list.

When pushed_commits is provided, uses that set directly instead of calling _get_pushed_commits(refs). This allows callers (e.g. monorepo check) to pass a pre-filtered set of commits.

When changes_dir is provided, uses that directory instead of computing it from dir_path. This supports explicit releasable mode where the changes directory lives at the releasable level, not per-project.

Returns None on success, or an error message string on failure.

#_get_pushed_commits

python
def _get_pushed_commits(refs)

Get the set of commit SHAs being pushed.

Returns a set of full 40-char SHAs, or None on error.

#_read_stdin_lines

python
def _read_stdin_lines()

Read raw pre-push hook stdin lines.

Returns a list of non-empty lines, or None if stdin is not readable or empty.

#_parse_stdin_refs

python
def _parse_stdin_refs(stdin_lines=None)

Parse pre-push hook stdin to extract (local_sha, remote_sha) pairs.

Each line is:

When stdin_lines is provided (a list of raw lines), parses those directly instead of reading stdin. When omitted, reads stdin via _read_stdin_lines().

Returns a list of (local_sha, remote_sha) tuples, or None if the input is empty or unreadable.

More tools from this site

  • claudestream Drive Claude Code from Python: run it as a subprocess and read its output as typed events, with async and sync sessions, sandbox policies, and tools you define in Python
  • claudewheel A TUI Claude Code Launcher that lets you have more than one profile, manage sessions lifecycle, pick the exact CC version, model to use (even older unlisted ones), pick which GitHub account to use, etc.
  • dirstat Fast, single-binary directory statistics CLI: every file under a tree grouped by format, with counts, sizes, and lines of code, as a colored terminal table or as JSON
  • fastware A batteries-included ASGI framework: msgspec JSON, a managed Granian server, dependency injection, SSE, WebSockets, auth, and a test client
  • go-toml-edit Zero-dep TOML editing library for Go with comment preservation
  • howmuchleft The fastest Claude Code statusline: context window, 5-hour, and weekly limit usage as three customizable gradient bars, rendering in about 6 ms
  • orxtra
  • pgdesign
  • predraw Declarative rendering pipeline: describe a scene in JSON and get SVG, PNG and WebP out, with light and dark style tokens, reusable components and text converted to path outlines
  • reposummary Turn a git repository's history into a Markdown journal: pick a time window or revision range and get a readable digest of what changed, optionally narrated by an LLM
  • safegit git wrapper CLI that gives each commit its own temporary index and retries ref updates on conflict, so concurrent agents share one repository
  • saferm Command-line replacement for rm that archives every deletion with a mandatory reason and the context it ran in, so deleted files can be listed, inspected and restored
  • selfdoc Static Site Generator that builds a project's documentation site directly from its source code, so the docs can never drift from the code they describe, with SEO/AEO, first-class blog, search, and cross-project linking built in
  • strictcli
  • stricttest An always-on test-isolation floor: a pytest plugin and a Go env-hygiene module that make a test suite structurally unable to reach real credentials, the real HOME, the network, or the development repository.
  • wesktop A Python framework that turns an ASGI web app into a desktop application, serving it from a local Granian server and displaying it in a native OS window via pywebview
Search