Rename the scripts that update the policy files

script/commit-current-upstream-policy-docs is now
script/write-upstream-policy-files: it writes the policy files and
commits nothing. script/update-policy is now
script/commit-upstream-policy-files, and make update-policy is now
make commit-upstream-policy-files. test/update-policy.sh follows.
Behaviour is unchanged.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-15 06:11:27 +00:00
1 parent 62178c82a0
commit 4b9cf3efec
10 files changed
+234 -226

No files matched your search

+25 -23
View File
@@ -93,7 +93,8 @@ style conventions are in separate documents:
- `make check` (runs `test`, `lint`, `fmt-check`)
- `make docker`
- `make hooks` (installs pre-commit hook)
- `make update-policy` (brings the repo up to standards and commits)
- `make commit-upstream-policy-files` (brings the repo up to standards and
commits)
A model Makefile is at
`https://git.eeqj.de/sneak/prompts/raw/branch/main/Makefile`.
@@ -110,8 +111,8 @@ style conventions are in separate documents:
- `script/fmt-check`
- `script/check`
- `script/docker`
- `script/commit-current-upstream-policy-docs`
- `script/update-policy`
- `script/write-upstream-policy-files`
- `script/commit-upstream-policy-files`
The scripts must be POSIX sh (`#!/bin/sh`, `set -eu`, no bashisms) so they
run in minimal containers; alpine images, for example, have no bash. Locate
@@ -191,13 +192,13 @@ style conventions are in separate documents:
`script/check`.
- `script/install-precommit` installs the git pre-commit hook. The
`make hooks` target shims to it.
- `script/commit-current-upstream-policy-docs` fetches the vendored policy
files from the `prompts` repo over HTTP and writes them into the repo it
is given, or its own repo with no argument.
- `script/update-policy` fetches the current
`script/commit-current-upstream-policy-docs` from the `prompts` repo, runs
it on its own repo and commits the result. It does not push. The
`make update-policy` target shims to it.
- `script/write-upstream-policy-files` fetches the vendored policy files
from the `prompts` repo over HTTP and writes them into the repo it is
given, or its own repo with no argument.
- `script/commit-upstream-policy-files` fetches the current
`script/write-upstream-policy-files` from the `prompts` repo, runs it on
its own repo and commits the result. It does not push. The
`make commit-upstream-policy-files` target shims to it.
- `script/projectname` (literally that filename) simply outputs the
project's name.
@@ -937,21 +938,22 @@ style conventions are in separate documents:
- Make all changes on a feature branch. You can do whatever you want on a
feature branch.
- One command brings a repo up to standards: `make update-policy`. It runs
`script/update-policy`, which fetches the current
`script/commit-current-upstream-policy-docs` from the head of `main` in the
`prompts` repo and runs it on the repo. It then commits the files that changed
and does not push, so a person reviews and pushes the commit.
- One command brings a repo up to standards:
`make commit-upstream-policy-files`. It runs
`script/commit-upstream-policy-files`, which fetches the current
`script/write-upstream-policy-files` from the head of `main` in the `prompts`
repo and runs it on the repo. It then commits the files that changed and does
not push, so a person reviews and pushes the commit.
`script/commit-current-upstream-policy-docs` fetches each vendored file from
`script/write-upstream-policy-files` fetches each vendored file from
`prompts` over HTTP and writes it into the repo. It skips a language's files
when git tracks no source file of that language. A file the repo lacks is
written whole. A `prompts/NAME.md` goes to `docs/NAME.md`, unless the repo
keeps it at `NAME.md`. It also writes
`script/commit-current-upstream-policy-docs` and `script/update-policy` into
the repo, so a repo updated once can update itself. The list of vendored
files is at the top of `script/commit-current-upstream-policy-docs`. The
script replaces each file and keeps only the repo's own entries:
keeps it at `NAME.md`. It also writes `script/write-upstream-policy-files`
and `script/commit-upstream-policy-files` into the repo, so a repo updated
once can update itself. The list of vendored files is at the top of
`script/write-upstream-policy-files`. The script replaces each file and
keeps only the repo's own entries:
- in `.gitignore`, `.editorconfig` and `.dockerignore`: the lines below the
comment that ends the canonical file
- in a `.gitignore` or `.dockerignore` lacking that comment: every entry the
@@ -1184,8 +1186,8 @@ style conventions are in separate documents:
- `Makefile`
- `script/` entrypoints (`bootstrap`, `setup`, `projectname`, `test`,
`lint`, `fmt`, `fmt-check`, `check`, `docker`, `cibuild`, `precommit`,
`install-precommit`, `commit-current-upstream-policy-docs`,
`update-policy`)
`install-precommit`, `write-upstream-policy-files`,
`commit-upstream-policy-files`)
- `Dockerfile`, `.dockerignore`
- `.gitea/workflows/check.yml`
- Go: `go.mod`, `go.sum`, `.golangci.yml`