17 lines
1.3 KiB
Plaintext
Raw Normal View History

2026-01-29 06:54:10 +01:00
TASK: Get the last 5 git commit messages and summarize the changes in 'git_summary.md'.
----------------------------------------
Loading...
2026-01-29 07:42:06 +01:00
┌─── Python Source Code ─────────────────────────────────────
│  1 | import subprocess
│  2 | # Get last 5 git commit messages
│  3 | result = subprocess.run(['git', 'log', '-n', '5', '--pretty=format:%s'], capture_output=True, text=True)
│  4 | commit_messages = result.stdout.strip().split('\n')
│  5 | # Summarize changes
│  6 | summary = "Last 5 commits:\n" + "\n".join(commit_messages)
│  7 | # Write to file
│  8 | with open('git_summary.md', 'w') as f:
│  9 | f.write(summary)
└────────────────────────────────────────────────────────────
The last five git commit messages have been retrieved and summarized in the file 'git_summary.md'.