1 Anatomy of a repository
2 =======================
4 :Author: Edward Z. Yang <ezyang@mit.edu>
6 Wizard is all about using Git's excellent directed acyclic graph model of
7 history to perform file-system merges as well as keep track of user
8 changes on top of ours. If you are not familiar with the way Git internally
9 represents commits, I highly recommend reading
10 `Git for Computer Scientists <http://eagain.net/articles/git-for-computer-scientists/>`_
13 Wizard takes a simplified view of upstream: from the point of view of the
14 pristine branch pointer, history should be a straight-forward progression of
15 versions. Internal development history is discarded, and there is a one-to-one
16 mapping of releases and commits.
18 .. digraph:: pristine_dag
21 subgraph cluster_pristine {
30 From here, we build "scriptsified" versions of the application, which
31 correspond to the master branch. Every time upstream releases an update,
32 we import it into our pristine branch, and then merge the changes into
35 .. digraph:: master_dag
38 subgraph cluster_master {
40 as [label="1.0-scripts"]
41 bs [label="1.1-scripts"]
42 cs [label="2.0-scripts"]
46 subgraph cluster_pristine {
58 If there was an error in a deployed scripts version, you might see a structure
61 .. digraph:: scripts2_dag
64 subgraph cluster_master {
66 as [label="1.0-scripts"]
67 bs [label="1.1-scripts",style=dashed]
68 bs2 [label="1.1-scripts2"]
69 cs [label="2.0-scripts"]
73 subgraph cluster_pristine {
85 But such occasions should be rare. In this particular graph, ``1.1-scripts`` was
86 defective, and ``1.1-scripts2`` was the fixed version.
88 There is another layer to this graph, which is not visible from the repository:
89 it contains the user's commits and is unique for each user.
91 .. digraph:: master_dag
94 subgraph cluster_user {
97 u [style=filled,fillcolor=red,fontcolor=white,color=red]
101 subgraph cluster_master {
103 as [label="1.0-scripts"]
104 bs [label="1.1-scripts"]
107 subgraph cluster_pristine {
119 The red node ``u`` represents uncommitted changes that may exist
120 in a user's checkout at any given time. The untagged commits
121 ``x``, ``y`` and ``z`` each have a particular story: ``z`` was
122 the commit generated when the install took place and the user's
123 specific configuration was versioned. ``y`` was the pre-upgrade
124 commit generated so that we could then perform a merge; ``x`` is
125 the resulting merge commit.
127 All user repositories are initialized with ``--shared``, which means
128 they take no space footprint at the very beginning. However, this also
129 makes it vitally important that the canonical repository in the scripts
130 locker not lose revisions.