Status: exploratory research, not a decision. Nothing in progit/progit3 is changed. This
gist exists so the findings and prototype renders are reviewable outside a chat transcript.
Repo state referenced below: progit/progit3@c9850b7
Caveat: Source Code Pro isn't installed on the machine that produced these renders, so every image below — including the "original" renders — fell back to a substitute font. Treat all shape/layout/color comparisons as valid; don't judge letterforms.
We want images to be text-source-controlled instead of Sketch binaries, while keeping style control and the ability to generate the commit diagrams used everywhere in the book.
- 113 SVGs, all exported from
diagram-source/progit.sketch(Sketch 56.3). 112 have a paired 800px-wide PNG — that PNG is what the book actuallyimage::-references; the SVG is already unused by the build. - One font (Source Code Pro), six colors:
#efefe7commit box,#f44d27ref box,#8f8981line/arrow,#f0f0f0/graytext,#00909ateal (object-model figures). - Box sizes repeat hard: 89×33 (521 uses), 106×33 refs (119 uses), 86×33 (63 uses) — a de facto symbol library, not free-form art.
- Node positions are hand-nudged, not on a grid — confirmed by extracting every box's
translate()across all 113 files. So there's no mechanical SVG→source conversion; every diagram is a redraw, regardless of tool. - ~101 of 113 are commit-graph shaped (DAGs: commits, branches, merges, rebases). The other
12 are bespoke figures with custom block-arrow art:
areas,lifecycle,centralized,distributed,local,clean,smudge,reset-workflow,benevolent-dictator,integration-manager,centralized_workflow,symbols. - Nothing in
Rakefiletouchesimages/*.svg; the site build (site/scripts/build-book.mjs) just copiesimages/verbatim. Changing how diagrams are produced touches zero build wiring today.
103 of 113 diagram SVGs contain the literal string master.
book_master_to_main_inventory.md
already flags that renaming master→main in the book's running examples requires
regenerating the diagrams that show it. Today that's ~103 trips through Sketch. Text sources
turn that into sed + rebuild.
For the ~101 DAG-shaped diagrams. Rebuilt two real diagrams from this book against the actual palette/font/box-size constants above.
two-branches.svg — source: example-graphviz-two-branches.dot
Original (Sketch/SVG) vs. Graphviz render:
basic-merging-2.svg (two-lane merge topology — the hard case) — source:
example-graphviz-merge.dot
Original vs. Graphviz render:
Two gotchas hit and solved during prototyping:
rank=samefightsrankdir=LR. It pins nodes into columns, not rows, which rotated the first merge attempt into a vertical mess. Fix: usegroup=per lane instead ofrank=same.- Graphviz has no native
#include. Two working fixes confirmed: pipe throughcpp -P -traditional-cpp file.dot.in | dot -Tsvg, or theme entirely via-N/-E/-GCLI flags. Either gives one central style file, satisfying the "control style" requirement.
Why this is the pick: zero new concepts for book contributors, packaged everywhere
(brew/apt install graphviz), no license, and a DAG layout engine is the correct tool for
Git DAGs. The master→main rename becomes mechanical.
Source: example-d2-two-branches.d2
Nicer style-control primitive — real named classes (classes: { commit: {...} } ) instead of a
preprocessor hack. But: laid out right-to-left against the intended arrow direction on the first
try, 13.5 KB output vs. Graphviz's 3.4 KB for the same 5 nodes, and it's a newer single-vendor
dependency most contributors won't already have. Worth it only if the class system matters more
than ubiquity.
Source: example-generator-render.py +
example-generator-spec.json — ~60 lines, no layout engine,
explicit lane/column placement using the book's actual box-size and grid-pitch constants.
Closest visual match of the three since it hard-codes the book's exact geometry rather than delegating to a layout algorithm. 1.8 KB output. Cost: you own the renderer, and it doesn't help with the 12 bespoke figures either — those need real drawing primitives (block arrows, swimlanes), not DAG layout.
Example, areas.svg (custom block-arrow art, not a DAG):
And data-model-1.svg (this one is DAG-shaped and would port fine to Graphviz):
Graphviz for the ~101 DAGs; leave the 12 bespoke figures in Sketch. They're stable, rarely edited, and most don't say "master" — porting them by hand buys little and chasing 100% coverage is where a project like this stalls.
Open questions before anyone builds this for real:
- Font packaging. Source Code Pro needs to be vendored or pinned in CI, or renders vary by machine — a real reproducibility bug for a book (see caveat at top).
- Do rendered PNGs stay committed, or generate at build time? The book only ever
references
.png. Generating at build time is cleaner but addsgraphviz+ a rasterizer (e.g.rsvg-convert) to CI.
No repo changes were made. All files here are throwaway prototypes for evaluation only.















