Alexander Petrov

January 23, 2026

compile git contributions to what_did_i_get_done_last_week.md

Yet another way to use LLM to avoid chores. Compile weekly report in a second with a simple script.
dependencies: uv, git+repo, open-ai token

#!/usr/bin/env bash
# what_did_i_get_done_last_week.sh
set -euo pipefail


since="${1:-1 week ago}"
until="${2:-now}"
out_dir="${3:-/tmp}"
author="${4:-$(git config user.email || true)}"
report_path="${out_dir%/}/git_last_week_report.txt"
prompt_path="${out_dir%/}/git_last_week_prompt.txt"


repo_root="$(git rev-parse --show-toplevel)"
cd "$repo_root"


{
  echo "Git activity from '$since' to '$until'"
  echo
} > "$report_path"


if [[ -z "$author" ]]; then
  echo "Missing author filter; set git user.email or pass an author as arg 4."
  exit 1
fi


commit_list="$(git log --since="$since" --until="$until" --author="$author" --reverse --format='%H')"


if [[ -z "$commit_list" ]]; then
  echo "No commits found." >> "$report_path"
  cat "$report_path"
  exit 0
fi


while IFS= read -r commit; do
  [[ -z "$commit" ]] && continue
  git show --stat --no-patch --pretty='format:%C(auto)%h %ad %s%n' --date=short "$commit" >> "$report_path"
  git show --stat --patch --pretty='' "$commit" >> "$report_path"
  echo >> "$report_path"
done <<< "$commit_list"


cat > "$prompt_path" <<'EOF'
You are given a git activity log for the last week. Produce a concise "What I did last week" report that emphasizes business/product impact.
Rules:
- Focus on the main theme of the week; merge related work into a single narrative.
- Write as if sending to Elon Musk: direct, outcome-driven, no fluff.
- Prioritize user-facing features, workflows enabled, or risks reduced over code mechanics.
- If only technical details are present, infer likely product outcomes in plain English.
- Avoid file paths, class names, and dependency lists unless they are crucial to the outcome.
- Avoid mentioning refactors or internal code cleanups; if needed, reframe as impact.
Format:
- 3-6 bullets, each a single sentence.
- Start each bullet with a strong verb.
- Avoid repeating commit subjects verbatim; synthesize.
- Output should be human-reader friendly: plain English, minimal jargon.
EOF


cat "$prompt_path" "$report_path" | uvx llm

About Alexander Petrov


I build products for fun and profit.
web page