chiark / gitweb /
pseudomerge: Bases' Children
[topbloke-formulae.git] / pseudomerge.tex
1 \section{Pseudo-merge}
2
3 Given $L$ and some other commits $\set R$, generate a
4 `fake merge': i.e., a commit which is a descendant of $L$ and $\set R$
5 but whose contents are exactly those of $L$.
6
7 \gathbegin
8  C \hasparents \{ L \} \cup \set R
9 \gathnext
10  \patchof{C} = \patchof{L}
11 \gathnext
12  D \isin C \equiv D \isin L \lor D = C
13 \end{gather}
14
15 \subsection{Conditions}
16
17 \[ \eqn{ Base Only }{
18  L \in \pn
19 }\]
20
21 \[ \eqn{ Ingredients }{
22  \bigforall_{R \in \set R}
23     R \in \pn
24      \lor
25     R \in \foreign
26      \lor
27     R \in \pqy
28 }\]
29
30 \[ \eqn{ Unique Tips }{
31  C \haspatch \p \implies
32   \bigexists_T
33     \pendsof{C}{\py} = \{ T \}
34 }\]
35
36 \[ \eqn{ Foreign Unaffected }{
37  \pendsof{C}{\foreign} = \pendsof{L}{\foreign}
38 }\]
39
40 \subsection{Lemma: Foreign Identical}
41
42 $\isforeign{D} \implies \big[ D \le C \equiv D \le L \big]$.
43
44 \proof{
45 Trivial by Foreign Unaffected and the definition of $\pends$
46 }
47
48 It might seem that bare git commits might also be psuedo-merges ---
49 e.g., merges made directly with {\tt git merge -s ours}.  However, by
50 our definition of $\has$, these are considered simply as normal merges
51 (\autoref{commit-merge}).
52
53 \subsection{No Replay}
54
55 Ingredients Prevent Replay applies:
56 $A = L$ always satisfies the $\exists$.  $\qed$
57
58 \subsection{Unique Base}
59
60 Not applicable, by Base Only.
61
62 \subsection{Tip Contents}
63
64 Not applicable, by Base Only.
65
66 \subsection{Base Acyclic}
67
68 Relevant only if $L \in \pn$.  For $D = C$, $D \in \pn$; OK.
69 For $D \neq C$, OK by Base Acyclic for $L$. $\qed$
70
71 \subsection{Coherence and Patch Inclusion}
72
73 $$
74 \begin{cases}
75   L \haspatch    \p : & C \haspatch    \p \\
76   L \nothaspatch \p : & C \nothaspatch \p
77 \end{cases}
78 $$
79
80 \proof{
81 Consider some $D \in \py$.  $D \neq C$ by Base Only.
82 So $C \has \p \equiv L \has \p$.
83 }
84
85 \subsection{Unique Tips}
86
87 Explicitly dealt with by our Unique Tips condition.
88
89 \subsection{Foreign Inclusion}
90
91 True by Foreign Identical, and Foreign Inclusion of $L$.
92
93 \subsection{Foreign Contents}
94
95 Not applicable.
96
97 \subsection{Bases' Children}
98
99 We need to consider this for $D=L$ and also for $D=R$ ($R \in \set
100 R$).
101
102 For $D=L$: $L \in \pn$ so $\pd = \p$.  And $C \in \pn = \pdn$.  Bases'
103 Children applies and is satisfied.
104
105 For $D = R \in \set R, R \in \pn$: $D \in \pn, \pd = \p, C \in \pn$ as
106 for $D = L$.
107
108 For $D = R \in \set R, R \in \foreign$, or $R \in \pqy$: $D \not\in
109 \pdn$ so Bases' Children does not apply.
110
111 Other possibilities for $D \in \set R$ are excluded by Ingredients.