mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-10 22:30:56 +00:00
This commit refactors `scripts/review_pull_requests.py` to use bulk Git metadata
retrieval, significantly reducing the number of subprocess calls to the `git` CLI.
Key improvements:
- Replaced O(N) `git log` and `git branch` calls with a single `git for-each-ref`
command utilizing the `%(ahead-behind)` atom (Git 2.41+).
- Implemented `BRANCH_METADATA_CACHE` to store ahead/behind counts, last commit
dates, and commit subjects.
- Added robust Git version detection and a safe fallback for older Git versions.
- Used a multi-character delimiter (|||) to safely handle commit subjects containing
pipes or other special characters.
- Maintained data parity by ensuring unmerged branches still fetch up to 5 recent
commits while merged branches correctly report 0 commits in the range.
Performance impact:
- Reduced execution time from ~0.74s to ~0.37s in a repository with 320+ remote
branches (approx. 50% improvement).
- Subprocess calls reduced from hundreds (proportional to branch count) to ~10.
⚡ Bolt: Speed is a feature. Measure first, optimize second.
|
||
|---|---|---|
| .. | ||
| bolt.md | ||
| deploy.yml | ||