Thread (14 messages) flat view 14 messages, 6 authors, 2016-06-15

Re: merging .gitignore

From: Pierre Habouzit <hidden>
Date: 2016-06-15 22:43:38

On mar, oct 02, 2007 at 08:13:18 +0000, Pierre Habouzit wrote:
  Ancestor: (aa*, aaa, bbb)
  Left child: (aa*, bbb)   <-- remove aaa because aa* covers it
  Right child: (aaa, aabcd, bbb, cc*) <-- remove aa* and be explicit

  The proper result is probably: (aaa, aabcd, bbb, cc*) but is in fact a
case of conflict, because the "left" child could have used the fact that
aa* was present and hide say a aaXXX that the right child did not had,
and the merge would be wrong.
  Okay this example blows, I believe this one is better:

       (a*)
      /    \
  (ab*)    (ac*)
      \    /
       ????

  gitignore are subsets of the set of words.  if S is the ancestor set,
S1 and S2 the left and right sets. let Δ1 and Δ2 be S1 \ S and S2 \ S
respectively.  I think there is a conflict if
  Δ1 n Δ2 != 0 and (Δ1 is not a subset of Δ2) and (Δ2 is not a subset of Δ1)

  If the condition holds, then I believe that the "merged" .gitignore
would be: (S1 u S2) \ (Δ1 u Δ2)

  Though, don't take my word for it, I've only sketched this on a small
piece of paper, and have no rigorous proof.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help