Pro. For “what did my branch add, and nothing else?”
penthera diff scans your repo twice: as it is now, and as it was at the
merge-base of HEAD and main. It shows only the findings the merge-base
does not have. Old findings you did not touch stay out of the way, so a pull
request review or a pre-push check is about your change.
What counts as new
A finding is new when the merge-base has no finding with the same identity, or its severity went up, or a secret or an eval or exec sink holds more than it did. It is the same comparison as--baseline. A key moved to another
line is not new. A second key in the same file is.
The current side is your working tree, so uncommitted changes count. A
finding in a file git ignores (a local .env, say) is left out: it is on no
branch. The brief’s Not checked section says how many findings the
merge-base had too and how many your branch fixed.
How it works
git merge-base HEAD <ref>finds the commit your branch started from.git archivewrites that commit’s files into a temporary folder. Nothing in your repo, its index or its work tree changes, and the folder is removed afterwards.- Penthera scans both folders with the same rules and compares them.
<ref> is what your clone has. In CI
or a fresh clone, run git fetch origin main first and compare with
origin/main.
Limits
- It is a repo scan (
--repo). Dependencies (penthera deps --base origin/main) and agent config have their own commands. - A file marked
export-ignorein.gitattributesis missing from the merge-base side, so its findings show as new. - It scans twice, so it takes about twice as long as
penthera --repo ..