#set text(lang: "sl") #import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge #import fletcher.shapes: house, chevron, pill, hexagon #diagram(debug: 1, node-stroke: 2pt, edge-stroke: 1pt, { let store = (1, 7) let (A, B, C, D, E, F, G) = ((2, 6), (2, 5), (2, 4), (2, 3), (2, 2), (2, 1), (2, 0)) let (B1, B2) = ((3, 4.5), (3, 3.5)) let (E1, E2, E3) = ((3, 1.5), (3, 0.5), (3, -0.5)) let (Br1, Br2) = ((1, G.at(1)), (2.5, E2.at(1))) let (T1, T2) = ((1, E.at(1)), (1, B.at(1))) let refs = (3, 7) node(store, [Content addressable object store], width: 3cm) node(A, [A 16f299], shape: pill, name: ) node(B, [B 16f299], shape: pill) node(C, [C 16f299], shape: pill) node(D, [D 16f299], shape: pill) node(E, [E 16f299], shape: pill) node(F, [F 16f299], shape: pill) node(G, [16f299], shape: pill) // merged branch node(B1, [B1 16f299], shape: pill) node(B2, [B2 16f299], shape: pill) // unmerged branch node(E1, [E1 16f299], shape: pill) node(E2, [E2 16f299], shape: pill) node(E3, [E3 16f299], shape: pill, stroke: (dash: "dashed")) // branches node(Br1, [main], shape: hexagon, stroke: purple) node(Br2, [hotfix], shape: hexagon, stroke: purple) // tags node(T1, [v-1.0], shape: chevron, stroke: green) node(T2, [v-1.1], shape: chevron, stroke: green) // refs node(refs, stroke: none, snap: false, enclose: (refs, (refs.at(0)+2, refs.at(0)+2)), table(columns: 1, align: left, [*References* (`.git/refs`)], [*Tags* (`.git/refs/tags`)\ `tag-1`: `8dd6d4b...`], [*Branches* (`.git/refs/heads`) \ `main`: `8dd6d4b...`\ `feature-1`: `8dd6d4b...`\ `hotfix`: `8dd6d4b...`]) ) let branches = (2, -2) node(branches, [#text(stroke: purple.darken(50%))[BRANCH]\ reference that moves when commiting canges], stroke: 0.5pt, corner-radius: 10pt, inset: 0pt, width: 1cm, enclose: ((2, -2), (3, -2))) let tags = (0, 3.5) node(tags, [#text(stroke: green.darken(50%))[TAG]\ reference that don't move], stroke: 0.5pt, corner-radius: 10pt, inset: 0pt, width: 1cm, enclose: ((0, 3.5), (1, 4.5))) let commit = (3.5, 2.5) node(commit, [ *COMMIT*\ snapshot of filesystem tree in object store\ #rect[ ``` tree 65c47fee... parent 16f299... author MV ") edge(C, B, "->") edge(D, C, "->") edge(E, D, "->") edge(F, E, "->") edge(G, F, "->") // merged branch edge(B1, B, "->", layer: 1) edge(B2, B1, "->") edge(D, B2, "->") // unmerged branch edge(E1, E, "->") edge(E2, E1, "->") edge(E3, E2, "->", stroke: (dash: "dashed")) // refs edge(Br1, G) edge(Br2, E2) edge(T1, E) edge(T2, B) edge(Br1, branches, stroke: 0.5pt) edge(Br2, branches, stroke: 0.5pt) edge(T1, tags, stroke: 0.5pt) edge(T2, tags, stroke: 0.5pt) edge(commit, E, stroke: 0.5pt) } )