+When we are trying to do a merge of some kind, in general,
+we want to merge some source commits $S_0 \ldots S_n$.
+We'll write $S_0 = L$. We require that $L$ is the current git ref
+for $\patchof{L}$.
+
+\stdsection{Notation}
+
+\begin{basedescript}{
+\desclabelwidth{5em}
+\desclabelstyle{\nextlinelabel}
+}
+\item[ $\depsreqof{K}$ ]
+The set of direct dependencies (in the form $\py$)
+requested in the commit $K$ ($K \in \pn$) for the patch $\p$.
+
+\item[ $\pc \hasdirdep \p$ ]
+The Topbloke commit set $\pc$ has as a direct contributors the
+commit set $\p$. This is an acyclic relation.
+
+\item[ $\p \hasdep \pq$ ]
+The commit set $\p$ has as direct or indirect contributor the commit
+set $\pq$.
+Acyclic; the completion of $\hasdirdep$ into a
+partial order.
+
+\item[ $\set E_{\pc}$ ]
+$ \bigcup_i \pendsof{S_i}{\pc} $.
+All the ends of $\pc$ in the sources.
+
+\item[ $ \grefzc, \grefcc, \grefuc, \greffc $ ]
+The git ref for the Topbloke commit set $\pc$: respectively,
+the original, current, updated, and final values.
+
+\end{basedescript}
+
+\section{Planning phase}
+
+The planning phase computes:
+\begin{itemize*}
+\item{ The relation $\hasdirdep$ and hence the ordering $\hasdep$. }
+\item{ For each commit set $\pc$, the order in which to merge
+ $E_{\pc,j} \in \set E_{\pc}$. }
+\item{ For each $E_{\pc,j}$ an intended merge base $M_{\pc,j}$. }
+\end{itemize*}
+
+We use a recursive planning algorith, recursing over Topbloke commit
+sets (ie, sets $\py$ or $\pn$). We'll call the commit set we're
+processing at each step $\pc$.
+At each recursive step
+we make a plan to merge all $\set E_{\pc} = \{ E_{\pc,j \ldots} \}$
+and all the direct contributors of $\pc$ (as determined below)
+into $\grefzc$, to make $\greffc$.