MCPcopy
hub / github.com/github/awesome-copilot / get_git_churn

Function get_git_churn

skills/acquire-codebase-knowledge/scripts/scan.py:339–357  ·  view source on GitHub ↗

Get high-churn files from last 90 days.

()

Source from the content-addressed store, hash-verified

337
338
339def get_git_churn() -> List[str]:
340 """Get high-churn files from last 90 days."""
341 try:
342 result = subprocess.run(
343 ["git", "log", "--since=90 days ago", "--name-only", "--pretty=format:"],
344 capture_output=True,
345 text=True,
346 cwd=Path.cwd()
347 )
348 if result.returncode == 0:
349 files = [f.strip() for f in result.stdout.split('\n') if f.strip()]
350 # Count occurrences
351 from collections import Counter
352 counts = Counter(files)
353 churn = sorted(counts.items(), key=lambda x: x[1], reverse=True)
354 return [f"{count:4d} {filename}" for filename, count in churn[:CHURN_LIMIT]]
355 return []
356 except Exception:
357 return []
358
359
360def is_git_repo() -> bool:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected