From: Pierre Habouzit <madcoder@debian.org>
To: martin f krafft <madduck@madduck.net>,
git@vger.kernel.org, Andy Parkins <andyparkins@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: merging .gitignore
Date: Tue, 02 Oct 2007 23:02:52 +0200 [thread overview]
Message-ID: <20071002210252.GB19710@artemis.corp> (raw)
In-Reply-To: <20071002204748.GA19710@artemis.corp>
[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]
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@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-10-02 21:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 13:03 merging .gitignore martin f krafft
2007-10-01 13:48 ` Andy Parkins
2007-10-02 19:51 ` martin f krafft
2007-10-02 19:55 ` Junio C Hamano
2007-10-02 20:20 ` martin f krafft
2007-10-02 20:13 ` Pierre Habouzit
2007-10-02 20:47 ` Pierre Habouzit
2007-10-02 20:56 ` martin f krafft
2007-10-02 21:07 ` Pierre Habouzit
2007-10-02 21:49 ` martin f krafft
2007-10-02 22:07 ` Pierre Habouzit
2007-10-03 8:42 ` martin f krafft
2007-10-03 8:58 ` Pierre Habouzit
2007-10-02 21:02 ` Pierre Habouzit [this message]
2007-10-03 8:23 ` Andy Parkins
2007-10-03 9:28 ` Johan Herland
2007-10-03 12:41 ` Johannes Schindelin
2007-10-03 13:06 ` Johan Herland
2007-10-03 19:38 ` Junio C Hamano
2007-10-01 13:57 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071002210252.GB19710@artemis.corp \
--to=madcoder@debian.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=andyparkins@gmail.com \
--cc=git@vger.kernel.org \
--cc=madduck@madduck.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).