Repository navigation
Description
pickcheck check --changed diffs the working tree against HEAD, so on a clean committed branch it checks nothing and exits 0. The pickcheck skill works around this with a git diff <base>...HEAD | xargs pickcheck check pipeline, which measures whole files instead of touched functions, and then asks for a second --changed run for uncommitted edits. A --base <ref> option makes one run cover the whole branch at function granularity.
Behavior
pickcheck check --base <ref>diffs the merge base of<ref>andHEADagainst the working tree (git diff --merge-base <sha>). That covers branch commits plus staged and unstaged edits. It is the same three-dot rule as a GitHub PR diff, so a stacked branch based on its parent branch shows only its own functions. Untracked files stay included in full, as today.--baseimplies--changed; passing both is accepted. Without--base,--changedis unchanged.- The ref is resolved once with
git rev-parse --verify --quiet --end-of-options <ref>^{commit}and the SHA is what reachesgit diff, so a ref starting with-cannot become an option. - An unresolvable ref, or no merge base (for example a shallow CI clone), exits 2 with a short error and does not scan. It never falls back to
HEAD, since that would pass silently. - The summary
DETAILShint keeps the scope:pickcheck check --base <ref> --verbose <file>. - Hooks keep diffing against
HEAD. - Existing Git hardening applies unchanged (no external diff or textconv, scrubbed
GIT_*env, paths resolved against the repo root).
Checklist
-
docs/spec.md: usage line and thechecksection describe--base, its errors, and the hint -
crates/core/src/diff.rs:changed_filestakes an optional base and resolves it as above -
crates/cli/src/main.rsandreport.rs: the flag and the scopedDETAILShint -
crates/cli/tests/cli.rs: committed-only change is reported; committed plus uncommitted plus untracked in one run; functions touched only on the base branch after the fork are not reported; unknown ref and no merge base exit 2 without scanning;--basealone behaves like--changed --base; a stacked branch reports only its own functions; a ref like--output=xis rejected safely - README usage example
- Release with the version bump and the exact
pickcheck-corepin incrates/cli/Cargo.toml
Follow-up
After the release, update the pickcheck skill through agent-config-sync to run pickcheck check --base origin/main. That replaces the xargs range script and the separate uncommitted-work step, and the note about failures in untouched legacy functions of whole files goes away. The baseline comparison in #30 changes the skill further, so the skill update is tracked there.
Activity
[-]check: add --base <ref> to scope --changed to a branch[/-][+]check: add --base <ref> to scope changes to a branch[/+]