This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

TASK: Get the last 5 git commit messages and summarize the changes in 'git_summary.md'.
----------------------------------------
Loading...
┌─── 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'.