惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
H
Help Net Security
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
博客园 - 叶小钗
Y
Y Combinator Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
C
Check Point Blog
Recent Announcements
Recent Announcements
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
B
Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
htop for Your Git History
Wes · 2026-04-20 · via DEV Community

You clone a repo you've never seen before and you want to understand it. Not the code, not yet. The shape of the project. Who's been working on it? How often? Is it one person pushing daily or three people who show up once a month? Are there stale branches? When was the last release? What files change the most?

Git has answers to all of this, scattered across a dozen commands. git log --format with the right incantation gives you commit frequency. git shortlog -sn gives you contributor rankings. git branch -v shows branches but not staleness. git tag gives you release names but not cadence. None of it is visual. None of it is fast. And none of it lives in one place.

gittop puts it in one place.

What Is gittop?

gittop is a terminal UI for git repository statistics, built in Go by hjr265 (Mahmud Ridwan). You run gittop in a repo and it scans the commit history, then drops you into a seven-tab dashboard: Summary, Activity, Contributors, Branches, Files, Releases, and Commits. Each tab is a different lens on the same data. Switch tabs with number keys, zoom time ranges with +/-, filter by author or path or branch with a query language, and navigate everything with vim keys.

The whole thing is about 6,500 lines of Go, a month old, and sitting at 119 stars. The author wrote a blog post about building it with agentic coding tools, which makes the project an interesting artifact on two levels: it's a useful tool, and it's a case study in what agent-assisted development produces.

The Snapshot

Project gittop
Stars ~119 at time of writing
Maintainer Solo, merges PRs within hours
Code health Clean architecture, good deps, almost no tests
Docs Strong README with screenshots and keybind tables
Contributor UX Small codebase, flat layout, easy to navigate
Worth using Yes, if you work in terminals

Under the Hood

gittop is built on the charmbracelet stack: bubbletea for the TUI framework, bubbles for input widgets, lipgloss for styling. The Elm-style Model/Update/View architecture is clean and consistent across all seven tabs. Each tab implements a Page interface with Init, Update, and View methods, and the main model dispatches messages to the active page. If you've built anything with bubbletea before, the code will feel immediately familiar.

The other major dependency is go-git, which gives gittop pure-Go access to the git object store. No shelling out to git log, no parsing CLI output. The repository is opened once, commits are walked once at startup, and everything else (branches, tags, file health) loads lazily when you switch to the relevant tab. That lazy-loading design keeps startup fast even on large repos.

The surprise is the filter system. gittop ships a full query language built with participle, a parser-combinator library. You can type author:"alice" and path:*.go and branch:main into the filter bar and it compiles that into an AST, evaluates it against every commit, and recomputes all the statistics in real time. Boolean operators, parenthetical grouping, negation, glob patterns on file paths. For a one-month-old side project, that's a lot of parser.

The rendering is thoughtful too. Area charts use braille characters by default, packing two data points per terminal cell with sub-cell precision. The code maps values to braille dot patterns directly: left-column pins for odd indices, right-column for even, bottom to top. Each chart row gets a gradient color from the active theme. There's a block-character fallback for terminals that don't render braille well, and the horizontal bar charts in the Activity and Contributors tabs use fractional block characters for smooth sub-character precision. You can toggle rendering modes in the options menu. The whole thing respects your terminal's color profile (ANSI256 vs truecolor) and persists your preferences to ~/.config/gittop/config.toml.

The dependency story is clean. Six direct dependencies: the three charmbracelet packages, go-git plus go-billy for filesystem abstraction, and participle for the filter parser. That's it. No framework bloat, no utility grab-bags. The go.sum is mostly transitive deps from go-git's crypto and SSH support.

The rough edge is testing. Before our contribution, the project had two test files: filter_test.go (72 lines testing the parser) and mailmap_test.go (54 lines testing .mailmap resolution). That's it. The core data pipeline in stats.go, which handles commit aggregation, time bucketing, health data computation, and date range filtering, had zero coverage. For a project built with agentic tools, this tracks: agents are good at producing working code, less good at producing tested code.

The Contribution

The obvious gap was test coverage, so that's what we went after. stats.go is 548 lines of pure data functions: CommitsToDailyStats aggregates commits into daily counts and fills date gaps, AggregateStats buckets daily data into weekly/monthly/yearly periods, bucketKey handles the calendar math for each granularity, BuildHealthData combines file line counts with commit-derived churn and author data. All pure functions, all taking structs and returning structs, all testable without touching a git repository.

We wrote 22 test cases covering seven functions. The AggregateStats tests verify that weekly bucketing groups by Monday (with Sunday correctly mapping to the previous week), monthly by the first of the month, and yearly by January 1st. The BuildHealthData tests verify both filtered and unfiltered modes, checking that churn counts, author counts, and last-changed dates are computed correctly, and that empty inputs produce the right zero values. The CommitsToDailyStats tests verify gap-filling (days with no commits still appear with count zero) and edge cases like empty input.

One thing we caught during review: CommitsToDailyStats fills from the earliest commit to time.Now(), so the output length of any test grows by one entry per day. You can't pin the exact output without injecting a clock, and refactoring the function signature felt out of scope for a tests-only PR. We noted it in a comment on the PR. The proper fix would be a small production code change, which is the kind of thing a second PR could handle if the maintainer is interested.

Getting into the codebase was fast. The flat file layout means every source file is in the root directory. There's no cmd/ or internal/ to navigate. Open stats.go, read the types, read the functions, write tests. The existing test files established a clear convention: table-driven tests with the standard testing package, no external assertion libraries. We matched that style.

PR #6 is open. Based on the maintainer's track record (all four prior issues resolved same-day, external PRs merged within hours), we expect a quick turnaround.

The Verdict

gittop is for anyone who wants to understand a git repository's history without memorizing a dozen git log format strings. If you review a lot of repos, onboard to new codebases regularly, or just like seeing your own commit patterns visualized, this does the job in a single command.

The project is a month old and moving fast. Five releases in three weeks, responsive maintainer, external contributions already landing. The agentic origin is interesting but not a limitation: the code is clean, the architecture is sound, and the filter system shows real design ambition. What it needs now is the kind of test coverage that makes future contributors confident they aren't breaking things.

If gittop hits a Homebrew core formula and a few more people write about it, this is a 1,000-star project by the end of the year. It solves a real problem, it looks good doing it, and the maintainer clearly cares.

Go Look At This

Run go install github.com/hjr265/gittop@latest, point it at your biggest repo, and flip through the tabs. The Activity heatmap alone is worth the install.

Star the repo. If you want to contribute, the codebase is small enough to read in a sitting. Here's our test coverage PR if you want to see what getting into the code looks like.

This is Review Bomb, a series where I find under-the-radar projects on GitHub, read the code, contribute something, and write it up. If you know a project that deserves more eyeballs, drop it in the comments.


This post was originally published at wshoffner.dev/blog. If you liked it, the Review Bomb series lives there too.