<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.c, 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-12-08T23:11:20Z</updated>
<entry>
<title>Merge branch 'rs/fetch-pack-invalid-lockfile'</title>
<updated>2020-12-08T23:11:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-08T23:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eae47db8657199518b0785db6d83cf9fec179b47'/>
<id>urn:sha1:eae47db8657199518b0785db6d83cf9fec179b47</id>
<content type='text'>
"fetch-pack" could pass NULL pointer to unlink(2) when it sees an
invalid filename; the error checking has been tightened to make
this impossible.

* rs/fetch-pack-invalid-lockfile:
  fetch-pack: disregard invalid pack lockfiles
</content>
</entry>
<entry>
<title>fetch-pack: disregard invalid pack lockfiles</title>
<updated>2020-11-30T22:35:00Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-11-30T19:27:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6031af387e7d0554d3202e0039d9d9af1691a6a4'/>
<id>urn:sha1:6031af387e7d0554d3202e0039d9d9af1691a6a4</id>
<content type='text'>
9da69a6539 (fetch-pack: support more than one pack lockfile, 2020-06-10)
started to use a string_list for pack lockfile names instead of a single
string pointer.  It removed a NULL check from transport_unlock_pack() as
well, which is the function that eventually deletes these lockfiles and
releases their name strings.

index_pack_lockfile() can return NULL if it doesn't like the contents it
reads from the file descriptor passed to it.  unlink(2) is declared to
not accept NULL pointers (at least with glibc).  Undefined Behavior
Sanitizer together with Address Sanitizer detects a case where a NULL
lockfile name is passed to unlink(2) by transport_unlock_pack() in t1060
(make SANITIZE=address,undefined; cd t; ./t1060-object-corruption.sh).

Reinstate the NULL check to avoid undefined behavior, but put it right
at the source, so that the number of items in the string_list reflects
the number of valid lockfiles.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Reviewed-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: advertise session ID in capabilities</title>
<updated>2020-11-12T02:26:53Z</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2020-11-11T23:29:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e905bbc008dfc3c0ffe14b55bd920e188e51b4e'/>
<id>urn:sha1:1e905bbc008dfc3c0ffe14b55bd920e188e51b4e</id>
<content type='text'>
When the server sent a session-id capability and transfer.advertiseSID
is true, advertise fetch-pack's own session ID back to the server.

Signed-off-by: Josh Steadmon &lt;steadmon@google.com&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>Merge branch 'jt/fetch-pack-loosen-validation-with-packfile-uri'</title>
<updated>2020-09-03T19:37:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-03T19:37:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bdccf5e086e5e45e5feccc22f9da0633c2492da1'/>
<id>urn:sha1:bdccf5e086e5e45e5feccc22f9da0633c2492da1</id>
<content type='text'>
Bugfix for "git fetch" when the packfile URI capability is in use.

* jt/fetch-pack-loosen-validation-with-packfile-uri:
  fetch-pack: make packfile URIs work with transfer.fsckobjects
  fetch-pack: document only_packfile in get_pack()
  (various): document from_promisor parameter
</content>
</entry>
<entry>
<title>fetch-pack: make packfile URIs work with transfer.fsckobjects</title>
<updated>2020-08-25T00:34:24Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-08-17T19:48:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0bd96bea2f9718d2ce03e0bc4bbf0b5894f9b28e'/>
<id>urn:sha1:0bd96bea2f9718d2ce03e0bc4bbf0b5894f9b28e</id>
<content type='text'>
When fetching with packfile URIs and 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. (A subsequent connectivity check will be done when
all the packs have been downloaded regardless of whether
transfer.fsckobjects is set.)

This is similar to 98a2ea46c2 ("fetch-pack: do not check links for
partial fetch", 2018-03-15), but for packfile URIs instead of partial
clones.

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: document only_packfile in get_pack()</title>
<updated>2020-08-25T00:31:09Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-08-17T19:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ece9aea2c139764a82f162697586bc738873fb2f'/>
<id>urn:sha1:ece9aea2c139764a82f162697586bc738873fb2f</id>
<content type='text'>
dd4b732df7 ("upload-pack: send part of packfile response as uri",
2020-06-10) added the "only_packfile" parameter to get_pack() but did
not document it. Add documentation.

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: in partial clone, pass --promisor</title>
<updated>2020-08-20T20:18:27Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-08-20T17:51:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b03df5f1e98b64b3bdc8a59c56697eaf675daca'/>
<id>urn:sha1:1b03df5f1e98b64b3bdc8a59c56697eaf675daca</id>
<content type='text'>
When fetching a pack from a promisor remote, the corresponding .promisor
file needs to be created. "fetch-pack" originally did this by passing
"--promisor" to "index-pack", but in 5374a290aa ("fetch-pack: write
fetched refs to .promisor", 2019-10-16), "fetch-pack" was taught to do
this itself instead, because it needed to store ref information in the
.promisor file.

This causes a problem with superprojects when transfer.fsckobjects is
set, because in the current implementation, it is "index-pack" that
calls fsck_finish() to check the objects; before 5374a290aa,
fsck_finish() would see that .gitmodules is a promisor object and
tolerate it being missing, but after, there is no .promisor file (at the
time of the invocation of fsck_finish() by "index-pack") to tell it that
.gitmodules is a promisor object, so it returns an error.

Therefore, teach "fetch-pack" to pass "--promisor" to index pack once
again. "fetch-pack" will subsequently overwrite this file with the ref
information.

An alternative is to instead move object checking to "fetch-pack", and
let "index-pack" only index the files. However, since "index-pack" has
to inflate objects in order to index them, it seems reasonable to also
let it check the objects (which also require inflated files).

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: do not lazy-fetch during ref iteration</title>
<updated>2020-08-18T20:25:05Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-08-18T04:01:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c3b801dab9d29c63c6c929405f808f064c11b77'/>
<id>urn:sha1:5c3b801dab9d29c63c6c929405f808f064c11b77</id>
<content type='text'>
In order to determine negotiation tips, "fetch-pack" iterates over all
refs and dereferences all annotated tags found. This causes the
existence of targets of refs and annotated tags to be checked. Avoiding
this is especially important when we use "git fetch" (which invokes
"fetch-pack") to perform lazy fetches in a partial clone because a
target of such a ref or annotated tag may need to be itself lazy-fetched
(and otherwise causing an infinite loop).

Therefore, teach "fetch-pack" not to lazy fetch whenever iterating over
refs. This is done by using the raw form of ref iteration and by
dereferencing tags ourselves.

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