chiark / gitweb /
fix notation in calculation of ends
[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 are disjoint.  Hence:
31
32 \item[ $ \patchof{ C } $ ]
33 Either $\p$ s.t. $ C \in \p $, or $\bot$.
34 A function from commits to patches' sets $\p$.
35
36 \item[ $ \pancsof{C}{\set P} $ ]
37 $ \{ A \; | \; A \le C \land A \in \set P \} $
38 i.e. all the ancestors of $C$
39 which are in $\set P$.
40
41 \item[ $ \pendsof{C}{\set P} $ ]
42 $ \{ E \; | \; E \in \pancsof{C}{\set P}
43   \land \mathop{\not\exists}_{A \in \pancsof{C}{\set P}}
44   E \neq A \land E \le A \} $
45 i.e. all $\le$-maximal commits in $\pancsof{C}{\set P}$.
46
47 \item[ $ \baseof{C} $ ]
48 $ \pendsof{C}{\pn} = \{ \baseof{C} \} $ where $ C \in \py $.
49 A partial function from commits to commits.
50 See Unique Base, below.
51
52 \item[ $ C \nothaspatch \p $ ]
53 $\displaystyle \bigforall_{D \in \py} D \not\isin C $.
54 ~ Informally, $C$ has none of the contents of $\p$.
55
56 \item[ $ C \zhaspatch \p $ ]
57 $\displaystyle \bigforall_{D \in \py} D \isin C \equiv D \le C $.
58 ~ Informally, $C$ has all the reachable contents of $\p$.
59
60 \item[ $ C \haspatch \p $ ]
61 $\displaystyle C \zhaspatch \p \land \exists_{F \in \py} F \le C $.
62 ~ Informally, $C$ nontrivially has all the reachable contents of $\p$.
63
64 Note that $\zhaspatch$ and $\nothaspatch$ are neither
65 mutually exclusive nor exhaustive.
66 $\haspatch$ and $\nothaspatch$ are mutually exclusive but not
67 necessarily exhaustive.
68
69 Commits on Non-Topbloke branches are $\nothaspatch \p$ for all $\p$.  This
70 includes commits on plain git branches made by applying a Topbloke
71 patch.  If a Topbloke
72 patch is applied to a non-Topbloke branch and then bubbles back to
73 the relevant Topbloke branches, we hope that
74 if the user still cares about the Topbloke patch,
75 git's merge algorithm will DTRT when trying to re-apply the changes.
76
77 \item[ $\displaystyle \mergeof{C}{L}{M}{R} $ ]
78 The contents of a git merge result:
79
80 $\displaystyle D \isin C \equiv
81   \begin{cases}
82     (D \isin L \land D \isin R) \lor D = C : & \true \\
83     (D \not\isin L \land D \not\isin R) \land D \neq C : & \false \\
84     \text{otherwise} : & D \not\isin M
85   \end{cases}
86 $
87
88 \end{basedescript}