Repository navigation
perf: batch Vocs page Git history lookup - #911
brendanjryan wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc319cf3e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| + : git(['rev-parse', 'HEAD'], directory) | ||
| + if (!dates || dates.head !== head) { | ||
| + const root = git(['rev-parse', '--show-toplevel'], directory) | ||
| + const log = git(['log', '-z', '--format=%cI%x00', '--name-only', '--', directory], directory) |
There was a problem hiding this comment.
Preserve merge-commit modification dates
When a page is changed while resolving a merge conflict, the previous per-file git log -1 -- <page> returns the merge commit, but this batched git log --name-only invocation does not emit filenames for merge commits unless a merge-diff mode is requested. The parser consequently skips the merge and assigns the page the date of a parent commit, producing stale page lastModified metadata and sitemap lastmod values; include an appropriate merge-diff mode or otherwise account for merge commits in the batch.
Useful? React with 👍 / 👎.
| + : git(['rev-parse', 'HEAD'], directory) | ||
| + if (!dates || dates.head !== head) { | ||
| + const root = git(['rev-parse', '--show-toplevel'], directory) | ||
| + const log = git(['log', '-z', '--format=%cI%x00', '--name-only', '--', directory], directory) |
There was a problem hiding this comment.
Retain other dates when one history path is unreadable
In a partial or offline clone where Git cannot load one historical tree beneath pagesDir, this directory-wide git log exits nonzero and the surrounding catch makes every getLastModified call return undefined, even for pages whose individual history remains readable. This also scans irrelevant files such as API .ts files under src/pages; in the checked-out repository, the batched command fails on a missing old tree while the previous per-file command still returns a date for src/pages/docs/api.mdx. Add a fallback or otherwise avoid making all page dates depend on every historical path being readable.
Useful? React with 👍 / 👎.
dc319cf to
acca885
Compare
acca885 to
a2a5755
Compare
Motivation
Vocs starts a separate
git logprocess for every page to resolve last-modified dates. On a tracked 990-page Tempo-like fixture, batching that lookup reduced the full build from 3m15s to 2m49s.Summary
Key design considerations