<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http.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-05-08T03:15:25Z</updated>
<entry>
<title>Make fread/fwrite-like functions in http.c more like fread/fwrite.</title>
<updated>2019-05-08T03:15:25Z</updated>
<author>
<name>Mike Hommey</name>
<email>mh@glandium.org</email>
</author>
<published>2019-05-07T23:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c3d5a38231c2c8c5414232cfbb662b6610662b1'/>
<id>urn:sha1:5c3d5a38231c2c8c5414232cfbb662b6610662b1</id>
<content type='text'>
The fread/fwrite-like functions in http.c, namely fread_buffer,
fwrite_buffer, fwrite_null, fwrite_sha1_file all return the
multiplication of the size and number of items they are being given.

Practically speaking, it doesn't matter, because in all contexts where
those functions are used, size is 1.

But those functions being similar to fread and fwrite (the curl API is
designed around being able to use fread and fwrite directly), it might
be preferable to make them behave like fread and fwrite, which, from
the fread/fwrite manual page, is:
   On  success, fread() and fwrite() return the number of items read
   or written.  This number equals the number of bytes transferred
   only when size is 1.  If an error occurs, or the end of the file
   is reached, the return value is a short item count (or zero).

Signed-off-by: Mike Hommey &lt;mh@glandium.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/hash-transition-16'</title>
<updated>2019-04-25T07:41:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-04-25T07:41:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d4e568b2a31d7b2fe45dac9165bb077b570fc96a'/>
<id>urn:sha1:d4e568b2a31d7b2fe45dac9165bb077b570fc96a</id>
<content type='text'>
Conversion from unsigned char[20] to struct object_id continues.

* bc/hash-transition-16: (35 commits)
  gitweb: make hash size independent
  Git.pm: make hash size independent
  read-cache: read data in a hash-independent way
  dir: make untracked cache extension hash size independent
  builtin/difftool: use parse_oid_hex
  refspec: make hash size independent
  archive: convert struct archiver_args to object_id
  builtin/get-tar-commit-id: make hash size independent
  get-tar-commit-id: parse comment record
  hash: add a function to lookup hash algorithm by length
  remote-curl: make hash size independent
  http: replace sha1_to_hex
  http: compute hash of downloaded objects using the_hash_algo
  http: replace hard-coded constant with the_hash_algo
  http-walker: replace sha1_to_hex
  http-push: remove remaining uses of sha1_to_hex
  http-backend: allow 64-character hex names
  http-push: convert to use the_hash_algo
  builtin/pull: make hash-size independent
  builtin/am: make hash size independent
  ...
</content>
</entry>
<entry>
<title>Merge branch 'jk/server-info-rabbit-hole'</title>
<updated>2019-04-25T07:41:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-04-25T07:41:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=776f3e1fb73a6440804aa3dde4ffd3b6bdf60a19'/>
<id>urn:sha1:776f3e1fb73a6440804aa3dde4ffd3b6bdf60a19</id>
<content type='text'>
Code clean-up around a much-less-important-than-it-used-to-be
update_server_info() funtion.

* jk/server-info-rabbit-hole:
  update_info_refs(): drop unused force parameter
  server-info: drop objdirlen pointer arithmetic
  server-info: drop nr_alloc struct member
  server-info: use strbuf to read old info/packs file
  server-info: simplify cleanup in parse_pack_def()
  server-info: fix blind pointer arithmetic
  http: simplify parsing of remote objects/info/packs
  packfile: fix pack basename computation
  midx: check both pack and index names for containment
  t5319: drop useless --buffer from cat-file
  t5319: fix bogus cat-file argument
  pack-revindex: open index if necessary
  packfile.h: drop extern from function declarations
</content>
</entry>
<entry>
<title>http: simplify parsing of remote objects/info/packs</title>
<updated>2019-04-16T07:58:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-04-05T18:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ddc56d4710fa004c922349407f3de0c3adf90ac9'/>
<id>urn:sha1:ddc56d4710fa004c922349407f3de0c3adf90ac9</id>
<content type='text'>
We can use skip_prefix() and parse_oid_hex() to continuously increment
our pointer, rather than dealing with magic numbers. This also fixes a
few small shortcomings:

  - if we see a line with the right prefix, suffix, and length, i.e.
    matching /P pack-.{40}.pack\n/, we'll interpret the middle part as
    hex without checking if it could be parsed. This could lead to us
    looking at uninitialized garbage in the hash array. In practice this
    means we'll just make a garbage request to the server which will
    fail, though it's interesting that a malicious server could convince
    us to leak 40 bytes of uninitialized stack to them.

  - the current code is picky about seeing a newline at the end of file,
    but we can easily be more liberal

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>http: replace sha1_to_hex</title>
<updated>2019-04-01T02:57:39Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=05dfc7cac4a0e0dcd6c7b2f63009c03f96dba1c0'/>
<id>urn:sha1:05dfc7cac4a0e0dcd6c7b2f63009c03f96dba1c0</id>
<content type='text'>
Since sha1_to_hex is limited to SHA-1, replace it with hash_to_hex.

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>http: compute hash of downloaded objects using the_hash_algo</title>
<updated>2019-04-01T02:57:38Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:05:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eed0e60f02bea5cc87830c203de86207c43cc57c'/>
<id>urn:sha1:eed0e60f02bea5cc87830c203de86207c43cc57c</id>
<content type='text'>
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>http: replace hard-coded constant with the_hash_algo</title>
<updated>2019-04-01T02:57:38Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:05:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae041a0f9a8f5bd236441a9384a0119cd5a8f791'/>
<id>urn:sha1:ae041a0f9a8f5bd236441a9384a0119cd5a8f791</id>
<content type='text'>
Replace a hard-coded 40 with a reference to the_hash_algo.

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>object-store: rename and expand packed_git's sha1 member</title>
<updated>2019-04-01T02:57:38Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:05:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=538b1523246ba0845564a6b703c6e4ff1921c16a'/>
<id>urn:sha1:538b1523246ba0845564a6b703c6e4ff1921c16a</id>
<content type='text'>
This member is used to represent the pack checksum of the pack in
question.  Expand this member to be GIT_MAX_RAWSZ bytes in length so it
works with longer hashes and rename it to be "hash" instead of "sha1".
This transformation was made with a change to the definition and the
following semantic patch:

@@
struct packed_git *E1;
@@
- E1-&gt;sha1
+ E1-&gt;hash

@@
struct packed_git E1;
@@
- E1.sha1
+ E1.hash

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>http: factor out curl result code normalization</title>
<updated>2019-03-24T12:22:40Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-03-24T12:08:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a3722bcbbd850bf02aea19d58de112ef513cb2f1'/>
<id>urn:sha1:a3722bcbbd850bf02aea19d58de112ef513cb2f1</id>
<content type='text'>
We make some requests with CURLOPT_FAILONERROR and some without, and
then handle_curl_result() normalizes any failures to a uniform CURLcode.

There are some other code paths in the dumb-http walker which don't use
handle_curl_result(); let's pull the normalization into its own function
so it can be reused.

Arguably those code paths would benefit from the rest of
handle_curl_result(), notably the auth handling. But retro-fitting it
now would be a lot of work, and in practice it doesn't matter too much
(whatever authentication we needed to make the initial contact with the
server is generally sufficient for the rest of the dumb-http requests).

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>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>
</feed>
