mt rm
mt rm retires tasks. In a git repository it records a swh:1:rev id for each task, rewrites every links: edge to that id, and deletes the file. It doesn’t commit. Outside git, [rm] strategy decides what happens to those edges.
Refer to a task by stem, hash or path. Give a folder under a task root instead, and mt rm retires every task inside it too, as if you had listed each file. Try mt rm tasks/sw1 --dry-run to see the list first. mt rm refuses a folder outside every root.
A [[on.rm]] hook runs before the removal writes anything. A gate then refuses it while every file is still there. A dry run doesn’t run a hook.
Delete tasks, keeping links to them findable in git history
Links to a deleted task become a SWHID, an ID that still finds its file in git history.
TARGET takes any number of entries, each a task reference or a filter. mt rm retires every task any entry matches, in one pass, and asks you to confirm once.
Runs on one project and refuses a set.
[TARGETS]… | What to delete: tasks, folders, or a filter such as Each is a task (stem, hash or path), a folder under a task root (every task inside it, however deep) or a filter such as
|
-y, --yes | Don't ask for confirmation Without a terminal on stdin |
--dry-run | Show the deletions and rewrites without changing anything |
$ mt rm terminal --dry-run # the plan, nothing written
would delete 4 tasks:
- tasks/add-request-ids-to-log-lines.typ
- tasks/fix-the-404-page-typo.typ
- tasks/pin-the-rust-toolchain-in-ci.typ
- tasks/upgrade-the-axum-web-framework.typ
dry run: nothing written
$ mt rm fix-the-404-page-typo --yes # by reference
deleted 1 task:
- tasks/fix-the-404-page-typo.typ
review the changes and commit when satisfied
$ mt rm upgrade-the-axum-web-framework pin-the-rust-toolchain-in-ci --yes # two references, one pass
deleted 2 tasks:
- tasks/pin-the-rust-toolchain-in-ci.typ
- tasks/upgrade-the-axum-web-framework.typ
review the changes and commit when satisfied
$ mt rm 'status == "done"' --yes # by filter: every match
deleted 1 task:
- tasks/add-request-ids-to-log-lines.typ
review the changes and commit when satisfiedEvery command also takes the global flags.