<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.c, branch v2.17.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.17.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.17.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-03-15T17:16:27Z</updated>
<entry>
<title>fetch-pack: do not check links for partial fetch</title>
<updated>2018-03-15T17:16:27Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-03-14T18:42:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98a2ea46c2dedf45b5a94335462547a5d78a68e2'/>
<id>urn:sha1:98a2ea46c2dedf45b5a94335462547a5d78a68e2</id>
<content type='text'>
When doing a partial clone or fetch with transfer.fsckobjects=1, use the
--fsck-objects instead of the --strict flag when invoking index-pack so
that links are not checked, only objects. This is because incomplete
links are expected when doing a partial clone or fetch.

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 'js/packet-read-line-check-null'</title>
<updated>2018-02-27T18:33:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-27T18:33:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2fb346c06a0160cac185ad57368c04c17c2578ac'/>
<id>urn:sha1:2fb346c06a0160cac185ad57368c04c17c2578ac</id>
<content type='text'>
Some low level protocol codepath could crash when they get an
unexpected flush packet, which is now fixed.

* js/packet-read-line-check-null:
  always check for NULL return from packet_read_line()
  correct error messages for NULL packet_read_line()
</content>
</entry>
<entry>
<title>Merge branch 'jh/partial-clone'</title>
<updated>2018-02-13T21:39:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-13T21:39:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6bed209a20a06f2d6b7142216dabff456de798e1'/>
<id>urn:sha1:6bed209a20a06f2d6b7142216dabff456de798e1</id>
<content type='text'>
The machinery to clone &amp; fetch, which in turn involves packing and
unpacking objects, have been told how to omit certain objects using
the filtering mechanism introduced by the jh/object-filtering
topic, and also mark the resulting pack as a promisor pack to
tolerate missing objects, taking advantage of the mechanism
introduced by the jh/fsck-promisors topic.

* jh/partial-clone:
  t5616: test bulk prefetch after partial fetch
  fetch: inherit filter-spec from partial clone
  t5616: end-to-end tests for partial clone
  fetch-pack: restore save_commit_buffer after use
  unpack-trees: batch fetching of missing blobs
  clone: partial clone
  partial-clone: define partial clone settings in config
  fetch: support filters
  fetch: refactor calculation of remote list
  fetch-pack: test support excluding large blobs
  fetch-pack: add --no-filter
  fetch-pack, index-pack, transport: partial clone
  upload-pack: add object filtering for partial clone
</content>
</entry>
<entry>
<title>Merge branch 'jh/fsck-promisors'</title>
<updated>2018-02-13T21:39:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-13T21:39:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3d618d2bf4099abe99babc8b56dcd483c5eec71'/>
<id>urn:sha1:f3d618d2bf4099abe99babc8b56dcd483c5eec71</id>
<content type='text'>
In preparation for implementing narrow/partial clone, the machinery
for checking object connectivity used by gc and fsck has been
taught that a missing object is OK when it is referenced by a
packfile specially marked as coming from trusted repository that
promises to make them available on-demand and lazily.

* jh/fsck-promisors:
  gc: do not repack promisor packfiles
  rev-list: support termination at promisor objects
  sha1_file: support lazily fetching missing objects
  introduce fetch-object: fetch one promisor object
  index-pack: refactor writing of .keep files
  fsck: support promisor objects as CLI argument
  fsck: support referenced promisor objects
  fsck: support refs pointing to promisor objects
  fsck: introduce partialclone extension
  extension.partialclone: introduce partial clone extension
</content>
</entry>
<entry>
<title>correct error messages for NULL packet_read_line()</title>
<updated>2018-02-08T20:37:30Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-02-08T18:47:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc9d4dc5b07c05c7b26a4e781b7538db7c775fc3'/>
<id>urn:sha1:bc9d4dc5b07c05c7b26a4e781b7538db7c775fc3</id>
<content type='text'>
The packet_read_line() function dies if it gets an
unexpected EOF. It only returns NULL if we get a flush
packet (or technically, a zero-length "0004" packet, but
nobody is supposed to send those, and they are
indistinguishable from a flush in this interface).

Let's correct error messages which claim an unexpected EOF;
it's really an unexpected flush packet.

While we're here, let's also check "!line" instead of
"!len" in the second case. The two events should always
coincide, but checking "!line" makes it more obvious that we
are not about to dereference NULL.

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: restore save_commit_buffer after use</title>
<updated>2017-12-08T17:58:52Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-12-08T15:58:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a1c6d7c1a792bd2c60bbfb07597d13f7d0c4eb37'/>
<id>urn:sha1:a1c6d7c1a792bd2c60bbfb07597d13f7d0c4eb37</id>
<content type='text'>
In fetch-pack, the global variable save_commit_buffer is set to 0, but
not restored to its original value after use.

In particular, if show_log() (in log-tree.c) is invoked after
fetch_pack() in the same process, show_log() will return before printing
out the commit message (because the invocation to
get_cached_commit_buffer() returns NULL, because the commit buffer was
not saved). I discovered this when attempting to run "git log -S" in a
partial clone, triggering the case where revision walking lazily loads
missing objects.

Therefore, restore save_commit_buffer to its original value after use.

An alternative to solve the problem I had is to replace
get_cached_commit_buffer() with get_commit_buffer(). That invocation was
introduced in commit a97934d ("use get_cached_commit_buffer where
appropriate", 2014-06-13) to replace "commit-&gt;buffer" introduced in
commit 3131b71 ("Add "--show-all" revision walker flag for debugging",
2008-02-13). In the latter commit, the commit author seems to be
deciding between not showing an unparsed commit at all and showing an
unparsed commit without the message (which is what the commit does), and
did not mention parsing the unparsed commit, so I prefer to preserve the
existing behavior.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack, index-pack, transport: partial clone</title>
<updated>2017-12-08T17:58:51Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2017-12-08T15:58:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=640d8b72feaae0b96d5faa663ad624963e416d54'/>
<id>urn:sha1:640d8b72feaae0b96d5faa663ad624963e416d54</id>
<content type='text'>
Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/fewer-pack-rescan'</title>
<updated>2017-12-06T17:23:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-12-06T17:23:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=79bafd23a82a883ab054c9fcaf1e3d3bea57e4b9'/>
<id>urn:sha1:79bafd23a82a883ab054c9fcaf1e3d3bea57e4b9</id>
<content type='text'>
Internaly we use 0{40} as a placeholder object name to signal the
codepath that there is no such object (e.g. the fast-forward check
while "git fetch" stores a new remote-tracking ref says "we know
there is no 'old' thing pointed at by the ref, as we are creating
it anew" by passing 0{40} for the 'old' side), and expect that a
codepath to locate an in-core object to return NULL as a sign that
the object does not exist.  A look-up for an object that does not
exist however is quite costly with a repository with large number
of packfiles.  This access pattern has been optimized.

* jk/fewer-pack-rescan:
  sha1_file: fast-path null sha1 as a missing object
  everything_local: use "quick" object existence check
  p5551: add a script to test fetch pack-dir rescans
  t/perf/lib-pack: use fast-import checkpoint to create packs
  p5550: factor out nonsense-pack creation
</content>
</entry>
<entry>
<title>introduce fetch-object: fetch one promisor object</title>
<updated>2017-12-05T17:46:05Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-12-05T16:58:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1'/>
<id>urn:sha1:88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1</id>
<content type='text'>
Introduce fetch-object, providing the ability to fetch one object from a
promisor remote.

This uses fetch-pack. To do this, the transport mechanism has been
updated with 2 flags, "from-promisor" to indicate that the resulting
pack comes from a promisor remote (and thus should be annotated as such
by index-pack), and "no-dependents" to indicate that only the objects
themselves need to be fetched (but fetching additional objects is
nevertheless safe).

Whenever "no-dependents" is used, fetch-pack will refrain from using any
object flags, because it is most likely invoked as part of a dynamic
object fetch by another Git command (which may itself use object flags).
An alternative to this is to leave fetch-pack alone, and instead update
the allocation of flags so that fetch-pack's flags never overlap with
any others, but this will end up shrinking the number of flags available
to nearly every other Git command (that is, every Git command that
accesses objects), so the approach in this commit was used instead.

This will be tested in a subsequent commit.

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>everything_local: use "quick" object existence check</title>
<updated>2017-11-21T02:30:41Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-11-20T20:29:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c291293b2ecec8ca77dfd218fa820dd7a0137a2b'/>
<id>urn:sha1:c291293b2ecec8ca77dfd218fa820dd7a0137a2b</id>
<content type='text'>
In b495697b82 (fetch-pack: avoid repeatedly re-scanning pack
directory, 2013-01-26), we noticed that everything_local()
could waste time trying to find and parse objects which we
_expect_ to be missing. The solution was to put
has_sha1_file() in front of parse_object() to skip the
more-expensive parse attempt.

That optimization was negated later when has_sha1_file()
learned to do the same re-scan in 45e8a74873 (has_sha1_file:
re-check pack directory before giving up, 2013-08-30).

We can restore it by using the "quick" flag to tell
has_sha1_file (actually has_object_file these days) that we
prefer speed to thoroughness for this call.  See also the
fixes in 5827a0354 and 0eeb077be7 for prior art and
discussion on using the "quick" flag for these cases.

The recently-added performance regression test in p5551
demonstrates the problem. You can see the original fix:

  Test            b495697b82^       b495697b82
  --------------------------------------------------------
  5551.4: fetch   1.68(1.33+0.35)   0.87(0.69+0.18) -48.2%

and then the regression:

  Test            45e8a74873^       45e8a74873
  ---------------------------------------------------------
  5551.4: fetch   0.96(0.77+0.19)   2.55(2.04+0.50) +165.6%

and now our fix:

  Test            HEAD^             HEAD
  --------------------------------------------------------
  5551.4: fetch   7.21(6.58+0.63)   5.47(5.04+0.43) -24.1%

You can also see that other things have gotten a lot slower
since 2013. We'll deal with those in separate patches.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
