chiark / gitweb /
comments from mdw - clarify that \p are disjoint by construction
[topbloke-formulae.git] / notation.tex
1 \section{Notation}
2
3 \begin{basedescript}{
4 \desclabelwidth{5em}
5 \desclabelstyle{\nextlinelabel}
6 }
7 \item[ $ C \hasparents \set X $ ]
8 The parents of commit $C$ are exactly the set
9 $\set X$.
10
11 \item[ $ C \ge D $ ]
12 $C$ is a descendant of $D$ in the git commit
13 graph.  This is a partial order, namely the transitive closure of
14 $ D \in \set X $ where $ C \hasparents \set X $.
15
16 \item[ $ C \has D $ ]
17 Informally, the tree at commit $C$ contains the change
18 made in commit $D$.  Does not take account of deliberate reversions by
19 the user or reversion, rebasing or rewinding in
20 non-Topbloke-controlled branches.  For merges and Topbloke-generated
21 anticommits or re-commits, the ``change made'' is only to be thought
22 of as any conflict resolution.  This is not a partial order because it
23 is not transitive.
24
25 \item[ $ \p, \py, \pn $ ]
26 A patch $\p$ consists of two sets of commits $\pn$ and $\py$, which
27 are respectively the base and tip git branches.  $\p$ may be used
28 where the context requires a set, in which case the statement
29 is to be taken as applying to both $\py$ and $\pn$.
30 All of these sets will be disjoint by construction
31 (see Invariants, below).  Hence:
32
33 \item[ $ \patchof{ C } $ ]
34 Either $\p$ s.t. $ C \in \p $, or $\bot$.
35 A function from commits to patches' sets $\p$.
36
37 \item[ $ \pancsof{C}{\set P} $ ]
38 $ \{ A \; | \; A \le C \land A \in \set P \} $
39 i.e. all the ancestors of $C$
40 which are in $\set P$.
41
42 \item[ $ \pendsof{C}{\set P} $ ]
43 $ \{ E \; | \; E \in \pancsof{C}{\set P}
44   \land \mathop{\not\exists}_{A \in \pancsof{C}{\set P}}
45   E \neq A \land E \le A \} $
46 i.e. all $\le$-maximal commits in $\pancsof{C}{\set P}$.
47
48 \item[ $ \baseof{C} $ ]
49 $ \pendsof{C}{\pn} = \{ \baseof{C} \} $ where $ C \in \py $.
50 A partial function from commits to commits.
51 See Unique Base, below.
52
53 \item[ $ C \nothaspatch \p $ ]
54 $\displaystyle \bigforall_{D \in \py} D \not\isin C $.
55 ~ Informally, $C$ has none of the contents of $\p$.
56
57 \item[ $ C \zhaspatch \p $ ]
58 $\displaystyle \bigforall_{D \in \py} D \isin C \equiv D \le C $.
59 ~ Informally, $C$ has all the reachable contents of $\p$.
60
61 \item[ $ C \haspatch \p $ ]
62 $\displaystyle C \zhaspatch \p \land \exists_{F \in \py} F \le C $.
63 ~ Informally, $C$ nontrivially has all the reachable contents of $\p$.
64
65 Note that $\zhaspatch$ and $\nothaspatch$ are neither
66 mutually exclusive nor exhaustive.
67 $\haspatch$ and $\nothaspatch$ are mutually exclusive but not
68 necessarily exhaustive.
69
70 Commits on Non-Topbloke branches are $\nothaspatch \p$ for all $\p$.  This
71 includes commits on plain git branches made by applying a Topbloke
72 patch.  If a Topbloke
73 patch is applied to a non-Topbloke branch and then bubbles back to
74 the relevant Topbloke branches, we hope that
75 if the user still cares about the Topbloke patch,
76 git's merge algorithm will DTRT when trying to re-apply the changes.
77
78 \item[ $\displaystyle \mergeof{C}{L}{M}{R} $ ]
79 The contents of a git merge result:
80
81 $\displaystyle D \isin C \equiv
82   \begin{cases}
83     (D \isin L \land D \isin R) \lor D = C : & \true \\
84     (D \not\isin L \land D \not\isin R) \land D \neq C : & \false \\
85     \text{otherwise} : & D \not\isin M
86   \end{cases}
87 $
88
89 \end{basedescript}