Skip to content

Commit 352dbbf

Browse files
committed
Replace the diagrams in about/distributed with Graphviz versions
This commit recreates those diagrams that have been provided as `.png` files before. Of course, this is not strictly necessary because the previous `.png` diagrams served their purpose well enough. But I wanted to show off that we can now use Graphviz diagrams on git-scm.com. Note: When developing this patch, I had considered inlining the SVGs as `<svg>` instead of `<img>`. That would have had the following advantages: - The text in those diagrams would have been copy/paste-able. - We could have defined explicit colors for dark mode, as the `<style>` element would have been able to refer to the HTML document's `:root` element's dark mode definitions. However, having SVGs embedded in `<img>` elements have a few benefits: - Current browsers allow to `Open Image in New Tab` (where the text would be copy/paste-able again). - Current browsers allow to `Save Image` (even if there is no way to specify a filename, see whatwg/html#2722). - By using `<img>` elements, we can reuse the previous work on images in dark mode. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4f58ebc commit 352dbbf

File tree

1 file changed

+82
-3
lines changed

1 file changed

+82
-3
lines changed

content/about/distributed.html

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,101 @@ <h4>Subversion-Style Workflow</h4>
2727
A centralized workflow is very common, especially from people transitioning from a centralized system. Git will not allow you to push if someone has pushed since the last time you fetched, so a centralized model where all developers push to the same server works just fine.
2828
</p>
2929
<p class="center">
30-
<img src="{{< relurl "images/about/[email protected]" >}}" width="415" height="209" alt="Workflow A">
30+
{{< graphviz alt="workflow A" >}}
31+
digraph dev_workflow {
32+
layout=neato;
33+
overlap=false;
34+
sep="+10";
35+
node [shape=box, style="filled,rounded", penwidth=0, fontname="Helvetica"];
36+
edge [penwidth=3, color="gray", arrowsize=0.5, dir=both];
37+
38+
shared_repo [label="shared repository", fillcolor=teal, fontcolor=white, pos="2,1.5!"];
39+
40+
developer1 [label="developer", fillcolor=lightblue, pos="0,0!"];
41+
developer2 [label="developer", fillcolor=lightblue, pos="2,0!"];
42+
developer3 [label="developer", fillcolor=lightblue, pos="4,0!"];
43+
44+
developer1 -> shared_repo;
45+
developer2 -> shared_repo;
46+
developer3 -> shared_repo;
47+
}
48+
{{< /graphviz >}}
3149
</p>
3250
<h4>Integration Manager Workflow</h4>
3351
<p>
3452
Another common Git workflow involves an integration manager — a single person who commits to the 'blessed' repository. A number of developers then clone from that repository, push to their own independent repositories, and ask the integrator to pull in their changes. This is the type of development model often seen with open source or GitHub repositories.
3553
</p>
3654
<p class="center">
37-
<img src="{{< relurl "images/about/[email protected]" >}}" width="407" height="164" alt="Workflow B">
55+
{{< graphviz alt="workflow B" >}}
56+
digraph workflow {
57+
layout=neato;
58+
overlap=false;
59+
node [shape=box, style="filled,rounded", penwidth=0, fontname="Helvetica"];
60+
edge [penwidth=3, color="gray", arrowsize=0.5];
61+
62+
// Nodes
63+
blessed_repo [label="blessed\nrepository", fillcolor=teal, fontcolor=white, margin="0.3", pos="0,3!"];
64+
integration_manager [label="integration\nmanager", fillcolor=orange, fontcolor=white, pos="0,1!"];
65+
66+
dev_pub1 [label="developer\npublic", fillcolor="#CCAA00", fontcolor=black, pos="2,3!"];
67+
dev_pub2 [label="developer\npublic", fillcolor="#CCAA00", fontcolor=black, pos="4,3!"];
68+
69+
dev_priv1 [label="developer\nprivate", fillcolor="#CCAA00", fontcolor=black, pos="2,1!"];
70+
dev_priv2 [label="developer\nprivate", fillcolor="#CCAA00", fontcolor=black, pos="4,1!"];
71+
72+
// Edges with labels
73+
dev_priv1 -> dev_pub1;
74+
dev_priv2 -> dev_pub2;
75+
integration_manager -> blessed_repo;
76+
77+
dev_pub1 -> integration_manager [color="lightgray"];
78+
dev_pub2 -> integration_manager [color="lightgray"];
79+
blessed_repo -> dev_priv1 [color="lightgray"];
80+
blessed_repo -> dev_priv2 [color="lightgray"];
81+
}
82+
{{< /graphviz >}}
3883
</p>
3984
<h4>Dictator and Lieutenants Workflow</h4>
4085
<p>
4186
For more massive projects, a development workflow like that of the Linux kernel is often effective.
4287
In this model, some people ('lieutenants') are in charge of a specific subsystem of the project and they merge in all changes related to that subsystem. Another integrator (the 'dictator') can pull changes from only his/her lieutenants and then push to the 'blessed' repository that everyone then clones from again.
4388
</p>
4489
<p class="center">
45-
<img src="{{< relurl "images/about/[email protected]" >}}" width="562" height="303" alt="Workflow C">
90+
{{< graphviz alt="workflow C" >}}
91+
digraph workflow {
92+
layout=neato;
93+
overlap=false;
94+
node [shape=box, style="filled,rounded", penwidth=0, fontname="Helvetica"];
95+
edge [penwidth=3, color="gray", arrowsize=0.5];
96+
97+
// Nodes
98+
blessed_repo [label="blessed\nrepository", fillcolor=teal, fontcolor=white, margin="0.3", pos="6,4!"];
99+
dictator [label="dictator", fillcolor=red, fontcolor=white, pos="0,4!"];
100+
101+
lieutenant1 [label="lieutenant", fillcolor="#CCAA00", fontcolor=white, pos="0,2.5!"];
102+
lieutenant2 [label="lieutenant", fillcolor="#CCAA00", fontcolor=white, pos="2,3!"];
103+
104+
developer1 [label="developer", fillcolor=lightblue, fontcolor=black, pos="0,1!"];
105+
developer2 [label="developer", fillcolor=lightblue, fontcolor=black, pos="2,1!"];
106+
developer3 [label="developer", fillcolor=lightblue, fontcolor=black, pos="4,1!"];
107+
developer4 [label="developer", fillcolor=lightblue, fontcolor=black, pos="6,1!"];
108+
109+
// Edges
110+
dictator -> blessed_repo;
111+
lieutenant1 -> dictator;
112+
lieutenant2 -> dictator;
113+
114+
developer1 -> lieutenant1;
115+
developer2 -> lieutenant1;
116+
developer3 -> lieutenant2;
117+
developer4 -> lieutenant2;
118+
119+
blessed_repo -> developer1;
120+
blessed_repo -> developer2;
121+
blessed_repo -> developer3;
122+
blessed_repo -> developer4;
123+
}
124+
{{< /graphviz >}}
46125
</p>
47126
<div class="bottom-nav" style="display: block;">
48127
<a href="{{< relurl "about/small-and-fast" >}}" class="previous" data-section-id="small-and-fast">← Small and Fast</a>

0 commit comments

Comments
 (0)