I made `git push` refuse to work until I touch grass
Описание и применение
Инструмент заставляет разработчиков делать короткую прогулку на свежем воздухе, прежде чем отправлять изменения в репозиторий, используя локальную модель Gemma 4 для проверки фотографий.
Задача
Developers lose track of time and neglect breaks while coding, leading to burnout and reduced productivity.
Результат
The tool achieved 18/18 correct classifications on a 18‑photo benchmark, blocking fakes and encouraging short outdoor breaks before code pushes.
Рабочий процесс
- 1. Run
touchgrass installto add a pre‑push hook. - 2. After the configured time indoors,
git pushis blocked and shows a QR code. - 3. Run
touchgrass proveto start a local or tunneled web page that opens the rear camera. - 4. Capture a photo of an outdoor scene within 15 minutes of capture time.
- 5. The photo is sent to Gemma 4 via Ollama for analysis.
- 6. The script evaluates the model’s JSON output for outdoors, sky_or_plants, and no screen.
- 7. If all checks pass, the hook resets the timer and allows the push; otherwise the push remains blocked.
Доказательства
I made git push refuse to work until I touch grass
After 3 hours indoors (you can change that), this happens. Here's a real one from testing, with the limit set to 1 minute:
The first run got 16 out of 18. Every real photo was right. Both fakes sailed through as "Grass confirmed"
Second run: 18 out of 18, about 26 seconds a photo on a 4 core CPU with no GPU.
The photo goes to Gemma through Ollama, on localhost.
- Дата записи: 2026-10-10T15:10:53.702Z