()
| 208 | |
| 209 | |
| 210 | def main(): |
| 211 | # Read git log data from file or use command output |
| 212 | try: |
| 213 | # Try to get fresh git log data |
| 214 | import subprocess |
| 215 | |
| 216 | result = subprocess.run( |
| 217 | ["git", "log", "--pretty=format:%H|%ad|%s", "--date=iso", "--all"], |
| 218 | capture_output=True, |
| 219 | text=True, |
| 220 | cwd=".", |
| 221 | ) |
| 222 | if result.returncode == 0: |
| 223 | git_log_output = result.stdout |
| 224 | else: |
| 225 | raise Exception("Git command failed") |
| 226 | except: |
| 227 | # Fallback to hardcoded data if git command fails |
| 228 | git_log_output = """f94aa9479bba269ffa10dae4098b94fea8d0c86a|2025-06-08 14:56:12 -0700|feat: implement complete dictionary API for Python B+ Tree |
| 229 | 1cde4ca8a86d3f1ddc6bba2033dde06600a65eca|2025-06-08 14:49:21 -0700|fix: resolve critical segfaults in C extension |
| 230 | b31b6b75955dba7608ea0faa116aba32014eb9c4|2025-06-08 13:19:24 -0700|style: apply code formatting to Rust implementation |
| 231 | 150515273ea331ebe68c9fea15d6b6c7795d4494|2025-06-08 13:19:11 -0700|docs: add comprehensive GA readiness plan for Python implementation |
| 232 | e1f539e238077bfb1cdc72ee2adeeaf12febc780|2025-06-08 10:18:36 -0700|refactor: reorganize project structure for dual-language implementation |
| 233 | 79a19eee2a4dac5c5574f79c895af8db58c92db6|2025-06-08 09:49:15 -0700|docs: add performance benchmark charts demonstrating optimization impact |
| 234 | 054d1bd1db709e91525c2bd691c2a8cfc4bddf03|2025-06-08 09:48:06 -0700|Merge pull request #6 from KentBeck/feature/fuzz-testing-and-benchmarks""" |
| 235 | |
| 236 | # Parse commits |
| 237 | commits = parse_git_log(git_log_output) |
| 238 | |
| 239 | if not commits: |
| 240 | print("No commits found to analyze!") |
| 241 | return |
| 242 | |
| 243 | # Calculate programming sessions (assuming gaps > 2 hours indicate breaks) |
| 244 | sessions = calculate_programming_sessions(commits, max_gap_minutes=120) |
| 245 | |
| 246 | # Analyze daily data |
| 247 | daily_data = analyze_daily_programming(sessions) |
| 248 | |
| 249 | # Print summary |
| 250 | print_summary(sessions, daily_data) |
| 251 | |
| 252 | # Create visualizations |
| 253 | create_visualizations(sessions, daily_data) |
| 254 | |
| 255 | |
| 256 | if __name__ == "__main__": |
no test coverage detected