<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.h, branch v2.50.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.50.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.50.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-11-28T03:07:58Z</updated>
<entry>
<title>fetch-pack: split out fsck config parsing</title>
<updated>2024-11-28T03:07:58Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2024-11-27T23:33:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=05596e93c50b286fa445af8ae572759be079092d'/>
<id>urn:sha1:05596e93c50b286fa445af8ae572759be079092d</id>
<content type='text'>
When `fetch_pack_config()` is invoked, fetch-pack configuration is
parsed from the config. As part of this operation, fsck message severity
configuration is assigned to the `fsck_msg_types` global variable. This
is optionally used to configure the downstream git-index-pack(1) when
the `--strict` option is specified.

The same parsed fsck message severity configuration is also needed
outside of fetch-pack. Instead of exposing/relying on the existing
global state, split out the fsck config parsing logic into
`fetch_pack_fsck_config()` and expose it. In a subsequent commit, this
is used to provide fsck configuration when invoking `unbundle()`.

For `fetch_pack_fsck_config()` to discern between errors and unhandled
config variables, the return code when `git_config_path()` errors is
changed to a different value also indicating success. This frees up the
previous return code to now indicate the provided config variable
was unhandled. The behavior remains functionally the same.

Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: expose fsckObjects configuration logic</title>
<updated>2024-06-20T17:30:07Z</updated>
<author>
<name>Xing Xin</name>
<email>xingxin.xx@bytedance.com</email>
</author>
<published>2024-06-19T04:07:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0cbc75680405c85ecc3f91b12ac29b1a05a3fcf'/>
<id>urn:sha1:d0cbc75680405c85ecc3f91b12ac29b1a05a3fcf</id>
<content type='text'>
Currently, we can use "transfer.fsckObjects" and the more specific
"fetch.fsckObjects" to control checks for broken objects in received
packs during fetches. However, these configurations were only
acknowledged by `fetch-pack.c:get_pack` and did not take effect in
direct bundle fetches or fetches with _bundle-uri_ enabled.

This commit exposes the fetch-then-transfer configuration logic by
adding a new function `fetch_pack_fsck_objects` in fetch-pack.h. This
new function is used to replace the assignment for `fsck_objects` in
`fetch-pack.c:get_pack`. In the next commit, this function will also be
used to extend fsck support for bundle-involved fetches.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Xing Xin &lt;xingxin.xx@bytedance.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: remove unnecessary includes from header files</title>
<updated>2023-12-26T20:04:31Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-12-23T17:14:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=147438e8a0eb31a06cb9aefbf0de8c45e544a4c7'/>
<id>urn:sha1:147438e8a0eb31a06cb9aefbf0de8c45e544a4c7</id>
<content type='text'>
There are three kinds of unnecessary includes:
  * includes which aren't directly needed, but which include some other
    forgotten include
  * includes which could be replaced by a simple forward declaration of
    some structs
  * includes which aren't needed at all

Remove the third kind of include.  Subsequent commits (and a subsequent
series) will work on removing some of the other kinds of includes.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: add refetch</title>
<updated>2022-03-28T17:25:52Z</updated>
<author>
<name>Robert Coup</name>
<email>robert@coup.net.nz</email>
</author>
<published>2022-03-28T14:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4dfd0925cbba78cc737e3af29faa5774bbc7b6a3'/>
<id>urn:sha1:4dfd0925cbba78cc737e3af29faa5774bbc7b6a3</id>
<content type='text'>
Allow a "refetch" where the contents of the local object store are
ignored and a full fetch is performed, not attempting to find or
negotiate common commits with the remote.

A key use case is to apply a new partial clone blob/tree filter and
refetch all the associated matching content, which would otherwise not
be transferred when the commit objects are already present locally.

Signed-off-by: Robert Coup &lt;robert@coup.net.nz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch: teach independent negotiation (no packfile)</title>
<updated>2021-05-05T01:41:29Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-05-04T21:16:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9c1e657a8fd26fa3ed8d13fb8c796cef8db8b124'/>
<id>urn:sha1:9c1e657a8fd26fa3ed8d13fb8c796cef8db8b124</id>
<content type='text'>
Currently, the packfile negotiation step within a Git fetch cannot be
done independent of sending the packfile, even though there is at least
one application wherein this is useful. Therefore, make it possible for
this negotiation step to be done independently. A subsequent commit will
use this for one such application - push negotiation.

This feature is for protocol v2 only. (An implementation for protocol v0
would require a separate implementation in the fetch, transport, and
transport helper code.)

In the protocol, the main hindrance towards independent negotiation is
that the server can unilaterally decide to send the packfile. This is
solved by a "wait-for-done" argument: the server will then wait for the
client to say "done". In practice, the client will never say it; instead
it will cease requests once it is satisfied.

In the client, the main change lies in the transport and transport
helper code. fetch_refs_via_pack() performs everything needed - protocol
version and capability checks, and the negotiation itself.

There are 2 code paths that do not go through fetch_refs_via_pack() that
needed to be individually excluded: the bundle transport (excluded
through requiring smart_options, which the bundle transport doesn't
support) and transport helpers that do not support takeover. If or when
we support independent negotiation for protocol v0, we will need to
modify these 2 code paths to support it. But for now, report failure if
independent negotiation is requested in these cases.

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>builtin/clone.c: add --reject-shallow option</title>
<updated>2021-04-01T19:58:58Z</updated>
<author>
<name>Li Linchao</name>
<email>lilinchao@oschina.cn</email>
</author>
<published>2021-04-01T10:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4fe788b1b0ee6150173580d8fa70e7d5788cf7d3'/>
<id>urn:sha1:4fe788b1b0ee6150173580d8fa70e7d5788cf7d3</id>
<content type='text'>
In some scenarios, users may want more history than the repository
offered for cloning, which happens to be a shallow repository, can
give them. But because users don't know it is a shallow repository
until they download it to local, we may want to refuse to clone
this kind of repository, without creating any unnecessary files.

The '--depth=x' option cannot be used as a solution; the source may
be deep enough to give us 'x' commits when cloned, but the user may
later need to deepen the history to arbitrary depth.

Teach '--reject-shallow' option to "git clone" to abort as soon as
we find out that we are cloning from a shallow repository.

Signed-off-by: Li Linchao &lt;lilinchao@oschina.cn&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
