git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Pelisse <apelisse@gmail.com>
To: git <git@vger.kernel.org>
Cc: Antoine Pelisse <apelisse@gmail.com>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] combine-diff: coalesce lost lines optimally
Date: Sun, 17 Mar 2013 14:58:59 +0100	[thread overview]
Message-ID: <CALWbr2xWYiFULLDVA7b9WrVtmfdAvZC9SKBHjZE9aRc6kfRMGA@mail.gmail.com> (raw)
In-Reply-To: <1363525436-21667-1-git-send-email-apelisse@gmail.com>

> I'm also having a hard time trying it with more than two parents. How I
> am supposed to have more than two parents while octopus merge refuses if
> there are conflicts ?

OK, creating the merge commit myself solves the issue:

git init
>test
git add test
git commit -m initial

seq 100 >test
git commit -m all -a

git checkout -b side1 HEAD^1
seq 1 2 100 >test
git commit -m side1 -a

git checkout -b side2 HEAD^1
seq 1 4 100 >test
git commit -m side2 -a

git checkout -b side3 HEAD^1
seq 1 8 100 >test
git commit -m side3 -a

git checkout -b side4 HEAD^1
seq 1 16 100 >test
git commit -m side4 -a

git checkout master
>test
git add test
TREE=$(git write-tree)
COMMIT=$(git commit-tree $TREE -p master -p side1 -p side2 -p side3 -p
side4 -m merge)
git show $COMMIT

This will work with the basic greedy implementation if all parents are
in this order. But the optimal result will be lost if we change the
order of -p parameters in git-commit-tree.
The patch seems to be correct, always finding the best result (we
always have 100 lines diff) whatever the order of parents.

  reply	other threads:[~2013-03-17 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 22:32 [RFD] Combine diff improvements Antoine Pelisse
2013-03-14 22:52 ` Junio C Hamano
2013-03-15  5:54 ` Junio C Hamano
2013-03-17 13:03   ` [PATCH] combine-diff: coalesce lost lines optimally Antoine Pelisse
2013-03-17 13:58     ` Antoine Pelisse [this message]
2013-03-17 20:10     ` Junio C Hamano
2013-03-17 20:37       ` Antoine Pelisse
2013-03-17 22:37     ` Junio C Hamano
2013-03-23 17:23       ` [PATCH v2] " Antoine Pelisse

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=CALWbr2xWYiFULLDVA7b9WrVtmfdAvZC9SKBHjZE9aRc6kfRMGA@mail.gmail.com \
    --to=apelisse@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).