DEV Community

Cover image for octoscope 0.32.0 — the Overview tab: profile, social and activity counters, languages bar, top repositories and network
Giovambattista Fazioli
Giovambattista Fazioli

Posted on Originally published at zyvop.com

octoscope 0.32.0 — the Overview tab: profile, social and activity counters, languages bar, top repositories and network

There is a question the Repos tab could not answer until now. Not "how much did I commit to this one?" — the drill-in has told you that for a while — but "which of my repositories do I actually commit to most?", which is a question about the ordering of the whole list, not about any one row.

A Commits column for the Repos tab — your commits per repository over the last year, sortable — and the measurement that decided why it is opt-in.


octoscope 0.32.0 answers it with a Commits column: how many commits you authored on each repository's default branch in the last 365 days, with its own sort in the s cycle and in default_sort. Turn it on from the settings panel (,) — the tab refetches at once — or with commit_counts = true in your config.

It is off by default, and I want to tell you why, because the reason is a number rather than a preference.

The column that had to be measured first

GitHub counts each repository's history on request. When I asked for that count inline, on the query that already feeds the Repos tab, the query went from about six and a half seconds to somewhere between eight and eleven on my 91-repository account — and GitHub cuts any request it cannot process in ten seconds. Five runs: three of them died at the gateway. The first one, for what it is worth, passed at 9.8 seconds. A single green run of a query that close to the clock proves nothing, and I nearly shipped on it.

So the column runs as a query of its own, in parallel with the six the dashboard already makes, paging at fifty repositories rather than a hundred. On that same account it takes four to six seconds — a cost every refresh pays, which is exactly why it is yours to switch on and not mine to impose.

It is also best-effort by construction. If it ever times out, you lose the column for one refresh, the header falls back to the previous sort and says so, and the dashboard is untouched. A timeout on GitHub's side is not free either — they dock your rate limit for the following hour — which is one more reason the branch prefers small requests to one that flirts with the cut-off.

A zero, when the column is on, is a real zero. The tab distinguishes "you made no commits here" from "the count did not arrive", and never shows you the second dressed as the first. On someone else's public profile the column stays hidden: there is no viewer to attribute commits to, and a column of zeros would be a lie.

The toggle does what the file could not

Flipping Commit counts in the panel sets the flag and refetches immediately, in either direction. If a refresh is already running when you save, the change is remembered and one more fetch follows the moment it lands — so what you see is a result taken after your change, never one that happened to read the old setting on its way out.

For scripts

octoscope --json carries commits_last_year on each repository when the column is on: an explicit 0 where you made no commits, and the key absent entirely when the count was not fetched — so a script can tell the two apart. Watched repositories never carry it; the branch counts only what you own.

brew upgrade gfazioli/tap/octoscope
Enter fullscreen mode Exit fullscreen mode

octoscope on the web: https://gfazioli.github.io/octoscope

This newsletter: https://octoscope.substack.com

On Mastodon: https://hachyderm.io/@undolog


Originally published on ZyVOP

💡 For more articles like this, subscribe to the ZyVOP newsletter!

Top comments (0)