From d9b52c1143a121cce187f2a9df71bf8da82a2d7b Mon Sep 17 00:00:00 2001 From: Fengzdadi <453788063@qq.com> Date: Mon, 2 Nov 2026 22:55:14 -0500 Subject: [PATCH] Page: who built what The scanner now records who added each file, and the page can light up one builder's buildings. A building's builder is whoever added its file: it stays theirs when the file is moved, edited by others, or deleted and added back. - scan: the git log walk reads %aN with each commit (the name .mailmap gives, so one person's two emails are one builder; no emails are kept). The city gets `authors`, most buildings first, and each file and deleted file a `b` index into it. A file there before the commits read has none. - Hover says who built a building. - The builder button on the timeline (or B) lists the builders with how many buildings they put up, with a search box past eight. Picking one lights their buildings and recedes the rest, and puts ?by= in the address, which lights them again on load. Esc or a click on a building clears it. Hidden for a city with one builder, or one scanned before. - Pixel style: the rest recedes to 25% instead of 55% while a builder is lit (55% was hard to read for buildings scattered through the city), and theirs warm a little. A share card drawn meanwhile is unlit. - Snapshots record each file's builder by name; nothing else moved. test/history.mjs: moves, deletions, .mailmap, a history read in part. On DefinitelyTyped (28k files, 1,656 builders) it adds ~150 KB to a 6.4 MB city. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- src/scan.mjs | 26 +- test/history.mjs | 29 +- test/snapshot.mjs | 7 +- test/snapshots/SNKRX.json | 126 +-- test/snapshots/You-Dont-Know-JS.json | 214 ++-- test/snapshots/axum.json | 944 ++++++++-------- test/snapshots/flask.json | 502 ++++----- test/snapshots/gallery.json | 918 +++++++-------- test/snapshots/gson.json | 1490 ++++++++++++------------- test/snapshots/jq.json | 202 ++-- test/snapshots/ky.json | 246 ++-- test/snapshots/nanoGPT.json | 40 +- test/snapshots/terraform-aws-eks.json | 504 ++++----- test/snapshots/uuid.json | 68 +- web/architecture.js | 10 +- web/index.html | 28 +- web/main.js | 74 ++ 18 files changed, 2784 insertions(+), 2646 deletions(-) diff --git a/README.md b/README.md index d3d1829..b6b0435 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ Some repos also get a condition on top of their plan. A repo with no recent comm | Ruin | a file nobody has touched in over two years | | Flash on a roof | touched by the commit now playing | -Drag to pan and scroll to zoom. The biggest districts carry signposts with their folder's name, and more appear as you zoom in. Hover a building to see its file and light up its whole district, and click it to light up its imports. The timeline under the city shows how busy each stretch of history was: click or drag it to jump, Space plays or pauses, ← → step. The signpost button (or L) hides the names for a clean view, and Esc clears the selection. +Drag to pan and scroll to zoom. The biggest districts carry signposts with their folder's name, and more appear as you zoom in. Hover a building to see its file and light up its whole district, and click it to light up its imports. The timeline under the city shows how busy each stretch of history was: click or drag it to jump, Space plays or pauses, ← → step. The signpost button (or L) hides the names for a clean view. The builder button (or B) lists who built the city, each with the number of buildings they put up (a file's builder is whoever added it), and picking one lights up their buildings; the address then carries `?by=` with their name, so the link shows them too. Esc clears the selection. ## Share your city diff --git a/src/scan.mjs b/src/scan.mjs index 6129a3c..5e08065 100644 --- a/src/scan.mjs +++ b/src/scan.mjs @@ -345,14 +345,16 @@ export async function scanRepo(repo, { maxCommits = 20000, name } = {}) { // renameLimit: pinned to git's own default, so pairMoves knows when git gave up (and an older git, // or one configured otherwise, pairs the same files) const proc = spawn('git', ['-C', root, '-c', 'core.quotePath=false', '-c', `diff.renameLimit=${RENAME_LIMIT}`, 'log', `--max-count=${maxCommits}`, '--raw', '--no-abbrev', - '--format=@@%ct %H', '-M', '--reverse'], { stdio: ['ignore', 'pipe', 'ignore'] }); + '--format=@@%ct %H %aN', '-M', '--reverse'], { stdio: ['ignore', 'pipe', 'ignore'] }); const rl = readline.createInterface({ input: proc.stdout }); let cur = null, added = [], deleted = []; rl.on('line', line => { if (line.startsWith('@@')) { + // "@@