Git Newsletter
Repository: Private. Demo available on request.
Overview
I work across a lot of repositories, most of them private, and I could not answer âwhat did I do last weekâ without opening a dozen commit logs. Git Newsletter answers it. It mirrors every repository I own, stores the commit history and GitHub activity in a local SQLite database, and writes a short story for each week from a fact sheet built out of that data.
It also feeds this site. The âActive Nov 2026â lines on project pages, the âRecently Activeâ list on the homepage, the generated âCurrent Focusâ list on Under the Hood all start in this tool, and the Log page is where its approved weekly stories go. The database never leaves the machine it runs on. What leaves is one small JSON file of months and day counts for repositories on an explicit public list, and stories I have read and approved.
The hard part was not collecting commits. It was making sure a tool that can see my private work never says anything about it in public.
Engineering Details
1. Facts First, Then a Story
The weekly, monthly, year and bio commands read only what sync already stored. Each builds a deterministic fact sheet, then sends that sheet and nothing else to the Claude Messages API for a short third-person story. The output file keeps the story on top and âThe facts behind this storyâ underneath, so every sentence can be checked against its source. --facts-only skips the model. Stories are cached by prompt version, model, kind and fact sheet, so re-running a finished week costs no model calls.
2. Public Output Fails Closed
--public writes a story meant for this site. Anything the tool cannot confirm is safe is not written.
- Before the model: only repositories on the public list reach the fact sheet. Other repositories do not appear at all, not even as a count. Other peopleâs and botsâ names are removed.
- After the model: a pattern check looks for URLs, file paths, IP addresses, ports, backtick code, ticket-style IDs, hex strings and
snake_casenames. A draft with problems is rewritten once with the problems named. A second failure writes nothing and caches nothing. - Private names: every repository in the database that is not on the public list counts as private. The story is matched against those names as whole tokens, without regard to case, with hyphens, underscores and spaces treated as interchangeable. One hit refuses the story.
The pattern check is strict on purpose: a false alarm costs one retry, a miss publishes internals. I calibrated it on 2026-09-28 against 10 private stories. It caught the internal task codes, file names and code formatting in them; the one false positive was âUTF-8â, which is now a known term.
The same day showed its limit. On the first public run (22 repository bios), nothing tripped the patterns, but reading them by hand turned up details I did not want published. A regex cannot judge meaning. So nothing public leaves the machine until I read the story and run publish-story for that week, which repeats the checks before it commits anything.
3. What the Site Receives
export-activity writes one file: for each repository on the public list, its short name, the month of my last commit, and the number of distinct local days with a commit in a 90-day window. No commit subjects, hashes, counts or paths. Commits by bots and other people do not count. The default end date is yesterday, so a day still in progress is never counted. The same database and date give the same bytes, and the file is written to a temporary name and renamed.
publish-activity pushes that file to a data branch of the site repository and triggers the deploy. The site validates the file on load and refuses any schema version but the one it knows. The 90-day window is a placeholder with no evidence behind it yet; the docs say so.
4. Making Sync Fast Enough to Schedule
The first full sync of 101 repositories (9,425 reachable commits) took 26.5 minutes on 2026-10-01. Stage checkpoints showed where the time went: history re-read every commit on every run with three Git processes each, and the poller slept 60 seconds between pages of one GitHub endpoint.
Three changes followed: read only commits the database does not hold, skip a repository whose ref listing hashes the same as last time, and run the normalizer once per sync instead of once per repository. Two syncs measured on 2026-10-02 took about 9 minutes 32 seconds each. The first scheduled Monday run, on 2026-10-05, took 2 minutes for sync plus export.
5. The Monday Run
A wrapper script chains four stages: sync, activity export, the private weekly story, and the public weekly story. If sync fails, everything stops. A later stage failing is logged and the rest still run. The script refuses to start if it cannot write its log, because an unattended run with no log cannot be checked afterwards. It ends by listing any public story waiting for my approval.
Features
- Collection: bare mirrors keyed by repository ID, commit and ref history, GitHub activity polling with checkpoints at repository, batch and API-page level, so a failed run resumes
- Reports: daily and weekly digests in Markdown and HTML; weekly, monthly and year-in-review stories; per-repository bios
- Publishing:
export-activity,publish-activityandpublish-story, each with a dry run - Operations:
doctor(read-only configuration check), validated backup and restore, mirror recovery, privacy deletion with a preview step, 30-day retention for raw private payloads
Testing
575 test functions across the tests folder, counted by grep for def test_ on 2026-11-21 at commit f9cd255 (not a run). The wrapper scripts are tested by running them, not by reading their text. One quality command runs Ruff format and lint, Pyright in strict mode, pytest, a check that every source module is reachable from an entry point, and a check that no test doubles live in production code. There is no hosted CI; the gate runs locally.
About 10,300 non-blank lines of source and 14,500 of tests at the same commit.
Limits
- Only pushed commits count. If the machine that runs it is off, the site keeps its last facts.
- The pattern and name checks cannot judge meaning. The manual read is part of the design, not a formality.
- Commit subjects from private repositories are sent to the model for private stories. That is a deliberate trade and is written down in the operations doc.
- It is built for one ownerâs repositories. I have not run it for anyone else.
Tech Stack
- Language: Python 3.12
- Storage: SQLite through SQLAlchemy 2.0, migrations with Alembic
- Configuration: pydantic-settings
- Narration: Claude Messages API
- Quality: pytest, Ruff, Pyright (strict)
- Scheduling: a weekly scheduled task running a PowerShell wrapper