diff --git a/bin/cut_release/main.py b/bin/cut_release/main.py index 925d9e98..3043925f 100644 --- a/bin/cut_release/main.py +++ b/bin/cut_release/main.py @@ -1,9 +1,8 @@ -"""Cut the next release of the clone this tool ships in, the development clone; with --patch, a patch release of only the commits named. +"""Cut the next release of the clone this tool ships in; with --patch, a patch release of only the commits named. usage: cut-release [--patch ] -A clone of a release takes the release with its own bin/self-update. - +Run the development clone's copy, as in bin/cut-release there: it cuts that clone, whatever the directory it is run from. It cuts the next release, as chunk-preflight works it out, and refuses without changing anything, unless that release holds no item in todo.md, its release review has landed, as chunk-preflight --help counts one, and changes are unreleased. The release names the version; the tool doesn't choose one. It also refuses a @@ -19,8 +18,8 @@ with --patch. there it rebase-merges the branch, which is already on top of main. 3. It tags the merged commit v, annotated `Cut release `, pushes only the tag, and deletes the branch on origin. A failed delete only warns. -It says on stderr as each step finishes, and prints the line -`Done: v is cut and pushed. Each clone of a release takes it with its bin/self-update.` +It says on stderr as each step finishes, and prints on stdout the line +`Done: v is cut and pushed. Each clone of a release takes it with its own bin/self-update.` It keeps each of those lines, with its time in UTC, in the run's trace: a file of its own under $XDG_STATE_HOME/build-release/cut-release (default ~/.local/state/build-release/cut-release), named by when the run began. --patch does too. Where Ctrl-C or an unexpected fault ends the run, the trace ends with a line that starts `stopped:`. @@ -47,7 +46,7 @@ doesn't hold, and on a GitHub origin, whose rebase merge would drop the tag from 5. On a fresh origin/main it merges the tag keeping main's files, moves the release's entries from ## Unreleased to a ## section below it, commits that titled `Merge release into main`, and lands it through the branch release- and a pull request as a cut without --patch does. Then it checks main holds the tag. -It ends stdout as a cut without --patch does. +It prints the same `Done:` line on stdout as a cut without --patch does. A rerun takes a tag origin holds already, once it checks the tag lists the same changelog entries, and the merge-back's open pull request. Once the merge-back has merged, the release is cut. """ diff --git a/bin/cut_release/trace.py b/bin/cut_release/trace.py index 95717655..75d920fc 100644 --- a/bin/cut_release/trace.py +++ b/bin/cut_release/trace.py @@ -50,7 +50,7 @@ def kept(trace: pathlib.Path | None, line: str, now: Clock, out: typing.TextIO) def saying(trace: pathlib.Path | None, now: Clock, out: typing.TextIO) -> Say: - """Says each step on out, so the human sees how far the cut got before the changelog fills the screen, and keeps it in trace.""" + """Says each step on out, so the human sees how far the cut got, and keeps it in trace.""" def say(step: str) -> None: print(f"cut-release: {step}", file=out) kept(trace, step, now, out) diff --git a/docs/decisions.md b/docs/decisions.md index c8d80406..6246833e 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -156,11 +156,11 @@ Valid while `~/.claude` is a checkout of this repo. 2026-11-08, lilleman, todo item 271. Serves goal 1.5 and goal 2. Nobody can push to `main` on the remote, and it merges only by fast-forward, so a cut that commits on `main` and pushes no longer works. The tool cuts only the release `chunk-preflight` would call ready to cut, through `bin/release_plan/release_standing.py`, so the two never disagree on which release is next or whether it is ready; the version is that release's, never the tool's choice. It builds the cut commit in a worktree of its own, so the clone's checkout stays as it is. It finds the merged commit on `main` by its title, `Cut release `, since GitHub's nearest merge, a rebase merge, may give the commit a new hash. It takes only a pull request from origin's own branch whose head is the commit that branch points at, and has the forge merge it only while its head is still that commit, so a fork's pull request from a branch of the same name, or a push after the checks passed, is never merged and tagged. Each step first checks whether an earlier run did it, so a rerun continues. Releases stay the human's, so the human runs it, and the forge credentials stay theirs. Valid while `main` takes changes only through a pull request. -2026-11-24, lilleman, todo item 536. `cut-release --patch ` cuts the newest tag's next patch release, holding only the commits named, for a fix that must ship before `main`'s other unreleased work. Before it, 0.15.1 was cut by those steps by hand. The patch's commit has the tag as its parent, not `main`'s head, so no pull request into `main` can merge it, and CI runs only on pull requests: the tool runs `ci.sh` on it, as CI does, before it tags. Then it merges the tag back into `main` with `-s ours` through a pull request, so the tag is in `main`'s history, where the next cut and `chunk-preflight` read it. GitHub's rebase merge would drop that merge commit, so the tool refuses a GitHub origin. A patch skips the release review: `chunk-preflight` still calls it due until the patch is cut, so cut a patch as soon as its fix merges. Plain `--cut` refuses a patch of the newest tag, since it would ship all of `main` under a patch number. A panel of three readers seated as the owner picked the spelling `--cut-patch` over `--cut --patch` and `--hotfix`: one flag that names the action, which can't be read as a plain `--cut`. +2026-11-24, lilleman, todo item 536. `cut-release --patch ` cuts the newest tag's next patch release, holding only the commits named, for a fix that must ship before `main`'s other unreleased work. Before it, 0.15.1 was cut by those steps by hand. The patch's commit has the tag as its parent, not `main`'s head, so no pull request into `main` can merge it, and CI runs only on pull requests: the tool runs `ci.sh` on it, as CI does, before it tags. Then it merges the tag back into `main` with `-s ours` through a pull request, so the tag is in `main`'s history, where the next cut and `chunk-preflight` read it. GitHub's rebase merge would drop that merge commit, so the tool refuses a GitHub origin. A patch skips the release review: `chunk-preflight` still calls it due until the patch is cut, so cut a patch as soon as its fix merges. A cut without the patch flag refuses a patch of the newest tag, since it would ship all of `main` under a patch number. A panel of three readers seated as the owner picked the spelling `--cut-patch` over `--cut --patch` and `--hotfix`: one flag that names the action, which can't be read as a plain `--cut`. The flag is `cut-release --patch` since 2026-12-03, below. 2026-11-27, lilleman, the release review of 0.16.0. A release review on `main` counts only for the release its title names, which must be exactly the next release, as `chunk-preflight --help` states. So the patch's own review, which the merge leaves on `main` after the tag, doesn't review any later release, and neither does a review opened under a release name todo.md has since changed. Where todo.md names no next release, a review of any release after the last cut counts. -2026-12-03, lilleman, in the standalone-install plan: cutting is another job than updating, so it is a command of its own, `cut-release`, which cuts the clone it ships in, whatever directory it is run from; so it no longer checks that the directory's origin is the release's. It no longer moves a clone to the tag either: a clone of a release may be anywhere, and each takes the release with its own `self-update`. Three fresh readers, seated as above, each picked `cut-release --patch ` over a bare `cut-release `, which read as a release built from those commits, and over `release-cut` and a second tool, `cut-patch-release`. Serves goal 2. +2026-12-03, lilleman, in the standalone-install plan: cutting is another job than updating, so it is a command of its own, `cut-release`. It cuts the clone it ships in, whatever directory it is run from, so it no longer checks that the directory's origin is the clone's. It no longer moves a clone to the tag either: a clone of a release may be anywhere, and each takes the release with its own `self-update`. Three fresh readers, seated as a person who installed a release, a consultant new to it and the maintainer, each picked `cut-release --patch ` over a bare `cut-release `, which read as a release built from those commits, and over `release-cut` and a second tool, `cut-patch-release`. Serves goal 2. ## epic-branch: an epic's chunks branch off and merge into a working branch its project's config names, without a person, and a person merges that branch into the default branch in one pull request