chiark / gitweb /
7ee7ffbbdc25e2c1140983173f4f0b8ddb5aca52
[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 foreign 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.  $\qed$
61
62 \subsection{Tip Contents}
63
64 Not applicable, by Base Only.  $\qed$
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 We need to consider $D \in \foreign$.
92
93 For $D = C$: $D \has C$, $D \le C$; OK.
94
95 For $D \neq C$: $D \has C \equiv D \has L$ by construction.
96 $D \has L \equiv D \le L$ by Foreign Inclusion of $L$.
97 $D \neq C$ so this $D \le L \equiv D \le C$.
98
99 $\qed$
100
101 \subsection{Foreign Ancestry}
102
103 Not applicable.
104
105 \subsection{Bases' Children}
106
107 We need to consider this for $D=L$ and also for $D=R$ ($R \in \set
108 R$).
109
110 For $D=L$: $L \in \pn$ so $\pd = \p$.  And $C \in \pn = \pdn$.  Bases'
111 Children applies and is satisfied.
112
113 For $D = R \in \set R, R \in \pn$: $D \in \pn, \pd = \p, C \in \pn$ as
114 for $D = L$.
115
116 For $D = R \in \set R, R \in \foreign$, or $R \in \pqy$: $D \not\in
117 \pdn$ so Bases' Children does not apply.
118
119 Other possibilities for $D \in \set R$ are excluded by Ingredients.
120
121 $\qed$