chiark / gitweb /
split into multiple source files
[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 \haspatch \p $ ]
53 $\displaystyle \bigforall_{D \in \py} D \isin C \equiv D \le C $.
54 ~ Informally, $C$ has all the reachable contents of $\p$.
55
56 \item[ $ C \nothaspatch \p $ ]
57 $\displaystyle \bigforall_{D \in \py} D \not\isin C $.
58 ~ Informally, $C$ has none of the contents of $\p$.
59
60 Commits on Non-Topbloke branches are $\nothaspatch \p$ for all $\p$.  This
61 includes commits on plain git branches made by applying a Topbloke
62 patch.  If a Topbloke
63 patch is applied to a non-Topbloke branch and then bubbles back to
64 the relevant Topbloke branches, we hope that
65 if the user still cares about the Topbloke patch,
66 git's merge algorithm will DTRT when trying to re-apply the changes.
67
68 \item[ $\displaystyle \mergeof{C}{L}{M}{R} $ ]
69 The contents of a git merge result:
70
71 $\displaystyle D \isin C \equiv
72   \begin{cases}
73     (D \isin L \land D \isin R) \lor D = C : & \true \\
74     (D \not\isin L \land D \not\isin R) \land D \neq C : & \false \\
75     \text{otherwise} : & D \not\isin M
76   \end{cases}
77 $
78
79 \end{basedescript}