MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / main

Function main

analyze_programming_time.py:210–253  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208
209
210def 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
2291cde4ca8a86d3f1ddc6bba2033dde06600a65eca|2025-06-08 14:49:21 -0700|fix: resolve critical segfaults in C extension
230b31b6b75955dba7608ea0faa116aba32014eb9c4|2025-06-08 13:19:24 -0700|style: apply code formatting to Rust implementation
231150515273ea331ebe68c9fea15d6b6c7795d4494|2025-06-08 13:19:11 -0700|docs: add comprehensive GA readiness plan for Python implementation
232e1f539e238077bfb1cdc72ee2adeeaf12febc780|2025-06-08 10:18:36 -0700|refactor: reorganize project structure for dual-language implementation
23379a19eee2a4dac5c5574f79c895af8db58c92db6|2025-06-08 09:49:15 -0700|docs: add performance benchmark charts demonstrating optimization impact
234054d1bd1db709e91525c2bd691c2a8cfc4bddf03|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
256if __name__ == "__main__":

Callers 1

Calls 5

create_visualizationsFunction · 0.85
parse_git_logFunction · 0.70
print_summaryFunction · 0.70

Tested by

no test coverage detected