What I learned counting AI co-authored commits across 26,000 of my own
说明与用途
作者通过使用 GitHub 未公开的 co-authored-by: 搜索限定符(基于邮箱)以及修正 SVG 渲染,发现其 26,251 次提交中有 39% 涉及 AI 合作者。
问题
Determining accurate counts of AI‑co‑authored commits in a large codebase was difficult due to undocumented GitHub search qualifiers, ambiguous co‑author trailers, and image rendering limitations.
结果
Accurate AI‑co‑authored commit counts (39% overall, 2% public) were achieved by using email‑based search qualifiers, validating against total commits, and correcting SVG rendering for GitHub’s image proxy.
工作流
- 1. Run
git log --format='%b' | grep -c 'Co-Authored-By: Claude'to get local counts. - 2. Use GitHub CLI:
gh api '/search/commits?q=author:USER+co-authored-by:[email protected]&per_page=1' --jq '.total_count'to query GitHub API. - 3. Verify qualifier works by comparing counts for valid and invented qualifiers.
- 4. Check that
total_countis less than total commits to ensure qualifier filtering. - 5. Use email addresses from actual commit trailers (e.g.,
[email protected]) instead of display names to avoid false positives. - 6. Build SVG card rendering counts, ensuring the SVG declares final geometry before animation to support GitHub’s camo proxy.
- 7. Test rendering in environments that ignore SMIL to confirm bars appear correctly.
- 8. Deploy the tool locally in CI so the user’s PAT can access private repos, avoiding the 2% public‑only limitation.
证据
10,261 of 26,251 commits — 39%.
co-authored-by:[email protected] 10,261
co-authored-by:cursor 10033042
- 记录日期: 2026-09-22T07:00:23.721Z