Get recent git commits.
()
| 321 | |
| 322 | |
| 323 | def get_git_commits() -> List[str]: |
| 324 | """Get recent git commits.""" |
| 325 | try: |
| 326 | result = subprocess.run( |
| 327 | ["git", "log", "--oneline", "-n", str(RECENT_COMMITS_LIMIT)], |
| 328 | capture_output=True, |
| 329 | text=True, |
| 330 | cwd=Path.cwd() |
| 331 | ) |
| 332 | if result.returncode == 0: |
| 333 | return result.stdout.strip().split('\n') if result.stdout.strip() else [] |
| 334 | return [] |
| 335 | except Exception: |
| 336 | return [] |
| 337 | |
| 338 | |
| 339 | def get_git_churn() -> List[str]: |