git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Alex Riesen <raa.lkml@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <junkio@cox.net>,
	Tom Prince <tom.prince@ualberta.net>
Subject: Re: SEGV in git-merge recursive:
Date: Fri, 30 Mar 2007 17:35:51 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703301728510.6730@woody.linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.63.0703302239050.4045@wbgn013.biozentrum.uni-wuerzburg.de>



On Fri, 30 Mar 2007, Johannes Schindelin wrote:
> 
> IMHO, there is actually no way merge_trees() can fix the conflicts enough 
> to write a tree.
> 
> So, the only way I see to avoid that SEGV is to something like this:

I disagree.

It's much better to give a bad intermediate tree than to give up entirely.

If you give up entirely, the merge is basically impossible to complete.

If you give a bad intermediate, the merge will just have potentially 
more-than-necessary conflicts in the end.

> +			die ("cannot continue merging.");

This really isn't acceptable. We're not monotone or one of those projects 
that thinks that merging is hard. Merging is *easy*.

We're looking for a base version for a merge - think of a three-way merge 
on a file level. And the easiest base version is actually an empty base 
file (or, when it comes to a rename conflict, no base names at all).

Sure, that will make all changes conflict, but that's a *hell* of a lot 
better than giving up. It just means that now the user has to figure out 
what the end result should be - exactly the same way that if you have an 
empty file as a base version, a three-way merge will basically generate a 
conflict marker that looks like

	<<<<
	one version of the file
	====
	the other version of the file
	>>>>

Rule #1 when merging should *always* be: "never leave the user high and 
dry". You don't give up and say "I can't merge this". You say "I couldn't 
merge this, but here's the mess I left for you to show me how it's done!"

		Linus

  reply	other threads:[~2007-03-31  0:36 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29  7:50 SEGV in git-merge recursive: Tom Prince
2007-03-29  8:18 ` Alex Riesen
2007-03-29  8:32   ` Tom Prince
2007-03-29 11:29 ` Alex Riesen
2007-03-29 12:58   ` Tom Prince
2007-03-29 13:34     ` Alex Riesen
2007-03-29 14:12       ` Tom Prince
2007-03-29 14:44         ` Alex Riesen
2007-03-29 14:45           ` Alex Riesen
2007-03-29 15:04             ` Tom Prince
2007-03-29 15:04           ` Alex Riesen
2007-03-29 18:32             ` Alex Riesen
2007-03-29 18:55               ` Alex Riesen
2007-03-29 23:01                 ` [PATCH] An attempt to resolve a rename/rename conflict in recursive merge Alex Riesen
2007-03-29 23:13                   ` Alex Riesen
2007-03-29 19:34               ` SEGV in git-merge recursive: Linus Torvalds
2007-03-29 19:40                 ` Linus Torvalds
2007-03-29 20:44                   ` Alex Riesen
2007-03-30 21:00                   ` Johannes Schindelin
2007-03-31  0:35                     ` Linus Torvalds [this message]
2007-03-31  1:03                       ` Linus Torvalds
2007-03-31 10:49                         ` Alex Riesen
2007-03-31 11:49                           ` [PATCH] Keep rename/rename conflicts of intermediate merges while doing recursive merge Alex Riesen
2007-03-31 12:06                             ` Jakub Narebski
2007-03-31 12:50                             ` Johannes Schindelin
2007-03-31 12:53                               ` Johannes Schindelin
2007-03-31 16:07                             ` Linus Torvalds
2007-03-31 17:34                               ` Alex Riesen
2007-03-31 20:03                             ` Junio C Hamano
2007-03-31 11:22                       ` SEGV in git-merge recursive: Johannes Schindelin
2007-03-29 19:55               ` Tom Prince

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=Pine.LNX.4.64.0703301728510.6730@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=raa.lkml@gmail.com \
    --cc=tom.prince@ualberta.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).