git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Jay Soffian <jaysoffian@gmail.com>,
	Joshua Jensen <jjensen@workspacewhiz.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Sharing a massive distributed merge
Date: Thu, 17 Mar 2011 15:15:17 -0400	[thread overview]
Message-ID: <20110317191517.GC20508@sigill.intra.peff.net> (raw)
In-Reply-To: <AANLkTi=Fnacc9JamGdOEYhHY8PJgaidSLmif_z5Qdfp0@mail.gmail.com>

On Thu, Mar 17, 2011 at 07:48:54PM +0100, Alex Riesen wrote:

> How about not to record the merge as a merge commit, but
> just resolve as much as possible, commit _only_ what was
> resolved, and revert everything else. Including files merged
> cleanly, as the last merge by maintainer will have to clean
> merge them anyway. And of course, commit as normal:

But that still has the same problem. You've reverted unresolved files
back to the pre-merge state, which is the tip of one of the merged
branches. How does the integrator differentiate that from the case that
your resolution happened to take one side of a file?

For example, try this:

    git init repo && cd repo

    echo base >file1
    echo base >file2
    git add .
    git commit -m base

    echo master >>file1
    echo master >>file2
    git commit -a -m master

    git checkout -b topic HEAD^
    echo topic >>file1
    echo topic >>file2
    git commit -a -m topic

    git merge master

    # now we have a conflict. Both files are identically conflicted.
    # Let's resolve one in favor of topic.
    cat >file1 <<'EOF'
    base
    topic
    EOF
    git add file1

    # Now let's mark the other as unresolved. The proposal is to revert
    # it back to the pre-merge state.
    git checkout HEAD -- file2

    # And commit the partial result.
    git commit -m 'partial result'

It should be easy to see that the two cases are indistinguishable: both
files contain the exact same content in the reuslting partial result
(and obviously the fact that they are identical is contrived, but the
point is that for any given file, you don't know which thing happened
during the partial merge).

Which is why I suggested deletion as an option, but that also conflicts
with a possible resolution (it's just a less likely one). I think every
tree state that you could commit to mark "this isn't resolved" is going
to overlap with some possible actual resolution state. So you need an
external list.

It would be neat if the tree could somehow mark a bit for "this is
unresolved". I guess we could shove it into a mode bit. But that seems
like a waste of a mode bit for this one use case that doesn't come up
all that often, and which doesn't _need_ to represent that information
in-tree. The commit-message solution would work perfectly fine.

-Peff

  reply	other threads:[~2011-03-17 19:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:12 Sharing a massive distributed merge Joshua Jensen
2011-03-17  5:21 ` Jay Soffian
2011-03-17  6:38   ` Jeff King
2011-03-17  7:04     ` Jay Soffian
2011-03-17  7:30       ` Jeff King
2011-03-18  5:49         ` Jeff King
2011-03-24  3:03           ` Joshua Jensen
2011-03-17  8:53     ` Alex Riesen
2011-03-17 14:10       ` Jay Soffian
2011-03-17 14:54         ` Alex Riesen
2011-03-17 17:58           ` Jay Soffian
2011-03-17 18:48             ` Alex Riesen
2011-03-17 19:15               ` Jeff King [this message]
2011-03-17 19:53                 ` Alex Riesen
2011-03-17 20:54                 ` Junio C Hamano
     [not found]   ` <10061287.5697.1300343903667.JavaMail.trustmail@mail1.terreactive.ch>
2011-03-17  7:51     ` Where do all the tips go? (Was: Re: Sharing a massive distributed merge) Victor Engmark
2011-03-17  8:01       ` Jeff King

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=20110317191517.GC20508@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=jjensen@workspacewhiz.com \
    --cc=raa.lkml@gmail.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).