Re: merging .gitignore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 02, 2007 at 08:47:48PM +0000, Pierre Habouzit wrote:
> 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
   I meant S \ S1 and S \ S2 in fact here ...
> 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)

  after some more thoughts, as basically merging the complementary of
the sets I talk about here should yield the same "conflicts" (as it's
the dual problem), I suppose that the same restrictions should be
checked wrt the "added" deltas between S -> S1 (aka S1 \ S for real this
time) and S -> S2 (aka S2 \ S).

  so if Δ(0,n) is Sn \ S and Δ(n, 0) is S \ Sn, it would mean that if:

   { Δ(0,1) n Δ(0,2) == 0 || ∃ i ∋ (1,2), Δ(0,i) ⊆ Δ(0, 3 - i) }
&& { Δ(1,0) n Δ(2,0) == 0 || ∃ i ∋ (1,2), Δ(i,0) ⊆ Δ(3 - i, 0) }

  Then the correct merge (without conflicts) would be:

  (S u Δ(1,0) u Δ(2,0)) \ (Δ(0,1) u Δ(0,2)) aka S + what was added -
what was removed.

  in fact, I think that wrt the sets usual operations, there is a
conflict if the expression I just wrote does not commutes wrt the \ or
sth very similar.

  Anyway, I'm going pretty off topic here, so I'll shut up now :)

-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgpgPx4aBkNuN.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux