<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/send-pack.c, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-02-07T06:05:27Z</updated>
<entry>
<title>Merge branch 'jk/loose-object-cache-oid'</title>
<updated>2019-02-07T06:05:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-02-07T06:05:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cba595ab1a7764aecfde2e8e59994f89b2cd2f2e'/>
<id>urn:sha1:cba595ab1a7764aecfde2e8e59994f89b2cd2f2e</id>
<content type='text'>
Code clean-up.

* jk/loose-object-cache-oid:
  prefer "hash mismatch" to "sha1 mismatch"
  sha1-file: avoid "sha1 file" for generic use in messages
  sha1-file: prefer "loose object file" to "sha1 file" in messages
  sha1-file: drop has_sha1_file()
  convert has_sha1_file() callers to has_object_file()
  sha1-file: convert pass-through functions to object_id
  sha1-file: modernize loose header/stream functions
  sha1-file: modernize loose object file functions
  http: use struct object_id instead of bare sha1
  update comment references to sha1_object_info()
  sha1-file: fix outdated sha1 comment references
</content>
</entry>
<entry>
<title>convert has_sha1_file() callers to has_object_file()</title>
<updated>2019-01-08T17:41:06Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-01-07T08:37:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98374a07c98d1acc200c423b87495365a59cce0b'/>
<id>urn:sha1:98374a07c98d1acc200c423b87495365a59cce0b</id>
<content type='text'>
The only remaining callers of has_sha1_file() actually have an object_id
already. They can use the "object" variant, rather than dereferencing
the hash themselves.

The code changes here were completely generated by the included
coccinelle patch.

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>pack-protocol.txt: accept error packets in any context</title>
<updated>2019-01-02T21:05:30Z</updated>
<author>
<name>Masaya Suzuki</name>
<email>masayasuzuki@google.com</email>
</author>
<published>2018-12-29T21:19:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d103c31c2cfcf03ff1408d639043469b0c93f70'/>
<id>urn:sha1:2d103c31c2cfcf03ff1408d639043469b0c93f70</id>
<content type='text'>
In the Git pack protocol definition, an error packet may appear only in
a certain context. However, servers can face a runtime error (e.g. I/O
error) at an arbitrary timing. This patch changes the protocol to allow
an error packet to be sent instead of any packet.

Without this protocol spec change, when a server cannot process a
request, there's no way to tell that to a client. Since the server
cannot produce a valid response, it would be forced to cut a connection
without telling why. With this protocol spec change, the server can be
more gentle in this situation. An old client may see these error packets
as an unexpected packet, but this is not worse than having an unexpected
EOF.

Following this protocol spec change, the error packet handling code is
moved to pkt-line.c. Implementation wise, this implementation uses
pkt-line to communicate with a subprocess. Since this is not a part of
Git protocol, it's possible that a packet that is not supposed to be an
error packet is mistakenly parsed as an error packet. This error packet
handling is enabled only for the Git pack protocol parsing code
considering this.

Signed-off-by: Masaya Suzuki &lt;masayasuzuki@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Use packet_reader instead of packet_read_line</title>
<updated>2019-01-02T21:05:27Z</updated>
<author>
<name>Masaya Suzuki</name>
<email>masayasuzuki@google.com</email>
</author>
<published>2018-12-29T21:19:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=01f9ec64c8a82a05ba7e5a17b292ede037a469ea'/>
<id>urn:sha1:01f9ec64c8a82a05ba7e5a17b292ede037a469ea</id>
<content type='text'>
By using and sharing a packet_reader while handling a Git pack protocol
request, the same reader option is used throughout the code. This makes
it easy to set a reader option to the request parsing code.

Signed-off-by: Masaya Suzuki &lt;masayasuzuki@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c</title>
<updated>2018-11-05T04:42:11Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-03T08:48:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab'/>
<id>urn:sha1:c0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab</id>
<content type='text'>
On systems that do not support multithread, start_async() is
implemented with fork(). This implementation details unfortunately
leak out at least in send-pack.c [1].

To keep the code base clean of NO_PTHREADS, move the this #ifdef back
to run-command.c. The new wrapper function async_with_fork() at least
helps suggest that this special "close()" is related to async in fork
mode.

[1] 09c9957cf7 (send-pack: avoid deadlock when pack-object dies early
    - 2011-04-25)

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>shallow: add repository argument to is_repository_shallow</title>
<updated>2018-05-17T23:13:10Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-05-17T22:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c88134870e8b2da084e37fb86ff88fb7d7617d61'/>
<id>urn:sha1:c88134870e8b2da084e37fb86ff88fb7d7617d61</id>
<content type='text'>
Add a repository argument to allow callers of is_repository_shallow
to be more specific about which repository to handle. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.

As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-store: move object access functions to object-store.h</title>
<updated>2018-05-16T02:42:03Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-05-15T23:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbd53a2193d11e83b5bad2c3514bd1603074bc36'/>
<id>urn:sha1:cbd53a2193d11e83b5bad2c3514bd1603074bc36</id>
<content type='text'>
This should make these functions easier to find and cache.h less
overwhelming to read.

In particular, this moves:
- read_object_file
- oid_object_info
- write_object_file

As a result, most of the codebase needs to #include object-store.h.
In this patch the #include is only added to files that would fail to
compile otherwise.  It would be better to #include wherever
identifiers from the header are used.  That can happen later
when we have better tooling for it.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-pack: convert remaining functions to struct object_id</title>
<updated>2018-03-14T16:23:48Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-03-12T02:27:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=246d7400fbe737c49efa0a42527f08317ab52b3f'/>
<id>urn:sha1:246d7400fbe737c49efa0a42527f08317ab52b3f</id>
<content type='text'>
Convert the remaining function, feed_object, to use struct object_id.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>always check for NULL return from packet_read_line()</title>
<updated>2018-02-08T20:37:40Z</updated>
<author>
<name>Jon Simons</name>
<email>jon@jonsimons.org</email>
</author>
<published>2018-02-08T18:47:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bb1356dc643e1488ccc1924ab674f6cbbe615f74'/>
<id>urn:sha1:bb1356dc643e1488ccc1924ab674f6cbbe615f74</id>
<content type='text'>
The packet_read_line() function will die if it sees any
protocol or socket errors. But it will return NULL for a
flush packet; some callers which are not expecting this may
dereference NULL if they get an unexpected flush. This would
involve the other side breaking protocol, but we should
flag the error rather than segfault.

Signed-off-by: Jon Simons &lt;jon@jonsimons.org&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-pack: use internal argv_array of struct child_process</title>
<updated>2017-12-22T21:33:53Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-12-22T08:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a923e05944271e2aa887721a1d2f24bb418eeca7'/>
<id>urn:sha1:a923e05944271e2aa887721a1d2f24bb418eeca7</id>
<content type='text'>
Avoid a magic number of NULL placeholder values and a magic index by
constructing the command line for pack-objects using the embedded
argv_array of the child_process.  The resulting code is shorter and
easier to extend.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
