<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.h, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-09-03T19:37:04Z</updated>
<entry>
<title>Merge branch 'jt/lazy-fetch'</title>
<updated>2020-09-03T19:37:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-03T19:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b4100f366c1e5adf3a254cdc6f832aa1a4461053'/>
<id>urn:sha1:b4100f366c1e5adf3a254cdc6f832aa1a4461053</id>
<content type='text'>
Updates to on-demand fetching code in lazily cloned repositories.

* jt/lazy-fetch:
  fetch: no FETCH_HEAD display if --no-write-fetch-head
  fetch-pack: remove no_dependents code
  promisor-remote: lazy-fetch objects in subprocess
  fetch-pack: do not lazy-fetch during ref iteration
  fetch: only populate existing_refs if needed
  fetch: avoid reading submodule config until needed
  fetch: allow refspecs specified through stdin
  negotiator/noop: add noop fetch negotiator
</content>
</entry>
<entry>
<title>(various): document from_promisor parameter</title>
<updated>2020-08-25T00:30:08Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-08-17T19:48:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=42d418df909e8628412ee16167c63dad005cc875'/>
<id>urn:sha1:42d418df909e8628412ee16167c63dad005cc875</id>
<content type='text'>
88e2f9ed8e ("introduce fetch-object: fetch one promisor object",
2017-12-05) plumbed through the from_promisor parameter but did
not document it everywhere it appeared. Add the documentation.

(It also plumbed through the no_dependents parameter, but I have left
that alone because it is being removed in a commit under review [1].)

[1] https://lore.kernel.org/git/e8f16d69089a5011c355d5939c56fa53b7a1eb2d.1597184949.git.jonathantanmy@google.com/

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: remove no_dependents code</title>
<updated>2020-08-18T23:46:53Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-08-18T04:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9dfa8dbeee18a126aabcdd36a06e5d6b5eb6a58a'/>
<id>urn:sha1:9dfa8dbeee18a126aabcdd36a06e5d6b5eb6a58a</id>
<content type='text'>
Now that Git has switched to using a subprocess to lazy-fetch missing
objects, remove the no_dependents code as it is no longer used.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: support more than one pack lockfile</title>
<updated>2020-06-11T01:06:34Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-06-10T20:57:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9da69a6539e98da1b7ed8832cb54b494961463cb'/>
<id>urn:sha1:9da69a6539e98da1b7ed8832cb54b494961463cb</id>
<content type='text'>
Whenever a fetch results in a packfile being downloaded, a .keep file is
generated, so that the packfile can be preserved (from, say, a running
"git repack") until refs are written referring to the contents of the
packfile.

In a subsequent patch, a successful fetch using protocol v2 may result
in more than one .keep file being generated. Therefore, teach
fetch_pack() and the transport mechanism to support multiple .keep
files.

Implementation notes:

 - builtin/fetch-pack.c normally does not generate .keep files, and thus
   is unaffected by this or future changes. However, it has an
   undocumented "--lock-pack" feature, used by remote-curl.c when
   implementing the "fetch" remote helper command. In keeping with the
   remote helper protocol, only one "lock" line will ever be written;
   the rest will result in warnings to stderr. However, in practice,
   warnings will never be written because the remote-curl.c "fetch" is
   only used for protocol v0/v1 (which will not generate multiple .keep
   files). (Protocol v2 uses the "stateless-connect" command, not the
   "fetch" command.)

 - connected.c has an optimization in that connectivity checks on a ref
   need not be done if the target object is in a pack known to be
   self-contained and connected. If there are multiple packfiles, this
   optimization can no longer be done.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch_pack(): drop unused parameters</title>
<updated>2019-03-20T09:34:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-03-20T08:16:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f804b0bac39fb696ea74b8dd59549935ec9ca00'/>
<id>urn:sha1:0f804b0bac39fb696ea74b8dd59549935ec9ca00</id>
<content type='text'>
We don't need the caller of fetch_pack() to pass in "dest", which is the
remote URL. Since ba227857d2 (Reduce the number of connects when
fetching, 2008-02-04), the caller is responsible for calling
git_connect() itself, and our "dest" parameter is unused.

That commit also started passing us the resulting "conn" child_process
from git_connect(). But likewise, we do not need do anything with it.
The descriptors in "fd" are enough for us, and the caller is responsible
for cleaning up "conn".

We can just drop both parameters.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: exclude blobs when lazy-fetching trees</title>
<updated>2018-10-04T13:03:49Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-10-03T23:04:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c7f9567ea2628451a0f4ad52599a25d34657bae'/>
<id>urn:sha1:4c7f9567ea2628451a0f4ad52599a25d34657bae</id>
<content type='text'>
A partial clone with missing trees can be obtained using "git clone
--filter=tree:none &lt;repo&gt;". In such a repository, when a tree needs to
be lazily fetched, any tree or blob it directly or indirectly references
is fetched as well, regardless of whether the original command required
those objects, or if the local repository already had some of them.

This is because the fetch protocol, which the lazy fetch uses, does not
allow clients to request that only the wanted objects be sent, which
would be the ideal solution. This patch implements a partial solution:
specify the "blob:none" filter, somewhat reducing the fetch payload.

This change has no effect when lazily fetching blobs (due to how filters
work). And if lazily fetching a commit (such repositories are difficult
to construct and is not a use case we support very well, but it is
possible), referenced commits and trees are still fetched - only the
blobs are not fetched.

The necessary code change is done in fetch_pack() instead of somewhere
closer to where the "filter" instruction is written to the wire so that
only one part of the code needs to be changed in order for users of all
protocol versions to benefit from this optimization.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/fetch-nego-tip'</title>
<updated>2018-08-02T22:30:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=30bf8d9f4f06d8e35793612c8611cb03c53a73db'/>
<id>urn:sha1:30bf8d9f4f06d8e35793612c8611cb03c53a73db</id>
<content type='text'>
"git fetch" learned a new option "--negotiation-tip" to limit the
set of commits it tells the other end as "have", to reduce wasted
bandwidth and cycles, which would be helpful when the receiving
repository has a lot of refs that have little to do with the
history at the remote it is fetching from.

* jt/fetch-nego-tip:
  fetch-pack: support negotiation tip whitelist
</content>
</entry>
<entry>
<title>fetch-pack: support negotiation tip whitelist</title>
<updated>2018-07-03T22:00:41Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-07-02T22:39:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3390e42adb3b84a9d61b3d46f4105f4cb6ba5edd'/>
<id>urn:sha1:3390e42adb3b84a9d61b3d46f4105f4cb6ba5edd</id>
<content type='text'>
During negotiation, fetch-pack eventually reports as "have" lines all
commits reachable from all refs. Allow the user to restrict the commits
sent in this way by providing a whitelist of tips; only the tips
themselves and their ancestors will be sent.

Both globs and single objects are supported.

This feature is only supported for protocols that support connect or
stateless-connect (such as HTTP with protocol v2).

This will speed up negotiation when the repository has multiple
relatively independent branches (for example, when a repository
interacts with multiple repositories, such as with linux-next [1] and
torvalds/linux [2]), and the user knows which local branch is likely to
have commits in common with the upstream branch they are fetching.

[1] https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next/
[2] https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: write shallow, then check connectivity</title>
<updated>2018-07-03T21:57:44Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-07-02T22:08:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf1e7c07705eb21c30d0ee414810e7bc8fdf7d82'/>
<id>urn:sha1:cf1e7c07705eb21c30d0ee414810e7bc8fdf7d82</id>
<content type='text'>
When fetching, connectivity is checked after the shallow file is
updated. There are 2 issues with this: (1) the connectivity check is
only performed up to ancestors of existing refs (which is not thorough
enough if we were deepening an existing ref in the first place), and (2)
there is no rollback of the shallow file if the connectivity check
fails.

To solve (1), update the connectivity check to check the ancestry chain
completely in the case of a deepening fetch by refraining from passing
"--not --all" when invoking rev-list in connected.c.

To solve (2), have fetch_pack() perform its own connectivity check
before updating the shallow file. To support existing use cases in which
"git fetch-pack" is used to download objects without much regard as to
the connectivity of the resulting objects with respect to the existing
repository, the connectivity check is only done if necessary (that is,
the fetch is not a clone, and the fetch involves shallow/deepen
functionality). "git fetch" still performs its own connectivity check,
preserving correctness but sometimes performing redundant work. This
redundancy is mitigated by the fact that fetch_pack() reports if it has
performed a connectivity check itself, and if the transport supports
connect or stateless-connect, it will bubble up that report so that "git
fetch" knows not to perform the connectivity check in such a case.

This was noticed when a user tried to deepen an existing repository by
fetching with --no-shallow from a server that did not send all necessary
objects - the connectivity check as run by "git fetch" succeeded, but a
subsequent "git fsck" failed.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch: send server options when using protocol v2</title>
<updated>2018-04-24T02:24:40Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2018-04-23T22:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e3548ef161d4d284e35cf5f5d6a181ba4fe707b'/>
<id>urn:sha1:5e3548ef161d4d284e35cf5f5d6a181ba4fe707b</id>
<content type='text'>
Teach fetch to optionally accept server options by specifying them on
the cmdline via '-o' or '--server-option'.  These server options are
sent to the remote end when performing a fetch communicating using
protocol version 2.

If communicating using a protocol other than v2 the provided options are
ignored and not sent to the remote end.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
