fix(scan): make git-history and staged modes behave like the others - #88
Draft
pixincreate wants to merge 1 commit into
Draft
fix(scan): make git-history and staged modes behave like the others#88pixincreate wants to merge 1 commit into
pixincreate wants to merge 1 commit into
Conversation
git-history ignored --exclude and the baseline-file exclusion, so it scanned every historical revision of a committed baseline, and it keyed every finding under a synthetic <git-history> path that no baseline entry could ever match. Because git log -p emits the same diff framing as git diff --cached, history now reuses the staged parser: real file paths, real line numbers, exclusions applied. git log gets the same config hardening as git diff. diff.relative made git emit cwd-relative paths and drop changes outside the current directory, so running the staged scan from a subdirectory silently reported clean while a staged secret sat one level up. It is now pinned off alongside the other diff settings.
pixincreate
force-pushed
the
fix/scan-mode-consistency
branch
from
August 26, 2026 17:32
2eccaf5 to
9798514
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #87.
Summary
Two scan modes behaved differently from the rest in ways that lost findings.
Changes
--git-historyignored--excludeand the baseline-file exclusion, so it scanned every historical revision of a committed baseline, and it keyed all findings under a synthetic<git-history>path that no baseline entry could ever match. Sincegit log -pemits the same diff framing asgit diff --cached, history now reuses the staged parser — real file paths, real line numbers, exclusions applied.git logalso gets the config hardeninggit diffalready had.diff.relativesilently under-scanned. Withdiff.relative = truein a user's git config, runningscan --stagedfrom a subdirectory reported clean while a staged AWS key sat one level up (reproduced). Now pinned off with the other diff settings.Tests
186 pass. New: history findings carry real paths and respect
--exclude; a staged scan underdiff.relative=truefrom a subdirectory still fails.