<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.c, branch v2.19.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.19.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.19.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-10-04T13:03:49Z</updated>
<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>fetch-pack: avoid object flags if no_dependents</title>
<updated>2018-10-04T13:00:53Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-10-03T23:04:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12f19a9825686e3641803580bda4e2ab2abd44ed'/>
<id>urn:sha1:12f19a9825686e3641803580bda4e2ab2abd44ed</id>
<content type='text'>
When fetch_pack() is invoked as part of another Git command (due to a
lazy fetch from a partial clone, for example), it uses object flags that
may already be used by the outer Git command.

The commit that introduced the lazy fetch feature (88e2f9ed8e
("introduce fetch-object: fetch one promisor object", 2017-12-05)) tried
to avoid this overlap, but it did not avoid it totally. It was
successful in avoiding writing COMPLETE, but did not avoid reading
COMPLETE, and did not avoid writing and reading ALTERNATE.

Ensure that no flags are written or read by fetch_pack() in the case
where it is used to perform a lazy fetch. To do this, it is sufficient
to avoid checking completeness of wanted refs (unnecessary in the case
of lazy fetches), and to avoid negotiation-related work (in the current
implementation, already, no negotiation is performed). After that was
done, the lack of overlap was verified by checking all direct and
indirect usages of COMPLETE and ALTERNATE - that they are read or
written only if no_dependents is false.

There are other possible solutions to this issue:

 (1) Split fetch-pack.{c,h} into a flag-using part and a non-flag-using
     part, and whenever no_dependents is set, only use the
     non-flag-using part.
 (2) Make fetch_pack() be able to be used with arbitrary repository
     objects. fetch_pack() should then create its own repository object
     based on the given repository object, with its own object
     hashtable, so that the flags do not conflict.

(1) is possible but invasive - some functions would need to be split;
and such invasiveness would potentially be unnecessary if we ever were
to need (2) anyway. (2) would be useful if we were to support, say,
submodules that were partial clones themselves, but I don't know when or
if the Git project plans to support those.

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 'ab/fsck-transfer-updates'</title>
<updated>2018-08-17T20:09:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-17T20:09:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8ca71870a4265320fbbecb4f676d0ad1d4bf176'/>
<id>urn:sha1:f8ca71870a4265320fbbecb4f676d0ad1d4bf176</id>
<content type='text'>
The test performed at the receiving end of "git push" to prevent
bad objects from entering repository can be customized via
receive.fsck.* configuration variables; we now have gained a
counterpart to do the same on the "git fetch" side, with
fetch.fsck.* configuration variables.

* ab/fsck-transfer-updates:
  fsck: test and document unknown fsck.&lt;msg-id&gt; values
  fsck: add stress tests for fsck.skipList
  fsck: test &amp; document {fetch,receive}.fsck.* config fallback
  fetch: implement fetch.fsck.*
  transfer.fsckObjects tests: untangle confusing setup
  config doc: elaborate on fetch.fsckObjects security
  config doc: elaborate on what transfer.fsckObjects does
  config doc: unify the description of fsck.* and receive.fsck.*
  config doc: don't describe *.fetchObjects twice
  receive.fsck.&lt;msg-id&gt; tests: remove dead code
</content>
</entry>
<entry>
<title>Merge branch 'jt/connectivity-check-after-unshallow'</title>
<updated>2018-08-15T22:08:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-15T22:08:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b160b6e69d5e8231cf71b3bcacef63443849d1f9'/>
<id>urn:sha1:b160b6e69d5e8231cf71b3bcacef63443849d1f9</id>
<content type='text'>
"git fetch" sometimes failed to update the remote-tracking refs,
which has been corrected.

* jt/connectivity-check-after-unshallow:
  fetch-pack: unify ref in and out param
</content>
</entry>
<entry>
<title>Merge branch 'bw/fetch-pack-i18n'</title>
<updated>2018-08-15T22:08:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-15T22:08:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea30f539ef2092dee1b1c9e3aef8a934c0ce7c00'/>
<id>urn:sha1:ea30f539ef2092dee1b1c9e3aef8a934c0ce7c00</id>
<content type='text'>
i18n updates.

* bw/fetch-pack-i18n:
  fetch-pack: mark die strings for translation
</content>
</entry>
<entry>
<title>Merge branch 'jt/fetch-negotiator-skipping'</title>
<updated>2018-08-02T22:30:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c85ee6c5818f4409a29e40cc406ef5db9560af8'/>
<id>urn:sha1:7c85ee6c5818f4409a29e40cc406ef5db9560af8</id>
<content type='text'>
Add a server-side knob to skip commits in exponential/fibbonacci
stride in an attempt to cover wider swath of history with a smaller
number of iterations, potentially accepting a larger packfile
transfer, instead of going back one commit a time during common
ancestor discovery during the "git fetch" transaction.

* jt/fetch-negotiator-skipping:
  negotiator/skipping: skip commits during fetch
</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>Merge branch 'sb/object-store-lookup'</title>
<updated>2018-08-02T22:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a2a1dc17077a27ad1a89db27cb1b4b374f3b0ff'/>
<id>urn:sha1:3a2a1dc17077a27ad1a89db27cb1b4b374f3b0ff</id>
<content type='text'>
lookup_commit_reference() and friends have been updated to find
in-core object for a specific in-core repository instance.

* sb/object-store-lookup: (32 commits)
  commit.c: allow lookup_commit_reference to handle arbitrary repositories
  commit.c: allow lookup_commit_reference_gently to handle arbitrary repositories
  tag.c: allow deref_tag to handle arbitrary repositories
  object.c: allow parse_object to handle arbitrary repositories
  object.c: allow parse_object_buffer to handle arbitrary repositories
  commit.c: allow get_cached_commit_buffer to handle arbitrary repositories
  commit.c: allow set_commit_buffer to handle arbitrary repositories
  commit.c: migrate the commit buffer to the parsed object store
  commit-slabs: remove realloc counter outside of slab struct
  commit.c: allow parse_commit_buffer to handle arbitrary repositories
  tag: allow parse_tag_buffer to handle arbitrary repositories
  tag: allow lookup_tag to handle arbitrary repositories
  commit: allow lookup_commit to handle arbitrary repositories
  tree: allow lookup_tree to handle arbitrary repositories
  blob: allow lookup_blob to handle arbitrary repositories
  object: allow lookup_object to handle arbitrary repositories
  object: allow object_as_type to handle arbitrary repositories
  tag: add repository argument to deref_tag
  tag: add repository argument to parse_tag_buffer
  tag: add repository argument to lookup_tag
  ...
</content>
</entry>
<entry>
<title>Merge branch 'jt/fetch-pack-negotiator'</title>
<updated>2018-08-02T22:30:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=af8ac73801eebf0f3690c3875751eb9e108ceda8'/>
<id>urn:sha1:af8ac73801eebf0f3690c3875751eb9e108ceda8</id>
<content type='text'>
Code restructuring and a small fix to transport protocol v2 during
fetching.

* jt/fetch-pack-negotiator:
  fetch-pack: introduce negotiator API
  fetch-pack: move common check and marking together
  fetch-pack: make negotiation-related vars local
  fetch-pack: use ref adv. to prune "have" sent
  fetch-pack: directly end negotiation if ACK ready
  fetch-pack: clear marks before re-marking
  fetch-pack: split up everything_local()
</content>
</entry>
<entry>
<title>fetch-pack: unify ref in and out param</title>
<updated>2018-08-01T22:00:52Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-08-01T20:13:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2842b39f4168e3cd39a53961c1e50bb940eedf1'/>
<id>urn:sha1:e2842b39f4168e3cd39a53961c1e50bb940eedf1</id>
<content type='text'>
When a user fetches:
 - at least one up-to-date ref and at least one non-up-to-date ref,
 - using HTTP with protocol v0 (or something else that uses the fetch
   command of a remote helper)
some refs might not be updated after the fetch.

This bug was introduced in commit 989b8c4452 ("fetch-pack: put shallow
info in output parameter", 2018-06-28) which allowed transports to
report the refs that they have fetched in a new out-parameter
"fetched_refs". If they do so, transport_fetch_refs() makes this
information available to its caller.

Users of "fetched_refs" rely on the following 3 properties:
 (1) it is the complete list of refs that was passed to
     transport_fetch_refs(),
 (2) it has shallow information (REF_STATUS_REJECT_SHALLOW set if
     relevant), and
 (3) it has updated OIDs if ref-in-want was used (introduced after
     989b8c4452).

In an effort to satisfy (1), whenever transport_fetch_refs()
filters the refs sent to the transport, it re-adds the filtered refs to
whatever the transport supplies before returning it to the user.
However, the implementation in 989b8c4452 unconditionally re-adds the
filtered refs without checking if the transport refrained from reporting
anything in "fetched_refs" (which it is allowed to do), resulting in an
incomplete list, no longer satisfying (1).

An earlier effort to resolve this [1] solved the issue by readding the
filtered refs only if the transport did not refrain from reporting in
"fetched_refs", but after further discussion, it seems that the better
solution is to revert the API change that introduced "fetched_refs".
This API change was first suggested as part of a ref-in-want
implementation that allowed for ref patterns and, thus, there could be
drastic differences between the input refs and the refs actually fetched
[2]; we eventually decided to only allow exact ref names, but this API
change remained even though its necessity was decreased.

Therefore, revert this API change by reverting commit 989b8c4452, and
make receive_wanted_refs() update the OIDs in the sought array (like how
update_shallow() updates shallow information in the sought array)
instead. A test is also included to show that the user-visible bug
discussed at the beginning of this commit message no longer exists.

[1] https://public-inbox.org/git/20180801171806.GA122458@google.com/
[2] https://public-inbox.org/git/86a128c5fb710a41791e7183207c4d64889f9307.1485381677.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>
</feed>
