From: Junio C Hamano <junkio@cox.net>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org
Subject: Re: Multi-ancestor read-tree notes
Date: Fri, 09 Sep 2005 10:29:27 -0700 [thread overview]
Message-ID: <7vy866i1zc.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0509050049030.23242@iabervon.org> (Daniel Barkalow's message of "Mon, 5 Sep 2005 01:41:36 -0400 (EDT)")
Daniel Barkalow <barkalow@iabervon.org> writes:
> In case #16, I'm not sure what I should produce. I think the best thing
> might be to not leave anything in stage 1. The desired end effect is that
> the user is given a file with a section like:
>
> {
> *t = NULL;
> *m = 0;
> <<<<<<<<
> return Z_DATA_ERROR;
> ========
> return Z_OK;
>>>>>>>>>
> }
I was thinking a bit more about this. Let's rephrase case #16.
I'll call merge bases O1, O2,... and merge heads A and B, and we
are interested in one path.
If O1 and O2, the path has quite different contents. A has the
same contents as O1 and B has the same contents as O2. We
should not just pick one or the other and do two-file merge
between the version in A and B (we could prototype by massaging
'diff A B' output to produce what is common between A and B and
run (RCS) merge of A and B pretending that the common contents
is the original to produce something like the above).
If A has slight changes since O1 but B did not change since O2,
ideally I think we would want the same thing to happen. Let's
call it case #16+.
What does the current implementation do? It is not case #16
because A and O1 does not exactly match. I suspect the result
will be skewed because B has an exact match with O2. The
situation becomes more interesting if both A and B has slight
changes since O1 and O2 respectively. They do not exactly match
with their bases, but I think ideally we would like something
very similar to case #16 resolution to happen.
One way to solve this would be to try doing things entirely in
read-tree by doing not just exact matches but also checking the
amount of changes -- if each heads has similar but different
base call it case #16 and try two-file merge between the heads
disregarding the bases.
But I am a bit reluctant to suggest this. My gut feeling tells
me that these 'interesting' cases are easier if scripted outside
read-tree machinery to later enhance and improve the heuristics.
Of course, the current case #16 detected by the exact match rule
should be something we can automatically handle, but to make
things safer to use I think we should have a way to detect case
#16+ situlation and avoid mistakenly favoring A over B (or vice
versa) only because one has slight modification while the other
does not.
next prev parent reply other threads:[~2005-09-09 17:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-05 5:41 Multi-ancestor read-tree notes Daniel Barkalow
2005-09-06 5:42 ` Junio C Hamano
2005-09-06 17:43 ` Daniel Barkalow
2005-09-06 20:03 ` Junio C Hamano
2005-09-06 20:25 ` Daniel Barkalow
2005-09-06 21:53 ` Junio C Hamano
2005-09-06 22:59 ` Daniel Barkalow
2005-09-10 22:50 ` Junio C Hamano
2005-09-10 22:56 ` Junio C Hamano
2005-09-08 17:16 ` Darrin Thompson
2005-09-08 20:37 ` Fredrik Kuivinen
2005-09-08 21:39 ` Daniel Barkalow
2005-09-08 21:54 ` Darrin Thompson
2005-09-08 22:00 ` Junio C Hamano
2005-09-08 22:10 ` Daniel Barkalow
2005-09-09 17:29 ` Junio C Hamano [this message]
2005-09-09 20:44 ` Daniel Barkalow
2005-09-11 16:45 ` Matthias Urlichs
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=7vy866i1zc.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.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).