<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.c, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-05-05T01:41:29Z</updated>
<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>fetch-pack: refactor command and capability write</title>
<updated>2021-04-09T04:50:22Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-04-09T01:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6871d0cec62dc12d0c5f7390eee8a80614919578'/>
<id>urn:sha1:6871d0cec62dc12d0c5f7390eee8a80614919578</id>
<content type='text'>
A subsequent commit will need this functionality independent of the rest
of send_fetch_request(), so put this into its own function.

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: refactor add_haves()</title>
<updated>2021-04-09T04:50:21Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-04-09T01:10:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=57c3451b2e36d003aa7fc398c644ce71ab668b5e'/>
<id>urn:sha1:57c3451b2e36d003aa7fc398c644ce71ab668b5e</id>
<content type='text'>
A subsequent commit will need part, but not all, of the functionality in
add_haves(), so move some of its functionality to its sole caller
send_fetch_request().

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: refactor process_acks()</title>
<updated>2021-04-09T04:50:21Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-04-09T01:09:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8102570374a87c032bff2d7114c67390f55f9a1b'/>
<id>urn:sha1:8102570374a87c032bff2d7114c67390f55f9a1b</id>
<content type='text'>
A subsequent commit will need part, but not all, of the functionality in
process_acks(), so move some of its functionality to its sole caller
do_fetch_pack_v2(). As a side effect, the resulting code is also
shorter.

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-pack-request-fix' into jt/push-negotiation</title>
<updated>2021-04-09T04:50:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-09T04:50:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6db01a73085b8f34d958dd537bbca82a39187885'/>
<id>urn:sha1:6db01a73085b8f34d958dd537bbca82a39187885</id>
<content type='text'>
* jt/fetch-pack-request-fix:
  fetch-pack: buffer object-format with other args
</content>
</entry>
<entry>
<title>fetch-pack: buffer object-format with other args</title>
<updated>2021-04-09T04:49:47Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-04-09T01:09:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=81ed96a9b2c5ad8a3b1ea04fd6cd273557b76c58'/>
<id>urn:sha1:81ed96a9b2c5ad8a3b1ea04fd6cd273557b76c58</id>
<content type='text'>
In send_fetch_request(), "object-format" is written directly to the file
descriptor, as opposed to the other arguments, which are buffered.
Buffer "object-format" as well. "object-format" must be buffered; in
particular, it must appear after "command=fetch" in the request.

This divergence was introduced in 4b831208bb ("fetch-pack: parse and
advertise the object-format capability", 2020-05-27), perhaps as an
oversight (the surrounding code at the point of this commit has already
been using a request buffer.)

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 'll/clone-reject-shallow'</title>
<updated>2021-04-08T20:23:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-08T20:23:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=22eee7f4554e777de93134c0ae06ee611bd570a4'/>
<id>urn:sha1:22eee7f4554e777de93134c0ae06ee611bd570a4</id>
<content type='text'>
"git clone --reject-shallow" option fails the clone as soon as we
notice that we are cloning from a shallow repository.

* ll/clone-reject-shallow:
  builtin/clone.c: add --reject-shallow option
</content>
</entry>
<entry>
<title>Merge branch 'ab/fsck-api-cleanup'</title>
<updated>2021-04-07T23:54:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-07T23:54:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5644419d04a6bb25c36c965acf0da0e700f1bd3f'/>
<id>urn:sha1:5644419d04a6bb25c36c965acf0da0e700f1bd3f</id>
<content type='text'>
Fsck API clean-up.

* ab/fsck-api-cleanup:
  fetch-pack: use new fsck API to printing dangling submodules
  fetch-pack: use file-scope static struct for fsck_options
  fetch-pack: don't needlessly copy fsck_options
  fsck.c: move gitmodules_{found,done} into fsck_options
  fsck.c: add an fsck_set_msg_type() API that takes enums
  fsck.c: pass along the fsck_msg_id in the fsck_error callback
  fsck.[ch]: move FOREACH_FSCK_MSG_ID &amp; fsck_msg_id from *.c to *.h
  fsck.c: give "FOREACH_MSG_ID" a more specific name
  fsck.c: undefine temporary STR macro after use
  fsck.c: call parse_msg_type() early in fsck_set_msg_type()
  fsck.h: re-order and re-assign "enum fsck_msg_type"
  fsck.h: move FSCK_{FATAL,INFO,ERROR,WARN,IGNORE} into an enum
  fsck.c: refactor fsck_msg_type() to limit scope of "int msg_type"
  fsck.c: rename remaining fsck_msg_id "id" to "msg_id"
  fsck.c: remove (mostly) redundant append_msg_id() function
  fsck.c: rename variables in fsck_set_msg_type() for less confusion
  fsck.h: use "enum object_type" instead of "int"
  fsck.h: use designed initializers for FSCK_OPTIONS_{DEFAULT,STRICT}
  fsck.c: refactor and rename common config callback
</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>fetch-pack: use new fsck API to printing dangling submodules</title>
<updated>2021-03-29T02:03:10Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-03-28T13:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3745e2693de3dd5420221782ed050cae6ebf6fec'/>
<id>urn:sha1:3745e2693de3dd5420221782ed050cae6ebf6fec</id>
<content type='text'>
Refactor the check added in 5476e1efde (fetch-pack: print and use
dangling .gitmodules, 2021-02-22) to make use of us now passing the
"msg_id" to the user defined "error_func". We can now compare against
the FSCK_MSG_GITMODULES_MISSING instead of parsing the generated
message.

Let's also replace register_found_gitmodules() with directly
manipulating the "gitmodules_found" member. A recent commit moved it
into "fsck_options" so we could do this here.

I'm sticking this callback in fsck.c. Perhaps in the future we'd like
to accumulate such callbacks into another file (maybe fsck-cb.c,
similar to parse-options-cb.c?), but while we've got just the one
let's just put it into fsck.c.

A better alternative in this case would be some library some more
obvious library shared by fetch-pack.c ad builtin/index-pack.c, but
there isn't such a thing.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
