-relations
- ancestry: of commits, a partial order
- C > D C is a descendant of D
- inclusion: commit includes change made in another
- a partial order, consistent with ancestry but more partial
- C has D <=> D isin C
- C has D => C > D
-
-define convenience function
- cont(C) := { Cx | Cx isin C }
-
-patches
- patch P is two sets Px of commits, Ptip and Pbase
- each subset has a single ur-ancestor C0_Ptip resp C0_Pbase
- all these subsets Ptip,Qbase,Rtip,Sbase mutually exclusive
- P(C) is either Ptip, Pbase, or nil (recorded in commit)
-
-commits fall into three categories wrt P
- inpatch(P,C) = included
- P included in C
- \forall D \elem Ptip, C has D <=> C > D
- inpatch(P,C) = absent
- P absent from C
- \forall D \elem Ptip, !(C has D)
- inpatch(P,C) = removed
- P removed from C
- cont(C) \intersection Ptip = { }
- but maybe \exists Cx \elem Ptip s.t. Cx < C
-
-the ends E(C,Px) of Px = Pbase or Ptip are
- every maximal Ce < C in Px
- ie every Ce for which
- C > Ce and !\exists C s.t. C > Ce
-
-existence of corresponding base B for every tip commit C
- \forall C s.t. P(C) = Ptip
- \exists B s.t. E(C,Pbase) = { B }
- resulting function B(C)
-
-contents of tip commits
- \forall C s.t. P(c) = Ptip
- cont(C) = cont(B(C)) \union { Cp s.t. P(Cp) = Ptip and Cp < C }
-
-non-circularity
- \forall B s.t. P(c) = Pbase
- cont(B) \notintersect Ptip
-
-normal commits
- make C from D
- result
- C < { D }
- P(C) = P(D)
- Cx isin C <=> Cx = D v Cx isin D
- inpatch(P,C) = inpatch(P,D)
-
-anticommit for removing a patch P from D to make C
- make C from D, A-
+GENERAL
+
+ C >= D C is descendant of D, partial order
+ C \haspatch D C contains changes from D, partial order
+ Patch P has two sets P+, P-
+ Ancestors A(C,P) = { Ca \elem C | Ca \elem P }
+ Ends E(C,P) = maximal elements of A(C,P)
+ Patch inclusion
+ C \haspatch P <=> [ \forall D \elem P+: D \isin C <=> D <= C ]
+ C \nothaspatch P <=> [ \forall D \elem P+: D \notisin C ]
+
+COMMIT ANNOTATIONS
+
+ Commit C is annotated with:
+
+ P(C)
+ Either P s.t. C \elem P
+ or _|_ meaning \notexists_{P} C \elem P.
+
+ { Pi | C \haspatch Pi }
+ ie the set of included patches
+
+ For every Px, E(C,Px+)
+ Implicitly for C \elem Pc+, E(C,Pc+) = { C }
+ and this is not annotated explicitly.
+ Also implicitly for P(C) = _|_, \forall_{Px} E(C,Px+) = { }
+ and this is also not annotated explicitly.
+
+ B(C)
+ For C \elem P+: B s.t. E(C,P-) = { B }
+ P(C) = P- or _|_: _|_
+
+ Of these in principle all except P(C) can be recalculated from the
+ commit history, but that would involve a complete history scan and in
+ the case of \haspatch is clearly impractical. At some point we may
+ provide a checker/sanitiser that recalculates E(C,Px+) and B(C) from
+ the commit history.
+
+SIMPLE COMMIT
+
+ make C >1 { A }
+ from A
+
+ with contents
+ D \isin C <=> D \isin A v D = C
+
+ results
+ P(C) = P(A)
+ A \haspatch P <=> C \haspatch P
+ For A \notelem Px+: E(C,Px+) = E(A,Px+)
+ A \elem Px+: E(C,Px+) = { C } -- not annotated
+
+ANTICOMMIT
+
+ make C >1 { L }
+ from L, R+, R-
+
+ with contents
+ D \isin C <=> D \notelement Pr+ ^ D \isin L
+