git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: merging .gitignore

From
Pierre Habouzit <madcoder@debian.org>
Date
Oct 2, 2007, 21:02 UTC
Message-ID
<20071002210252.GB19710@artemis.corp>
In-Reply-To
<20071002204748.GA19710@artemis.corp>
On Tue, Oct 02, 2007 at 08:47:48PM +0000, Pierre Habouzit wrote:
Show 20 quoted lines
> 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 ...
Show 5 quoted lines
> 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@debian.org
OOO                                                http://www.madism.org
Previous: Pierre HabouzitNext: Andy Parkins
Message 15 of 20 in “merging .gitignore”
  1. martin f krafftOct 1, 2007
  2. Andy ParkinsOct 1, 2007
  3. Johannes SchindelinOct 1, 2007
  4. martin f krafftOct 2, 2007
  5. Junio C HamanoOct 2, 2007
  6. martin f krafftOct 2, 2007
  7. Pierre HabouzitOct 2, 2007
  8. Pierre HabouzitOct 2, 2007
  9. martin f krafftOct 2, 2007
  10. Pierre HabouzitOct 2, 2007
  11. martin f krafftOct 2, 2007
  12. Pierre HabouzitOct 2, 2007
  13. martin f krafftOct 3, 2007
  14. Pierre HabouzitOct 3, 2007
  15. Pierre HabouzitOct 2, 2007
  16. Andy ParkinsOct 3, 2007
  17. Johan HerlandOct 3, 2007
  18. Johannes SchindelinOct 3, 2007
  19. Johan HerlandOct 3, 2007
  20. Junio C HamanoOct 3, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.