A script for generating a daily report of user's git commits for a selected date.
- Create and activate a virtual environment:
deactivate && rm -rf venv && python3.12 -m venv venv && source venv/bin/activate && python --version
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile and add your OpenAI API key:OPENAI_API_KEY=sk-...your_key...
- Run the script:
If no date is specified, yesterday's date will be used.
python git_daily_report.py --date YYYY-MM-DD
python git_daily_report.py --date 2024-06-01--repo- path to git repository (default is current directory)--email- author's email for commits (default is current user's commits)--use-gpt- send prompt to ChatGPT API and display result (requires OPENAI_API_KEY environment variable or .env file)
- Python 3.7+
- git (must be installed and configured with user.name)
- openai, python-dotenv (for sending requests to ChatGPT API and loading environment variables)
- The script groups commits by branches and generates a structured report.
- For proper operation, git must be configured and you must be in a git repository.