005 4 MIN READ
Nobody Wrapped Up
This morning I ran one command across every repo I own and learned something I didn’t want to know.
Three repos had uncommitted work from sessions that had just ended. Bug records written and never committed. A verification feature running on my dev server that existed only in a working tree. And the worst one: the entire source of a deployed app, forty-eight files, living nowhere but my workstation. The dev server was running images built from code that git had never seen. One bad disk and the deployed version would have been unrecoverable.
Some context on how I got here. Everything I build lives under one directory: a homelab repo for infrastructure, a repo per app, two website repos, and a meta repo that holds nothing but shared rules and workflows. Sixteen repos today. On a normal day, I have three or four sessions open against different ones, because a planner feature, a watch-party pilot, and a backup job don’t wait for each other. Some of those sessions are just me in a terminal; for the longer ones, I work with a coding assistant, which is what makes that many parallel threads possible for one person. It’s also exactly how work gets orphaned: each session knows its own repo and nothing about the others.
I have a wrap-up checklist. It’s written down. It says commit per feature, write the diary entry, push when asked. Every one of those sessions had the checklist in front of it. But rules don’t run when the session dies, and sessions die for all kinds of reasons: a closed terminal, a context window that filled up, a day that ended.
So I spent today replacing rules with mechanisms.
The first was a twenty-line script that walks every repo and prints one line per repo with uncommitted files, a branch ahead of origin, or a branch with no upstream. Silent when everything is clean. That silence is the whole point: it can gate things.
# one line per repo that is not clean and pushed; nothing when all are
for repo in ~/git/*/ ~/git/*/*/; do
[ -d "$repo/.git" ] || continue
dirty=$(git -C "$repo" status --porcelain | wc -l)
ahead=$(git -C "$repo" rev-list --count @{upstream}..HEAD 2>/dev/null || echo no-upstream)
[ "$dirty" != 0 ] || [ "$ahead" != 0 ] && echo "$repo: $dirty uncommitted, ahead $ahead"
done
Then I wired it to the two moments a checklist can’t reach. My tooling runs hooks at the start and end of a session, so now every session begins with that list and one instruction: read the repo’s diary and the diff before touching anything. If the diary doesn’t explain the leftover work, write down what the diff tells you before doing anything else. The end of every session shows me a one-line notice if anything is still dirty. Not a block, a nudge. I’m the one who decides when a day is done.
The cost is nothing on a clean tree and one short list on a dirty one.
Sixteen repos only stay manageable because they all work the same way, and today I made that stricter. Every project repo has the same three branches: a feature branch per change, a release branch that the dev server runs, and main, which is production. The meta repo and my playground experiments stay on a single branch. A feature lands on release as one squashed commit, so rolling it back is one revert. Production moves only by pull request. On the public repos, main is protected, so nothing, including me, can push to it directly. The private ones follow the same path by rule, and the morning script flags any commit on main that never went through release.
Every repo has a diary whose newest entry is the resume point, alongside identical tracker folders for bugs, issues, and features. Two sessions touching the same repo stage only their own paths; nobody runs git add -A, because the other session’s half-done work is sitting right there. Conventions that are identical everywhere cost nothing to remember and let one script, one checklist, and one workflow cover all sixteen.
One more thing I learned from the leftovers themselves: the recoverable ones all had a diary entry written before the work started—what was about to happen and why. The scary one had only the diff. A diff tells you what changed. It never tells you what was verified, what was skipped, or why.
Write the entry first. It’s the cheapest insurance there is.
The repos are clean tonight. The hooks get their first real test tomorrow morning, when I open a session and see whether the start-of-day list is empty. If it isn’t, that’s the post working.