git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: "SZEDER Gábor" <szeder@ira.uka.de>,
	git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>,
	Johannes.Schindelin@gmx.de
Subject: Re: [PATCH] builtin-commit: avoid using reduce_heads()
Date: Mon, 29 Sep 2008 20:44:24 +0200	[thread overview]
Message-ID: <200809292044.24799.jnareb@gmail.com> (raw)
In-Reply-To: <20080929181856.GX23137@genesis.frugalware.org>

Dnia poniedziałek 29. września 2008 20:18, Miklos Vajna napisał:
> On Mon, Sep 29, 2008 at 05:07:22PM +0200, Miklos Vajna <vmiklos@frugalware.org> wrote:

> > > Currently parents of merge commits are 'reduce(HEAD + MERGE_HEAD)'
> > > in symbolic equation; I propose they would be simply 'MERGE_HEAD'.
> > > then we set this branch to new commit
> > 
> > Yes. Currently - after a merge conflict - you are able to check what
> > heads caused were merged, which caused the conflict, but with this
> > approach you would not be able to. I think this would be a step back...
> 
> Uh, I should read my mail before sending it next time.
> 
> I just wanted to say that in case, for example, I merge A^ and A, but I
> get a conflict after octopus tried to merge A^ then it can be a useful
> info to see that A^ was a head. Putting reduce(HEAD + MERGE_HEAD) to
> MERGE_HEAD would hide this info, which would make the situation worse,
> IMHO.

I don't understand: I thought that merge strategy gets _reduced_ heads.
Moreover, if head reduction reduces number of heads to two, you would
use twohead merge (recursive) instead of octopus, and fast-forward if
there is only one head after reduction.

All that I proposed is to put those reduced heads into MERGE_HEAD.
I did not proposed to put yet unresolved heads in MERGE_HEAD in case
of octopus merge conflict. I think either you misunderstood me, or
I misunderstood you.

Take for example the following case of
[H@repo]$ git merge a b c

   .---.---.---.---H                   <-- H <-- HEAD
                    \
                     \.---.---.---a    <-- a
                           \
                            \-b        <-- b
                               \                              
                                \--c   <-- c

Currently after failed merge we have:
HEAD: 
  refs: refs/heads/H
MERGE_HEAD
  sha1(a)
  sha1(b)
  sha1(c)

I propose it to be
HEAD:
  refs: refs/heads/H
MERGE_HEAD
  sha1(a)
  sha1(c)

And merge strategy chosen would be twohead one (recursive).


If the situation was slightly different

   .---.---.---.---.--.---.---.---H    <-- H <-- HEAD
                    \
                     \.---.---.---a    <-- a
                           \
                            \-b        <-- b
                               \                              
                                \--c   <-- c


I propose it to be
HEAD:
  refs: refs/heads/H
MERGE_HEAD
  sha1(H)
  sha1(a)
  sha1(c)

And merge strategy chosen would be octopus.

-- 
Jakub Narebski
Poland

  reply	other threads:[~2008-09-29 18:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-25 23:50 [BUG] merge --no-ff --no-commit && commit SZEDER Gábor
2008-09-26  0:35 ` [PATCH] builtin-commit: avoid using reduce_heads() Miklos Vajna
2008-09-26  1:03   ` SZEDER Gábor
2008-09-26  6:24     ` Miklos Vajna
2008-09-26 15:15     ` Miklos Vajna
2008-09-26 15:20       ` [PATCH] builtin-commit: avoid always " Miklos Vajna
2008-09-26 15:52         ` Shawn O. Pearce
2008-09-26 19:37           ` Miklos Vajna
2008-10-03  2:35             ` Shawn O. Pearce
2008-10-03 12:04               ` Miklos Vajna
2008-10-03 14:59                 ` Shawn O. Pearce
2008-10-05 19:51                   ` Miklos Vajna
2008-10-06 14:19                     ` Shawn O. Pearce
2008-10-03 15:09                 ` [PATCH] builtin-commit: use reduce_heads() only when appropriate SZEDER Gábor
2008-10-05 19:43                   ` Miklos Vajna
2008-09-26 16:17       ` [PATCH] builtin-commit: avoid using reduce_heads() Jakub Narebski
2008-09-26 19:31         ` Miklos Vajna
2008-09-26 23:51           ` Jakub Narebski
2008-09-29 15:07             ` Miklos Vajna
2008-09-29 18:18               ` Miklos Vajna
2008-09-29 18:44                 ` Jakub Narebski [this message]
2008-09-27  0:16         ` SZEDER Gábor

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=200809292044.24799.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    --cc=szeder@ira.uka.de \
    --cc=vmiklos@frugalware.org \
    /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).