From: Junio C Hamano <gitster@pobox.com>
To: Matt Glazar <strager@fb.com>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git-fetch pulls already-pulled objects?
Date: Thu, 29 Oct 2015 10:32:06 -0700 [thread overview]
Message-ID: <xmqqd1vxshrd.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <D256A718.1373A%strager@fb.com> (Matt Glazar's message of "Wed, 28 Oct 2015 23:28:24 +0000")
Matt Glazar <strager@fb.com> writes:
> On a remote, I have two Git commit objects which point to the same tree
> object (created with git commit-tree).
What you are expecting _could_ be implemented by exchanging all
tree and blob objects sending and receiving sides have and computing
the set difference, but the sender and the receiver do not exchange
such a huge list.
The object transfer is done by first finding the common ancestor of
histories of the sending and the receiving sides, which allows the
sender to enumerate commits that the sender has but the receiver
doesn't. From there, all objects [*1*] that are referenced by these
commits that need to be sent.
[Footnote]
*1* There is an optimization to exclude the trees and blobs that can
be cheaply proven to exist on the receiving end. If the receiving
end has a commit that the sending end does *not* have, and that
commit happens to record a tree the sending end needs to send,
however, the sending end cannot prove that the tree does not have to
be sent without first fetching that commit from the receiving end,
which fails "can be cheaply proven to exist" test.
next prev parent reply other threads:[~2015-10-29 17:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 23:28 git-fetch pulls already-pulled objects? Matt Glazar
2015-10-29 17:32 ` Junio C Hamano [this message]
2015-10-29 18:08 ` Matt Glazar
2015-10-29 18:42 ` Junio C Hamano
2015-10-29 19:52 ` Matt Glazar
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=xmqqd1vxshrd.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=strager@fb.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.