From 883050622af6e64f7a035aba410a2983c639a393 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 24 Apr 2012 01:41:07 +0100 Subject: [PATCH] strategy: wip --- article.tex | 3 +++ strategy.tex | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 strategy.tex diff --git a/article.tex b/article.tex index 9cdd0d2..740a2bc 100644 --- a/article.tex +++ b/article.tex @@ -86,9 +86,11 @@ \newcommand{\patch}{{\mathcal P}} \newcommand{\base}{{\mathcal B}} +\newcommand{\depsreq}{{\mathcal D}} \newcommand{\patchof}[1]{\patch ( #1 ) } \newcommand{\baseof}[1]{\base ( #1 ) } +\newcommand{\depsreqof}[1]{\depsreq ( #1 ) } \newcommand{\eqntag}[2]{ #2 \tag*{\mbox{#1}} } \newcommand{\eqn}[2]{ #2 \tag*{\mbox{\bf #1}} } @@ -134,5 +136,6 @@ \input{create-tip.tex} \input{anticommit.tex} \input{merge.tex} +\input{strategy.tex} \end{document} diff --git a/strategy.tex b/strategy.tex new file mode 100644 index 0000000..ca31c32 --- /dev/null +++ b/strategy.tex @@ -0,0 +1,72 @@ +\section{Strategy} + +We start with some commits $S_0 \ldots S_n$ +(where $S_0 = L$ and is the current git ref for $\pl$). + +%Let $\set E_{\pc} = \bigcup_i \pendsof{S_i}{\pc}$. + +Invoke Plan $\patchof \pl$ where the algorithm Plan $\pc$ is as +follows: + +Notation: + + $\pc \succ_1 \{ \p, \pq \ldots \}$ + the Topbloke commit set $py$ has as direct contributors exactly + $\p, \pq, \ldots$. This is an acyclic relation. + + Extend this into the partial order $\succ$. + +$\py \succ \pq$ + +We intend to merge all $\set E_{\pc} = \{ E_{\pc,j \ldots} \}$ +and all the direct contributors of $\pc$ (as determined below) +into the existing git ref for $\pc$, to make $T_{\pc}$. +The direct contributors of $\pcn$ are the topbloke commit sets +corresponding to the tip branches for the direct dependencies of +$\pc$. +The sole direct contributor of $\pcy$ is $\pcn$. + + +For $\pc = \pcn$, choose an (arbitrary, but ideally somehow optimal in +a way not discussed here) ordering of $\set E_{\pc}$, $E_j$ (for +$j = 1 \ldots m$). Remove from that set (and ordering) any $E_j$ which +are $\le$ and $\neq$ some other $E_k$. + +Notation: write $\depsreqof{K}$ to mean the direct dependencies +(in the form $\py$) requested in the commit $K$. + +Initially let $T_{\pc,0}$ be the git ref for $\pcn$. And let +$\set D_0 = \depsreqof{T_{\pc,0}}$. +For each $E_j$ starting with $j=1$ choose a corresponding intended +merge base $M_j$ such that $M_j \le E_j \land M_j \le T_{\pc,j-1}$. +Calculate $D_j$ as the 3-way merge of the sets $D_{j-1}$ and +$\depsreqof{E_j}$ using as a base $\depsreqof{M_j}$. This will +generate $D_m$ as the putative direct contributors for $\pcn$. + +However, the invocation may specify that certain direct dependencies +are definitely to be included, or excluded. As a result the set +of actual direct contributors is some arbitrary set of patches. + + + + + + +Imagine that we will merge the direct + +with $M=M_j, L=T_{\pc,j-1}, R=E_j$, +and calculate what the resulting desired direct dependencies file +(ie, the set of patches $\set D_j$) +would be. Eventually we + +So, formally, we select somehow an order of sources $S_i$. For each + + +Make use of the following recursive algorithm, Plan + + + + + recursively make a plan to merge all $E = \pends$ + +Specifically, in -- 2.30.2