Single git call for authors and dates#172
Conversation
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Main blocker: postprocess_site() references processor.build_git_cache, which doesn’t exist and will crash as soon as authors or JSON‑LD are enabled. Additionally, get_git_info() no longer falls back to direct git queries when the cache misses, so git metadata disappears whenever git_data isn’t populated. Both issues need fixing to keep the plugin functional.
💬 Posted 2 inline comments
git call for authors and dates
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review 2
Made with ❤️ by Ultralytics Actions
Please restore the legacy git fallback in get_git_info so standalone consumers still receive real timestamps/authors, and bump the TQDM progress bar per file so the post-process feedback remains accurate.
💬 Posted 2 inline comments
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
|
Absolutely awesome to see this merged, @glenn-jocher — a huge quality-of-life and performance win for the MkDocs plugin. 🚀
Centralizing git metadata handling, optimizing author and JSON-LD generation, and tightening the logging flow are exactly those “small things” that compound into a faster, more reliable, and more maintainable docs pipeline for everyone using Ultralytics tooling and Ultralytics HUB. Thank you for pushing the plugin forward with such a thoughtful, performance-focused refactor and for setting a high bar for future improvements. 🙌 |
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Speeds up and centralizes git metadata handling for the MkDocs plugin, improving author/JSON-LD generation performance and logging. 🚀
📊 Key Changes
0.2.1to0.2.2.build_git_map()to compute creation dates, last modified dates, and author email counts for all markdown files in a singlegit logpass.MetaPlugin.on_config()now precomputesgit_repo_urlandgit_dataonce when authors or JSON-LD are enabled, instead of doing it per page.process_html()andget_git_info()now use the precomputedgit_dataandrepo_urlinstead of callinggitrepeatedly.get_github_usernames_from_file()now accepts precomputed email counts and an optionalrepo_url, removing internalgit log/git blamecalls.postprocess_site()now:git_dataandrepo_urldown toprocess_html_file().TQDMprogress bars and a pluggablelogfunction for more controlled verbose logging during site postprocessing.logfunction whenverboseis enabled.🎯 Purpose & Impact
gitper page/file, significantly reducing build time when authors and JSON-LD are enabled.git logto generate stable, weighted author lists (with avatars and profiles) for pages.build_git_map, sharedrepo_url) simplifies future enhancements and debugging.