What I learned counting AI co-authored commits across 26,000 of my own
Описание и применение
Автор подсчитал, что 39 % его 26 251 коммита включают AI‑соавторов, используя скрытый в GitHub поисковый квалификатор co-authored-by: с адресом электронной почты и исправил SVG‑рисунки для корректного отображения в публичных репозиториях.
Задача
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