This repository was archived by the owner on Dec 3, 2026. It is now read-only.
Repository navigation
feat!: help says who answers each command; meta plugin list shows tool extensions; one shared error prints once [[tasks/harmony-3042]] - #158
Merged
Conversation
… extensions; one shared error prints once [[tasks/harmony-3042]]
- meta --help lists each plugin's own commands under its word, and what
becomes of the rest ("any other git command runs as typed in each
selected repo"), from the plugin's info. meta help <word> and
meta <word> --help read the same info.
- PluginHelp: `commands` are the plugin's own commands; new
`runs_as_typed` names the tool every other command runs as typed.
`command_sections` is gone (only meta-git used it).
- meta <word> <verb> --help starts with who answers it: "adapted by
meta-git" (then the plugin's help, ending with which of git's options
it takes) or "runs as typed (`git pull`) in each selected repo" (then
meta's own help for it: the selected repos, meta's options from its
clap definitions, and where git's help is). meta cargo has the same
shape and no "Commands: cargo".
- When every repo fails with the same output and exit, meta prints the
output once under all their names; the summary still counts each.
- meta plugin list adds the tool extensions on PATH (git-*, cargo-*) as
`meta git <name>`; meta plugin --help and the README say how a meta
plugin differs from a tool's own extension.
…cs test asks meta-git once [[tasks/harmony-3042]] The owner line of an adapted command no longer names a git command that may not exist (`git clone-missing`): "meta's own command, not git run as typed".
…tasks/harmony-3042]] A negated command mid-test (`! grep ...`) never fails a bats test. Checked: with the shadowing filter removed, the test now fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements [[tasks/harmony-3042]], from the owner's talk with Matt on 2026-11-02: "we need to improve the help commands", "meta --help should show plugin help as well", "plugin identification: git plugins vs meta plugins, anything on PATH should work".
This changes what help and discovery show. What every command does stays the same, plugins that redefine commands included. One exception, item 4: a failure every repo shares is now printed once.
What changed, item by item (before → after, from a sandbox with 3 repos plus the root repo)
1.
meta --helplists each plugin's commandsAll three help surfaces (
meta --help,meta help <word>,meta <word> --help) read one source, the plugin's info (PluginHelp.commandsplus the newruns_as_typed). New commands meta-git declares (like #157'sclone-*) show up with no other change.Before:
After:
2.
meta git --helpstates the pass-through ruleBefore: a "Pass-through Commands" section that listed only
status, plus a closing note.After:
3. A command's help starts by saying who answers it
meta <word> <verb> --helpandmeta help <word> <verb>take the same path. meta reads the answer from the plugin's info:Git options:line saying which of git's options it takes:commit: only -m and -e.update: none (it runsgit pull --ff-only).clone-missing/-prune/-sync: none (git has no such command).worktree: none (its commands are meta's). A meta-project command says`meta project list` is a command of meta-project.--include,--tagand-rchange it. The old scope, worked out inside meta-git, ignored them. The option list comes from meta's own option definitions, so it can't drift from them.meta cargo --helphas the same shape. The "Commands: cargo" list that repeated the plugin's own name is gone:meta cargo build --helpgets the same as-typed help asmeta git status --help.4. One error, not N copies
Before:
meta git frobnicateprinted git's "is not a git command" once for every repo (7 times in harmony), and then a summary line for every repo.After:
The output is grouped only when every repo fails with the same command, the same stdout and stderr, and the same exit code or signal. Differing errors still print per repo.
--jsonstill has one record per repo.5. Discovery: meta plugins and tool extensions in one place
meta plugin listkeeps its plugin table and adds a section:For each plugin that runs a tool as typed (git, cargo), the section lists the
<tool>-*executables on PATH. A name the plugin's own command shadows is left out (agit-commiton PATH never runs asmeta git commit).meta git hellorunsgit-helloin each repo. That already worked; now it is listed.Why a section and not
--tools: one command now answers "what can I run through meta?".--jsonis still the plugin array thatmeta_list_plugins(MCP) and atc read. No caller needs extensions there, and changing that array's shape would break them. Git's own programs installed in/usr/bin(git-upload-pack…) show up too. That is the plain PATH rule, and they do run asmeta git upload-pack.The paragraph that tells the two kinds apart is in the README,
meta plugin --helpandmeta plugin list --help: "A meta plugin (meta-) adds or adaptsmeta <word> .... A tool's own extension (git-) is just part of that tool, and runs through meta as typed".6. Docs
The README's plugin section (the two kinds, how help says who answers a command,
clone-*in the plugin table),docs/plugin_development.md(thecommands/runs_as_typedcontract and who answers--help), and the meta-plugins skill. Inmeta_cli/tests/docs.rs, the hard-coded list of adapted git commands is replaced by what meta-git declares, so the docs test can't fall out of step with meta-git either.Plugin protocol change (PluginHelp)
help_text(info)becomeshelp_text(word, info), andPluginInfo::verb(verb)answersOwn,AsTyped(tool)orUnknown. Only meta-git usedcommand_sections; gitkb/meta-plugins ships no plugins. An older plugin that still sends it parses fine, but its sections no longer show. meta-git no longer claimsgit statusin its routed commands. It still runs as typed, and the request's words are the same. A meta-git test checks that its routed commands and its help's commands are the same set.Decisions made without the owner
command_sections.defaults.parallelis true) capture each repo's output, and those are grouped.--sequentialwrites each repo's output to the terminal live, as the command runs (execute_command_in_directory,Stdio::inherit). That is what it is for:exec.batschecks that it keeps the order and the live output. Grouping there would mean holding every repo's stdout and stderr until all have finished, so a longmeta --sequential cargo buildwould show nothing until it ends.--sequentialonly the summary line is grouped (✗ ., ./api, ./web: git frobnicate (exit code 1)), and each repo's live output stays as it is.meta --sequential git frobnicatestill prints git's message once per repo, as it streams.--json(reason above).Tests (properties, existing patterns)
help.bats:meta --help,meta help fakeandmeta fake --helplist a fake PATH plugin's own commands and its as-typed rule.meta --helplists every command meta-git declares. Verb help starts with the right owner line for adapted (clone,commit,update) and as-typed (pull) commands, and for a meta-project command. Agit-helloon PATH shows inmeta plugin list(a shadowedgit-commitdoesn't) and runs asmeta git hello. The cargo help test now checks git's shape.exec.bats: a failure every repo shares prints once and the summary counts 4. Differing failures print per repo.--jsonkeeps 4 records.meta_git_cli: the adapted commands are exactly the routed ones, and each one's help has aGit options:line.meta_plugin_protocol: who answers a command, and the help text, followruns_as_typed.docs.rspasses, with the adapted list read from meta-git.Verified
--workspace --all-targets --all-features -D warnings;cargo nextest run --workspace(8 threads): 631/631; batstests/: 599/599 (the 5 install.ps1 tests skip: no pwsh here);docs.rspasses. c468b5f and ef4a651 change only tests, the docs test's caching and the owner-line wording; rechecked with clippy,docs.rs,help.batsandworktree_cloud.bats(70/70). The shadowed-extension check was confirmed to fail with the shadowing filter removed.git-helloon PATH: every output quoted above is from that run.Review
Two reviewers, two rounds, as the owner set for this PR:
--sequentialisn't grouped. Answered with the goal revision above.! grepmid-test). It was fixed in ef4a651 and shown to fail with the filter removed. Opus and Sol then both said yes on ef4a651.command_sectionsremoval). Answered: it is documented here, and the title is nowfeat!:. The thread is resolved.Not verified
<tool>-<name>.exefiles are listed as extensions.Try it
(Remove it afterwards with
git -C ~/code/gitkb-dev/harmony/open-source/meta worktree remove ~/code/gitkb-dev/harmony/.worktrees/try-meta-help.)