Repository navigation
(docs): rank non-ancestor and ambiguous doc stamps as unknown, resolve the repo top level (#1399) - #1400
Merged
Conversation
… the repo top level (#1399) A stamp that is not an ancestor of HEAD, or that git cannot resolve to exactly one commit, now ranks as unknown sha. --repo-root inside a subdirectory resolves the repository top level. Tests pin literal pathspecs and rename/deletion counting; the fast-check context describes the current behaviour.
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.
Closes #1399
Summary
Follow-up to #1354 / #1398 for
scripts/doc-staleness.js:verifiedSHA that is not an ancestor of HEAD (stamp on a diverged branch) now ranksunknown sha(git merge-base --is-ancestor: exit 1 means not an ancestor, any other failure throws).unknown sha. Measured on git 2.24: an ambiguous short prefix makesrev-parse --verify --quiet <p>^{commit}exit 1 (without--quietit is 128, "short SHA1 ... is ambiguous"), a tree or blob SHA exits 1. The code also accepts exit 128 when stderr says "ambiguous", for git versions that differ; any other failure still throws.--repo-rootinside a subdirectory resolvesgit rev-parse --show-topleveland works from there..ai/contexts/fast-check.mddescribes the current behaviour: unknown sha cases, top-level resolution, rename and deletion counting, exact exit conditions.Developer tooling only:
no-changelog.Tests
test/doc-staleness.test.js(10 pass),test/check-docs.test.js(118 pass). New tests, all on real temp repos:expected: 'unknown sha',actual: 'verified'.expected: 'function',actual: 'undefined'(resolveStampCommitdid not exist).[]instead of the top-level report.:(literal)pin:src/a[1].jscovered bysrc/*.js, withsrc/a1.jsmodified then deleted after the stamp. Mutation (remove:(literal)):expected: 0,actual: 2; restored, hash verified.