Repository navigation
A commit a shallow clone was cut at reads SKIP, not PASS, for whitespace, with a warning - #94
Open
closer-claudio wants to merge 1 commit into
Open
closer-claudio wants to merge 1 commit into
closer-claudio wants to merge 1 commit into
Conversation
…ace, with a warning In a shallow clone the commit the clone was cut at cannot have its whitespace checked: its parents are not there, and git shows it as adding the whole tree. The rule skipped it, said so under -D only, and reported a pass. A run with no range in a clone of depth 1, as actions/checkout makes by default, so checked no whitespace, printed PASS and said nothing. A result has a third state now: not checked, neither a pass nor a failure. - git.Check returns ErrParentsNotHere for such a commit, where it returned nothing. - The rule's result is not checked. Under -v its line is ` - SKIP - whitespace not checked: the commit's parents are not in this shallow clone`. - The commit's own line, and the exit status, are the verdict of the rules that ran. - A warning on standard error names the commit and what to do, at every verbosity, -q included: fetch the history, or give a range the clone holds. A deeper clone only moves the commit: a run with no range reaches the cut whatever the depth, so the warning asks for the history or a range and not for one more commit. What a consumer of the report sees: one `SKIP` rule line under -v where a `PASS` line was, in a shallow clone. Commit lines and the exit status do not move. TestContractWhitespaceNotCheckedInAShallowClone holds, through the command: a clone of depth 1 under -v, at normal verbosity and under -q (the SKIP line or its absence, the warning with the commit each time, exit 0); every rule together (the commit passes on the others); a clone of depth 2 with no range (the head checked, the cut skipped, one warning) and with a range it holds (checked, nothing logged). TestContractANotCheckedResultIsNeither holds how such a result is counted. Measured one at a time, files restored: with the skipped check reported as a pass, with the warning lowered to debug, and with a not-checked result counted as a failure, the command's test fails each time, and the counting test with the last. UPSTREAM.md's row on -D loses the skipped check, which is no longer a debug record; the README says what a shallow clone prints. For #93. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: closer-claudio <claudio@farcloser.world>
closer-claudio
enabled auto-merge
November 17, 2026 09:19
Author
|
Reviewed at d5e96f5 |
1 similar comment
Author
|
Reviewed at d5e96f5 |
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.
🎯 Why
In a shallow clone, the commit the clone was cut at cannot have its whitespace checked: its parents are not there, and git shows it as adding the whole tree. The dangling-whitespace rule skipped it, said so under
-Donly, and reported a pass.A run with no range in a clone of depth 1, as actions/checkout makes by default, so checked no whitespace, printed
PASSand said nothing: #93.🛠️ What
A rule's result has a third state: not checked, neither a pass nor a failure.
git.CheckreturnsErrParentsNotHerefor such a commit, where it returned nothing.-vits line is- SKIP - whitespace not checked: the commit's parents are not in this shallow clone.-qincluded: fetch the history, or give a range the clone holds.A deeper clone only moves the commit: a run with no range reaches the cut whatever the depth, so the warning asks for the history or a range, not for one more commit.
What a consumer of the report sees: one
SKIPrule line under-vwhere aPASSline was, in a shallow clone, and a warning on standard error. Commit lines and the exit status do not move.🧪 How
TestContractWhitespaceNotCheckedInAShallowClone(cmd/git-validation/contract_test.go), through the command: a clone of depth 1 under-v, at normal verbosity and under-q(theSKIPline or its absence, the warning with the commit each time, exit 0); every rule together (the commit passes on the others); a clone of depth 2 with no range (the head checked, the cut skipped, one warning) and with a range it holds (checked, nothing logged).TestContractANotCheckedResultIsNeither(validate/contract_test.go): how such a result is counted.just lintandjust testpass.📝 Notes
UPSTREAM.md's row on-Dloses the skipped check, which is no longer a debug record. The README says what a shallow clone prints.For #93.