diff --git a/git-figure.pdf b/git-figure.pdf index 9b6dd7a..5ef93df 100644 Binary files a/git-figure.pdf and b/git-figure.pdf differ diff --git a/git-figure.svg b/git-figure.svg index 9f6d59b..4524014 100644 --- a/git-figure.svg +++ b/git-figure.svg @@ -5,81 +5,84 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -89,10 +92,6 @@ - - - - @@ -102,13 +101,13 @@ - - - - + + + + - + @@ -118,10 +117,6 @@ - - - - @@ -131,13 +126,13 @@ - - - - + + + + - + @@ -147,10 +142,6 @@ - - - - @@ -160,13 +151,13 @@ - - - - + + + + - + @@ -176,10 +167,6 @@ - - - - @@ -189,13 +176,13 @@ - - - - + + + + - + @@ -215,16 +202,16 @@ - - - - - - - + + + + + + + - + @@ -242,11 +229,11 @@ - - + + - + @@ -271,11 +258,11 @@ - - + + - + @@ -293,11 +280,11 @@ - - + + - + @@ -315,11 +302,11 @@ - - + + - + @@ -337,11 +324,11 @@ - - + + - + @@ -386,11 +373,11 @@ - - + + - + @@ -408,11 +395,11 @@ - - + + - + @@ -430,11 +417,11 @@ - - + + - + @@ -452,11 +439,11 @@ - - + + - + @@ -474,11 +461,11 @@ - - + + - + @@ -496,11 +483,11 @@ - - + + - + @@ -518,11 +505,11 @@ - - + + - + @@ -540,11 +527,11 @@ - - + + - + @@ -560,11 +547,11 @@ - - + + - + @@ -581,11 +568,32 @@ - - + + - + + + + + + + + + + + + + + + + + + + + + + @@ -602,11 +610,11 @@ - - + + - + @@ -623,10 +631,10 @@ - + - + @@ -646,124 +654,117 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + @@ -771,11 +772,11 @@ - - + + - + @@ -820,7 +821,7 @@ - + @@ -831,11 +832,12 @@ - - - - - + + + + + + @@ -843,11 +845,11 @@ - - + + - + @@ -890,15 +892,15 @@ - - + + - + - + @@ -911,61 +913,61 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + @@ -973,11 +975,11 @@ - - + + - + @@ -989,45 +991,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -1080,12 +1086,12 @@ - - - - - - + + + + + + @@ -1095,16 +1101,14 @@ - - - - - - - - - - + + + + + + + + @@ -1126,15 +1130,12 @@ - - - - - - - - - + + + + + + @@ -1146,14 +1147,14 @@ - + - + - + @@ -1184,7 +1185,7 @@ - + @@ -1204,11 +1205,11 @@ - - + + - + @@ -1221,18 +1222,12 @@ - - - - - - - - - - - - + + + + + + @@ -1240,33 +1235,34 @@ - - + + - + - - + + - - - + + + - - - - - - - - - - + + + + + + + + + + + @@ -1274,11 +1270,11 @@ - - + + - + @@ -1302,11 +1298,11 @@ - - + + - + @@ -1330,11 +1326,11 @@ - - + + - + @@ -1347,18 +1343,12 @@ - - - - - - - - - - - - + + + + + + @@ -1366,11 +1356,11 @@ - - + + - + @@ -1383,15 +1373,11 @@ - - - - - - - - - + + + + + @@ -1399,11 +1385,11 @@ - - + + - + @@ -1416,20 +1402,9 @@ - - - - - - - - - - - - - - + + + @@ -1437,13 +1412,13 @@ - - - - + + + + - + @@ -1456,8 +1431,6 @@ - - @@ -1482,15 +1455,6 @@ - - - - - - - - - @@ -1629,8 +1593,8 @@ - - + + @@ -1638,6 +1602,9 @@ + + + @@ -1668,89 +1635,119 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1806,11 +1803,14 @@ - - + + - - + + + + + @@ -1824,9 +1824,6 @@ - - - @@ -1836,6 +1833,9 @@ + + + @@ -1851,33 +1851,39 @@ + + + - - + + + + + - - + + - - + + - - - - - + + + + + @@ -1902,27 +1908,24 @@ - - - - - - - - - - - + + + + + + + + @@ -1935,8 +1938,8 @@ - - + + diff --git a/git-figure.typ b/git-figure.typ index 0083433..7de2fe0 100644 --- a/git-figure.typ +++ b/git-figure.typ @@ -14,7 +14,7 @@ #let commit-object(coord, hash, name, ..args) = node( coord, align(left, [#text(size: 8pt, gray.darken(50%), raw(hash))\ #name]), corner-radius: 7pt, fill: commit-color.lighten(50%), stroke: none, ..args) -#let tree-object(coord, hash, ..args) = commit-object(coord, hash, [tree], +#let tree-object(coord, hash, content, ..args) = commit-object(coord, hash, content, width: 2cm, fill: blue.lighten(50%), ..args) #let file-object(coord, hash, name, ..args) = commit-object(coord, hash, name, width: 2cm, fill: gray.lighten(50%), ..args) @@ -91,47 +91,49 @@ commit-node((rel: (0, -1), to: ), E2h, name: ) commit-node((rel: (0, -1), to: ), E3h, fill: none, stroke: thindashed, name: ) // branches - node((rel: (-1, 0), to: ), [main], shape: hexagon, stroke: branch-color, name:
) + node((rel: (-1, 0), to: ), [main], shape: chevron, stroke: branch-color, name:
) edge(
, , "->", stroke: thin) - node((rel: (-2, 0), to: ), [hotfix], shape: hexagon, stroke: branch-color, name: ) + node((rel: (-2, 0), to: ), [hotfix], shape: chevron, stroke: branch-color, name: ) edge(, , "->", stroke: thin) // tags - node((rel: (-1, 0), to: ), [v-1.0], shape: chevron, stroke: tag-color, name: ) - edge(, , "->", stroke: thin) - node((rel: (-1, 0), to: ), [v-1.1], shape: chevron, stroke: tag-color, name: ) - edge(, , "->", stroke: thin) + node((rel: (-1, 0), to: ), [v-2.0], shape: chevron, stroke: tag-color, name: ) + edge(, , "->", stroke: thin) + node((rel: (-1, 0), to: ), [v-1.0], shape: chevron, stroke: tag-color, name: ) + edge(, , "->", stroke: thin) + node((rel: (0.5, 0), to: ), [v-1.1], shape:chevron.with(dir: left), stroke: tag-color, name: ) + edge(, , "->", stroke: thin) // enclose the tree node((rel: (0, -1), to: ), [*Version history*\ - #align(left, text(size: 8pt)[ + #align(left, text(size: 10pt)[ _Directed Acyclic Graph (DAG)_ describes version history. - Commits are nodes in DAG, while an edge connect a commit with its parent. + Commits are nodes in DAG. Commits are connected with parents. ])], stroke:none, width: 5cm, name: ) node(snap: false, enclose: (, , ), stroke: thindashed, width: 3cm, fill: gray.lighten(70%)) // branch cloud - node((rel: (-0.5, -1), to: ), [#text(branch-color.darken(20%), smallcaps[*Branches*])\ references that move along when commiting canges], + node((rel: (-0.5, -1), to: ), [#text(branch-color.darken(20%), smallcaps[*Branches*])\ references that move along when commiting changes], stroke: thin, corner-radius: 10pt, inset: 5pt, width: 4cm, name: ) edge(, , corner: left, stroke: thindotted) edge(,
, corner: left, stroke: thindotted) // tag cloud - node((rel: (-0.5, 1.5), to: ), [#text(tag-color, smallcaps[*Tags*])\ references that don't move], + node((rel: (-0.5, 1.5), to: ), [#text(tag-color, smallcaps[*Tags*])\ references that don't move], stroke: thin, corner-radius: 10pt, inset: 5pt, width: 4cm, name: ) - edge(, , corner: right, stroke: thindotted) - edge(, , corner: left, stroke: thindotted) + edge(, , corner: right, stroke: thindotted) + edge(, , corner: left, stroke: thindotted) // staging area - node((rel: (1, 0), to: ), [#smallcaps[*Staging area*]\ #text(size: 8pt)[filesystem snapshot that will be commited in - the next commit]], stroke: thindashed, corner-radius: 10pt, width: 3cm, name: ) + node((rel: (1, 0), to: ), [#smallcaps[*Staging area*]\ #text(size: 10pt)[filesystem snapshot that will be commited in + the next commit]], stroke: thindashed, corner-radius: 10pt, width: 4.5cm, name: ) edge(, , stroke: thindotted) // commit node((rel: (1, 0.5), to: ), [ - #text(commit-color, smallcaps[*Commit*])\ snapshot of filesystem tree in object store\ + #text(commit-color, smallcaps[*Commit*])\ file tree snapshot with metadata in object store\ #table(columns: 1, fill: commit-color.lighten(50%), align: left, [commit hash: #raw(E1h)], raw(block: true, " tree 65c47fee parent 16f299 -author MV ) @@ -161,7 +163,7 @@ Change foo".replace("16f299", E2h).replace("65c47fee", tree1h) edge(, , "->") edge(, , "->") // merged branch - edge(, , "->", layer: 1, label: [parent of], label-angle: auto) + edge(, , "->", layer: 1, label: [parent], label-angle: auto) edge(, , "->") edge(, , "->") // unmerged branch @@ -169,21 +171,21 @@ Change foo".replace("16f299", E2h).replace("65c47fee", tree1h) edge(, , "->") edge(, , "->", stroke: (dash: "dashed")) // object store - let obj_store = (rel: (-0.5, 1), to: ) - node((rel: (4cm, -2.2cm), to: ), align(left)[Content addressable object store \ #raw(".git/objects")], stroke: none, snap: false ) - commit-object((rel: (1.5, 2), to: ), E1h, [second commit], name: ) - commit-object((rel: (1.5, 3), to: ), "16f29a", [first commit], width: 2.8cm, name: ) - tree-object((rel:(-1, 0), to: ), tree1h, name:) + let bla_h = "d1bc32" + node((rel: (4cm, -2.5cm), to: ), align(center)[Content addressable object store \ #raw(".git/objects")], stroke: none, snap: false ) + commit-object((rel: (1.5, 2), to: ), E1h, [Add bla], name: ) + commit-object((rel: (1.5, 3), to: ), Eh, [Merge commit], name: ) + tree-object((rel:(-1, 0), to: ), tree1h, [tree], name:) edge(, , stroke: thin, "->") - tree-object((rel:(-1, 0), to: ), "e05dcd", name: ) + tree-object((rel:(-1, 0), to: ), "e05dcd",[tree], name: ) edge(, , stroke: thin, "->") - file-object((rel:(-1, -1), to: ), "cb48cd", [`new content`], name: ) - file-object((rel:(-1, 0), to: ), "077231", [`unchanged`], name: ) - file-object((rel:(-1, 1), to: ), "d1bc32", [`first content`], name: ) - edge(, , [`bar.txt`], "->", label-angle: auto, stroke: thin) - edge(, , [`foo.txt`], "->", label-angle: auto, stroke: thin) - edge(, , [`bar.txt`], "->", label-angle: auto, stroke: thin) - edge(, , [`foo.txt`], "->", label-angle: auto, stroke: thin) + file-object((rel:(-1, -0.5), to: ), "cb48cd", [`bla bla`], name: ) + file-object((rel:(-1, 0.5), to: ), "077231", [`lorem`], name: ) + file-object((rel:(-1, 1.5), to: ), bla_h, [`bla`], name: ) + edge(, , [`bar`], "->", label-angle: auto, stroke: thin) + edge(, , [`foo`], "->", label-angle: auto, stroke: thin) + edge(, , [`bar`], "->", label-angle: auto, stroke: thin) + edge(, , [`foo`], "->", label-angle: auto, stroke: thin) node((rel: (0, 0.5), to:), enclose: (, , ), stroke: thindashed, corner-radius: 5pt, fill: gray.lighten(70%), snap: false, layer: -2) // time direction