Skip to content
rlsbl.commands.monorepo.extract
On this page

The primitives both repository conversions share -- neither conversion is here: the shared error type, the filter-repo runners, dangling-entry pruning.

#rlsbl.commands.monorepo.extract

#rlsbl.commands.monorepo.extract

The primitives both repository conversions share.

NEITHER conversion is here any more. Both are reconcilers on the shared observe/preview/apply skeleton and both live beside this module: rlsbl monorepo extract in :mod:rlsbl.commands.monorepo.extract_cmd, and rlsbl monorepo absorb in :mod:rlsbl.commands.monorepo.absorb_cmd.

What stays is what both directions need: the shared error type, the git-filter-repo dependency check, the git and filter-repo runners with the timeouts a whole-history rewrite needs, the clone identity fix, and the dangling-changelog-entry pruning a rewrite leaves behind.

#ExtractError

Error during extract or absorb operations.

#require_filter_repo

python
def require_filter_repo()

Raise if git-filter-repo is not installed.

Checks that the git-filter-repo command is available on PATH. Raises ExtractError with install instructions if missing.

#_run_git

python
def _run_git(cwd, *args, timeout=GIT_TIMEOUT)

Run a git command and return stdout. Raises subprocess.CalledProcessError on failure.

#_run_filter_repo

python
def _run_filter_repo(cwd, *args)

Run git-filter-repo in cwd, wrapping failures in ExtractError.

Raw subprocess.CalledProcessError from a filter-repo run is an opaque stack trace to the caller; wrap it so the extract flow reports a clean, actionable error including filter-repo's own stderr.

#_ensure_git_identity

python
def _ensure_git_identity(clone_path, source_path)

Copy the source repo's committer identity into a fresh clone.

git clone does not carry over the source's local user.name / user.email, so a commit inside the clone can fail with "please tell me who you are" in environments without a global identity. We read the source's effective identity (local or global) and set it locally in the clone. If the source has none configured, the clone inherits whatever global identity exists (unchanged).

#_commit_resolves

python
def _commit_resolves(repo, commit_hash)

Whether commit_hash resolves to an existing commit object in repo.

#_prune_dangling_entries

python
def _prune_dangling_entries(changes_dir, repo_root)

Drop changelog entries whose commits no longer resolve after a rewrite.

Runs AFTER :func:remap_jsonl_hashes has mapped every survivable hash to its post-rewrite SHA. Any commit that still fails to resolve in repo_root was pruned by the filter (or was never mappable):

  • An entry with at least one surviving commit is kept, narrowed to just the

resolving hashes (a partial survival, logged).

  • An entry whose EVERY commit fails to resolve is DROPPED entirely, with a

loud log line -- never left dangling with a null/stale hash.

Returns {jsonl filename: entries dropped}, naming only the files that LOST entries. A dropped entry changes what the version's generated markdown should say, so the caller regenerates exactly those files' .md; a narrowed entry does not (the markdown carries descriptions, not hashes).

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