Skip to content
zit Tech-note 357a2468f1
Login

Tech-note 357a2468f1

A forge timeline wants "+15 −3" on every check-in card, and a file history wants the same per file. Until now zit crosslink said which paths a check-in touched but not how many lines changed, so a forge ran zit diff --numstat once per check-in: fifty child processes for a fifty-card page, paid again by every consumer for history it had already indexed.

0.3.40 puts the counts in the stream. Each file line is followed by a lines ADDED REMOVED line against the primary parent, - - for a binary file. The counts are the ones zit diff --numstat --checkin gives, because both now count with the same function. A file whose content the store cannot produce gets no lines line rather than a guess.

Counting reads both sides of every change, so it is kept where only crosslink pays for it. The counts live in a cache file of their own; the cache every other command builds on first open is untouched, and so is the time it takes. A check-in's counts are fixed by its name, so they are counted once and never go stale as the repository grows. The first run over a long history does the counting, keeps what it has counted if it is cut short, and later runs count only new check-ins.