This commit implements a significant performance optimization for the
`review_pull_requests.py` script by replacing O(N) subprocess calls with a
single bulk metadata fetch using `git for-each-ref`.
Key changes:
- Added `get_git_version()` helper to check for `ahead-behind` support (Git 2.41+).
- Implemented `fetch_bulk_branch_metadata()` to retrieve ahead/behind counts,
last commit dates, and latest subjects for all remote branches in one call.
- Introduced `BRANCH_METADATA_CACHE` to store metadata and avoid redundant
subprocess calls in `get_prs_via_git()` and `get_branch_info()`.
- Maintained output parity and provided a safe fallback for older Git versions.
Performance impact:
- Overall execution time reduced from ~0.89s to ~0.57s (~37% improvement).
- Script logic time (excluding Python startup) reduced from ~0.39s to ~0.07s
(>80% improvement for 300+ branches).