From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Strange merge failure (would be overwritten by merge / cannot merge)
Date: Sun, 06 Sep 2009 12:39:27 -0700 [thread overview]
Message-ID: <7v3a6z3lsg.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LFD.2.01.0909061053330.8946@localhost.localdomain> (Linus Torvalds's message of "Sun\, 6 Sep 2009 11\:18\:59 -0700 \(PDT\)")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> And then fix the fallout from that: callers never get mixed-up tree and
> blob entries, and have to do their DF checking themselves.
There are two levels of internal APIs involved, and I am getting confused
as to which level of callers you are referrring to in the above.
My understanding of the current situation is:
* unpack_trees() takes a callback from the caller in o->fn(). It
promises (but fails to keep the promise) that the callback is called
with entries with matching names, so that it gets to see D/F
conflicting entries in one go.
* traverse_trees() takes a callback from the caller in info->fn(). It
feeds the callback the entries with the same name most of the time, but
that is not a guarantee, and the bug we are seeing is coming from a
caller, unpack_trees_callback(), assuming it.
Do you mean we would still keep the promise unpack_trees() makes to its
callbacks, e.g. threeway_merge(), or do you mean these callbacks are to be
prepared to get DF-split input themselves and expected to coalesce them
as necessary?
There are only two callers of traverse_trees() interface. unpack_trees()
codepath is the primary one (the other being the merge-tree.c, which is in
disuse).
If you mean unpack_trees() by "callers, ... have to do their DF checking",
it may be a much isolated fix than what I had in mind in the last message
from me---the one that makes traverse_trees() pay attention to the caller
supplied "candiate 'earliest' name" and tries to push the "give entries
from all the trees with the same name to the callback in one go" promise
down to traverse_trees() layer.
If traverse_trees() did not do this name coalescing, on the other hand, I
wonder if it is doing only half of the job to be useful. I do not think
of a plausible scenario where a caller, who wants to walk multiple trees
in parallel, does not want to be fed the entries with the same name from
all the input trees in one invocation of the callback it gives.
If all the callers need to do the name coalescing in order to notice the
situation that led to this bug, I wonder if it would be nicer to do so in
traverse_trees()?
unpack_trees() would of course be helped if traverse_trees() gave that
promise, and I suspect merge-tree.c::threeway_callback() would expect that
behaviour, too.
next prev parent reply other threads:[~2009-09-06 19:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 20:28 Strange merge failure (would be overwritten by merge / cannot merge) Christoph Haas
2009-09-04 23:45 ` David Aguilar
2009-09-05 13:07 ` Christoph Haas
2009-09-05 17:46 ` Junio C Hamano
2009-09-06 0:33 ` Junio C Hamano
2009-09-06 8:21 ` Junio C Hamano
2009-09-06 18:18 ` Linus Torvalds
2009-09-06 19:39 ` Junio C Hamano [this message]
2009-09-06 19:54 ` Linus Torvalds
2009-09-06 20:36 ` Junio C Hamano
2009-09-06 20:42 ` Linus Torvalds
2009-09-06 20:58 ` Linus Torvalds
2009-09-06 21:17 ` Junio C Hamano
2009-09-06 21:37 ` Linus Torvalds
2009-09-06 22:49 ` Linus Torvalds
2009-09-06 21:11 ` Junio C Hamano
2009-09-05 6:40 ` unpack-trees traversing with index quite broken Junio C Hamano
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=7v3a6z3lsg.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.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).