{"id":32786802,"url":"https://github.com/iloveitaly/git-history-extraction","last_synced_at":"2026-01-19T21:01:00.946Z","repository":{"id":321803191,"uuid":"1087183179","full_name":"iloveitaly/git-history-extraction","owner":"iloveitaly","description":"Extract and analyze git commit history with support for filtering by trailers, date ranges, and AI-powered summarization for changelogs","archived":false,"fork":false,"pushed_at":"2026-01-16T19:59:53.000Z","size":235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-17T06:02:20.398Z","etag":null,"topics":["ai","changelog","commit","gemini","git","history","openai","summarization","trailers"],"latest_commit_sha":null,"homepage":"https://github.com/iloveitaly/git-history-extraction","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iloveitaly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["iloveitaly"]}},"created_at":"2025-10-31T13:59:18.000Z","updated_at":"2026-01-16T19:59:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/iloveitaly/git-history-extraction","commit_stats":null,"previous_names":["iloveitaly/git-history-extraction"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/iloveitaly/git-history-extraction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgit-history-extraction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgit-history-extraction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgit-history-extraction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgit-history-extraction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iloveitaly","download_url":"https://codeload.github.com/iloveitaly/git-history-extraction/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iloveitaly%2Fgit-history-extraction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28585190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","changelog","commit","gemini","git","history","openai","summarization","trailers"],"created_at":"2025-11-05T05:01:38.640Z","updated_at":"2026-01-19T21:01:00.935Z","avatar_url":"https://github.com/iloveitaly.png","language":"Python","funding_links":["https://github.com/sponsors/iloveitaly"],"categories":[],"sub_categories":[],"readme":"# git-history-extraction\n\nA tool to extract and filter git commit history, making it easy to pipe to AI tools for changelog generation and summaries.\n\n## Features\n\n- Extract git commits with metadata (SHA, date, files, message)\n- Filter commits by time range or starting commit\n- Extract and filter git trailers (e.g., `Co-authored-by`, `User-Facing`)\n- Output in simple text or JSON format\n- Pipe output to AI tools (OpenAI, Gemini, Claude) for automated summarization\n\n## Installation\n\n### Using uv (Recommended)\n\nNo installation needed! The tool can be run directly:\n\n```bash\nuv run git-history-extraction --help\n```\n\n### Install as Package\n\n```bash\npip install git-history-extraction\n```\n\n## Usage\n\n### Basic Examples\n\nExtract commits from the last 24 hours (default):\n```bash\ngit-history-extraction\n```\n\nExtract commits from the last 7 days:\n```bash\ngit-history-extraction --since \"7 days ago\"\n```\n\nExtract commits from a specific repository:\n```bash\ngit-history-extraction --repo /path/to/repo --since \"1 week ago\"\n```\n\n### Output Formats\n\nSimple text format (default):\n```bash\ngit-history-extraction --since \"1 day ago\"\n```\n\nJSON format for piping to other tools:\n```bash\ngit-history-extraction --since \"1 day ago\" --format json\n```\n\nTOON format (compact, LLM-optimized):\n```bash\ngit-history-extraction --since \"1 day ago\" --format toon\n```\n\n### Commit Range Selection\n\nBy time range:\n```bash\ngit-history-extraction --since \"2024-01-01\"\n```\n\nFrom a specific commit to HEAD:\n```bash\ngit-history-extraction --since-commit abc1234\n```\n\n### Git Trailers\n\nExtract specific trailers only (case-insensitive):\n```bash\ngit-history-extraction --since \"1 week ago\" --trailers \"co-authored-by,reviewed-by\"\n```\n\n## Piping to AI Tools for Summarization\n\nThis tool extracts and formats git history, making it easy to pipe to AI tools for summarization. The tool itself **does not perform AI summarization**—it prepares the data so you can use your preferred AI tool.\n\nThe tool enables you to extract targeted slices of git history for different audiences. For example, use git trailers like `User-Facing:` to mark end-user changes, then extract and pipe them to AI for changelogs or internal notifications.\n\n### Creating Structured Git Trailers with AI\n\nCombine with [aiautocommit](https://github.com/iloveitaly/aiautocommit) to automatically generate git trailers during commits. This creates a structured history that can be easily filtered and summarized for different audiences.\n\n**Example custom commit prompt for aiautocommit:**\n\n```markdown\n# IMPORTANT: Your Instructions\n\nYou are an expert software developer. Generate a commit message from the `git diff` output below using these rules:\n\n## 1. Subject Line\n\n- Use a conventional commit prefix:\n  - `feat`: New features\n  - `fix`: Bug fixes, including user-visible design or style fixes.\n  - `docs`: Changes only to internal documentation (e.g., `.md`, `.rst`) or code comments.\n  - `style`: Formatting, linting, or code style changes in code files.\n  - `refactor`: Code structure improvements (no behavior changes).\n  - `build`: Updates to build scripts or configs (e.g., `Makefile`, `Justfile`, `Dockerfile`, `package.json`).\n  - `deploy`: Deployment script or IAC updates.\n  - `test`: Changes to tests\n- Add optional scope in parentheses when changes affect a specific module (e.g., `feat(auth): add login`)\n- Limit to 50 characters after the prefix and scope.\n- Use imperative mood (e.g., \"improve layout\").\n- Describe the intent or outcome (e.g., \"prevent text overflow\" not \"add break-all\").\n- Be specific about the change (\"validate email format\" not \"improve validation\").\n\n## 2. Extended Commit Message\n\n- Include only if changes have non-obvious implications, fix complex bugs, or introduce breaking changes.\n- Separate from subject with one blank line.\n- Use markdown bullets focusing on **why** the change was needed and **what impact** it has.\n- Mention side effects, user impact, or important trade-offs.\n\n## 3. User-facing Changes\n\nIf the change is something that a end-user (not internal admin!) would see, include a `User-facing:` git trailer with a sentence\nor two explaining, to the user, what they would see differently because of this change.\n\n## 4. General Guidelines\n\n- Prioritize the purpose of changes over listing tools or properties used.\n- Keep concise; avoid obvious or verbose details.\n- Always generate a message based on the diff, even with limited context.\n\n## 5. Scopes\n\nOptional scopes (e.g., `feat(api):`):\n\n- `match`: frontend or backend changes tied\n- `site`: content, additional pages, etc for the static site content\n- `internal-admin`: internal admin changes (including CMS)\n```\n\nWith this setup, commits automatically get `User-facing:` trailers. You can then extract and summarize them:\n\n```bash\n# Extract only user-facing changes from the last sprint\ngit-history-extraction --since \"last monday\" --trailers \"User-facing\" | \\\n  gemini -i \"Create a user-friendly changelog from these changes\"\n```\n\n### Using with Gemini CLI\n\nExtract user-facing changes and generate a non-technical summary:\n```bash\ngit-history-extraction --repo . --since \"last monday\" \\\n  --trailers \"User-Facing\" | \\\n  gemini -i \"This is a compressed git history identifying user-facing changes. \\\nCan you write a 1-2 sentence overview of the changes, with a list of bullets \\\nidentifying changes. This is for a non-technical internal audience, letting \\\nthem know what the development team has done. Separate into 'new' and 'fixed' \\\nsections. Include a 'Updates Since' with the date of the first commit in the \\\nhistory. Remove fluff, keep it concise and information dense.\"\n```\n\n### Using the OpenAI Playground Script (Optional)\n\nAn optional playground script is included that demonstrates OpenAI integration:\n\n```bash\n# Generate summary with OpenAI\ngit-history-extraction --since \"1 week ago\" --format json | \\\n  uv run playground/summarize_commits.py\n\n# Preview the prompt without calling OpenAI\ngit-history-extraction --since \"1 week ago\" --format json | \\\n  uv run playground/summarize_commits.py --dump-prompt\n```\n\n**Requirements:**\n- `OPENAI_API_KEY` environment variable\n- The script uses GPT-4o-mini by default\n\nThis is just an example—you can pipe to any AI tool you prefer. See [playground/README.md](playground/README.md) for more details.\n\n## Output Format\n\n### Simple Format\n\nEach commit is displayed with:\n- **Commit:** SHA hash\n- **Date:** ISO 8601 timestamp\n- **Files:** Comma-separated list of changed files\n- **Message:** Commit body with trailers removed\n\n### JSON Format\n\nArray of commit objects:\n```json\n[\n  {\n    \"sha\": \"abc123...\",\n    \"date\": \"2024-10-31T08:00:00-06:00\",\n    \"body\": \"commit message with trailers\",\n    \"files\": [\"file1.py\", \"file2.md\"]\n  }\n]\n```\n\n### TOON Format\n\n[TOON (Token-Oriented Object Notation)](https://github.com/toon-format/toon) is a compact, human-readable format designed for LLM contexts. It achieves 30-60% fewer tokens than equivalent JSON while maintaining readability:\n\n```\nsha: abc123...\ndate: \"2024-10-31T08:00:00-06:00\"\nbody: \"commit message with trailers\"\nfiles[2]: file1.py,file2.md\n```\n\nTOON format is particularly useful when piping git history to AI tools, as it reduces token usage and associated costs.\n\n## Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--since TEXT` | ISO date/time or relative time | `\"24 hours ago\"` |\n| `--since-commit TEXT` | Start from specific commit (overrides `--since`) | None |\n| `--since-last-tag` | Extract commits since the Nth most recent tag (Tag[N]..Tag[N-1]). 0 = LatestTag..HEAD | False |\n| `--repo DIRECTORY` | Path to git repository | `.` (current directory) |\n| `--trailers TEXT` | Comma-separated trailer keys to extract | None (show all) |\n| `--format [simple\\|json\\|toon]` | Output format | `simple` |\n\n## How It Works\n\n- Uses `git log` with custom formatting for efficient single-pass extraction\n- Parses commit metadata, body, and file changes in one command\n- Intelligently extracts git trailers from commit messages\n- No per-commit subprocess calls for optimal performance\n\n## Development\n\n```bash\npytest\n```\n\n## Limitations\n\n- Large commit ranges may generate significant output; consider narrowing the time range\n- This tool extracts and formats data only—AI summarization requires external tools\n- Git must be available in PATH\n\n## Requirements\n\n- Python \u003e= 3.9\n- git\n- [uv](https://docs.astral.sh/uv/) (recommended) or pip\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filoveitaly%2Fgit-history-extraction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filoveitaly%2Fgit-history-extraction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filoveitaly%2Fgit-history-extraction/lists"}