git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Gerrit Pape" <pape@smarden.org>,
	git@vger.kernel.org, "Rémi Vanicat" <vanicat@debian.org>
Subject: Re: [PATCH] merge-tree: sometimes, d/f conflict is not an issue
Date: Sun, 8 Jul 2007 14:16:38 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707081353560.4248@racer.site> (raw)
In-Reply-To: <7vwsxb4e2q.fsf@assigned-by-dhcp.cox.net>

Hi,

On Sat, 7 Jul 2007, Junio C Hamano wrote:

> Junio C Hamano <gitster@pobox.com> writes:
> 
> > The last time I looked at merge-recursive's D/F check, I found that it 
> > was not quite doing things right.  I may be able to dig up what I 
> > posted to the list...
> 
> It was from around April 7th-10th this year.

Unfortunately, this is way over my time budget.  As well as over my 
intelligence budget, since I did not even succeed in understanding the 
code in threeway_merge _at all_.

Besides, IMHO there is a deeper issue. Since merge-recursive started out 
as a Python script, and grew there until it was usable, and grew the 
rename detection therein, too, until it was finally converted to C, it 
accumulated a lot of features that would have been nice to have 
independently.

Almost the same goes for unpack-trees, which (its name to the contrary) 
does quite a few things to merge entries, too.  And it tries to detect d/f 
conflicts, too.

So there we are, with two really big and unwieldy chunks of code, each 
deserving an own GSoC project to clean them up.  Or maybe not even a GSoC 
project, but a longer project.

What I would _like_ to see is something as clean as merge-tree.  Which is 
clearly separated (code and file wise, too) into these stages:

- reading the trees

- determining renames

- determining true d/f conflicts

- threeway merge

- writing the tree object

- writing the work tree

- recursive

Ideally, merge-recursive would really have been as simple as

	case "$1" in
	--index_only)
		index_only=$1
		shift
	esac
	a="$1"
	b="$2"
	set $(git merge-base --all $a $b)
	temp=$1
	shift
	while case $# in 0) break;; esac
	do
		temp=$(git merge-recursive --index-only $temp $1)
		shift
	done
	git merge-non-recursive $index_only $temp -- "$a" "$b"

because _read-tree -m_ should have learnt about renames, _not_ 
merge-recursive.

As it is, both unpack_trees() and merge-recursive have a certain degree of 
not-quite duplicated yet wants-to-do-largely-the-same functionality.  
Which of course leads to much finger pointing: "it's unpack_trees() fault. 
no. it's merge-recursive's fault. no, vice versa."

Maybe the proper way out is really to start from merge-tree.c and do 
something which is easy to understand, and concise, and thus has a much 
lesser chance of being buggy.

Ciao,
Dscho

  reply	other threads:[~2007-07-08 13:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070405071615.2915.6837.reportbug@acer>
     [not found] ` <20070607074357.27760.qmail@69aef7b888effd.315fe32.mid.smarden.org>
     [not found]   ` <6b8a91420706070252y3fd581a3w427d91e5b982d29d@mail.gmail.com>
2007-06-13  9:16     ` unexpected git-cherry-pick conflict Gerrit Pape
2007-06-13 12:58       ` Johannes Schindelin
2007-06-13 13:43         ` Gerrit Pape
2007-06-13 14:43           ` Johannes Schindelin
2007-06-25  7:18             ` Gerrit Pape
2007-06-25  7:55               ` Johannes Schindelin
2007-07-07 20:58               ` Johannes Schindelin
2007-12-21 10:37                 ` Gerrit Pape
2007-12-22  8:20                   ` Junio C Hamano
2007-07-08  0:52               ` [PATCH] merge-tree: sometimes, d/f conflict is not an issue Johannes Schindelin
2007-07-08  1:31                 ` Junio C Hamano
2007-07-08  2:00                   ` Johannes Schindelin
2007-07-08  2:18                     ` Johannes Schindelin
2007-07-08  4:35                       ` Johannes Schindelin
2007-07-08  5:50                     ` Junio C Hamano
2007-07-08  6:14                       ` Junio C Hamano
2007-07-08 13:16                         ` Johannes Schindelin [this message]
2007-07-08 20:02                           ` Junio C Hamano
2007-07-09 15:06                             ` merge-one-file, was " Johannes Schindelin
2007-07-17 17:13                             ` [PATCH 1/2] merge-recursive: " Johannes Schindelin
2007-08-08 14:39                               ` Gerrit Pape
2007-07-17 17:14                             ` [PATCH 2/2] Add tests for cherry-pick d/f conflict which should be none Johannes Schindelin
2007-07-08 12:53                       ` [PATCH] merge-tree: sometimes, d/f conflict is not an issue 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=Pine.LNX.4.64.0707081353560.4248@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pape@smarden.org \
    --cc=vanicat@debian.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).