<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-bitmap.c, branch v2.23.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.23.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.23.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-06-20T17:35:05Z</updated>
<entry>
<title>pack-bitmap: convert khash_sha1 maps into kh_oid_map</title>
<updated>2019-06-20T17:35:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-06-20T07:41:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2bc62b1fa7f2df247199ed88edff30875ee19bc'/>
<id>urn:sha1:d2bc62b1fa7f2df247199ed88edff30875ee19bc</id>
<content type='text'>
All of the users of our khash_sha1 maps actually have a "struct
object_id". Let's use the more descriptive type.

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>khash: drop broken oid_map typedef</title>
<updated>2019-06-20T17:21:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-06-20T07:41:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ed43d16d773ae5f717a258ce81a18ab3fb29435'/>
<id>urn:sha1:4ed43d16d773ae5f717a258ce81a18ab3fb29435</id>
<content type='text'>
Commit 5a8643eff1 (khash: move oid hash table definition, 2019-02-19)
added a khash "oid_map" type to match the existing "oid" type, which is
a simple set (i.e., just keys, no values). But in setting up the
khash_oid_map typedef, it accidentally referred to "kh_oid_t", which is
the set type.

Nobody noticed the breakage because there are not yet any callers; the
type was added just as a match to the existing sha1 types (whose map
type confusingly _is_ called khash_sha1, and it has no matching set
type).

We could easily fix this with s/oid/oid_map/ in the typedef. But let's
take this a step further, and just drop the typedef entirely.  These
typedefs were added by 5a8643eff1 to match the khash_sha1 typedefs. But
the actual khash-derived type names are descriptive enough; this is just
adding an extra layer of indirection. The khash names do not quite
follow our usual style (e.g., they end in "_t"), but since we end up
using other khash names (e.g., khiter_t, kh_get_oid()) anyway, just
typedef-ing the struct name is not really helping much.

And there are already many cases where we use the raw khash type names
anyway (e.g., the "set" variant defined just above us does not have such
a typedef!).

So let's drop this typedef, and the matching oid_pos one (which actually
_does_ have a user, but we can easily convert it).

We'll leave the khash_sha1 typedef around. The ultimate fate of its
callers should be conversion to kh_oid_map_t, so there's no point in
going through the noise of changing the names now.

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-objects: convert packlist_find() to use object_id</title>
<updated>2019-06-20T16:54:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-06-20T07:41:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3df28caefb2193fb7bbc87a427a620d96d508c8d'/>
<id>urn:sha1:3df28caefb2193fb7bbc87a427a620d96d508c8d</id>
<content type='text'>
We take a raw hash pointer, but most of our callers have a "struct
object_id" already. Let's switch to taking the full struct, which will
let us continue removing uses of raw sha1 buffers.

There are two callers that do need special attention:

  - in rebuild_existing_bitmaps(), we need to switch to
    nth_packed_object_oid(). This incurs an extra hash copy over
    pointing straight to the mmap'd sha1, but it shouldn't be measurable
    compared to the rest of the operation.

  - in can_reuse_delta() we already spent the effort to copy the sha1
    into a "struct object_id", but now we just have to do so a little
    earlier in the function (we can't easily convert that function's
    callers because they may be pointing at mmap'd REF_DELTA blocks).

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 '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>pack-revindex: open index if necessary</title>
<updated>2019-04-16T07:58:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-04-05T18:04:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4828ce9871fee0ea0309220c461fdedf255df931'/>
<id>urn:sha1:4828ce9871fee0ea0309220c461fdedf255df931</id>
<content type='text'>
We can't create a pack revindex if we haven't actually looked at the
index. Normally we would never get as far as creating a revindex without
having already been looking in the pack, so this code never bothered to
double-check that pack-&gt;index_data had been loaded.

But with the new multi-pack-index feature, many code paths might not
load the individual pack .idx at all (they'd find objects via the midx
and then open the .pack, but not its index).

This can't yet be triggered in practice, because a bug in the midx code
means we accidentally open up the individual .idx files anyway. But in
preparation for fixing that, let's have the revindex code check that
everything it needs has been loaded.

In most cases this will just be a quick noop. But note that this does
introduce a possibility of error (if we have to open the index and it's
corrupt), so load_pack_revindex() now returns a result code, and callers
need to handle the error.

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-bitmap: switch hash tables to use struct object_id</title>
<updated>2019-04-01T02:57:37Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:04:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c7714485dc8adc810b6c52058992cfc767dfcb5'/>
<id>urn:sha1:3c7714485dc8adc810b6c52058992cfc767dfcb5</id>
<content type='text'>
Instead of storing unsigned char pointers in the hash tables, switch to
storing instances of struct object_id. Update several internal functions
and one external function to take pointers to 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>pack-bitmap: switch hard-coded constants to the_hash_algo</title>
<updated>2019-04-01T02:57:37Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9941e920e0b5a79c5b7859cb59b9ab866a77b25f'/>
<id>urn:sha1:9941e920e0b5a79c5b7859cb59b9ab866a77b25f</id>
<content type='text'>
Switch two hard-coded uses of 20 to references 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>pack-bitmap: replace sha1_to_hex</title>
<updated>2019-04-01T02:57:37Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0dd4924891664e9e9970e427e84f902491fcd3d3'/>
<id>urn:sha1:0dd4924891664e9e9970e427e84f902491fcd3d3</id>
<content type='text'>
Replace the uses of sha1_to_hex in the pack bitmap code with hash_to_hex
to allow the use of SHA-256 as well.  Rename a few variables since they
are no longer limited to SHA-1.

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>pack-bitmap: convert struct stored_bitmap to object_id</title>
<updated>2019-04-01T02:57:37Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:04:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=53636539d37007099f14249a5dae4c05dc72ace4'/>
<id>urn:sha1:53636539d37007099f14249a5dae4c05dc72ace4</id>
<content type='text'>
Convert struct stored_bitmap 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>pack-bitmap: make bitmap header handling hash agnostic</title>
<updated>2019-04-01T02:57:37Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:04:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f4d6cada83dc6bd6b6b24dc0d2b3e6460c645cb'/>
<id>urn:sha1:0f4d6cada83dc6bd6b6b24dc0d2b3e6460c645cb</id>
<content type='text'>
Increase the checksum field in struct bitmap_disk_header to be
GIT_MAX_RAWSZ bytes in length and ensure that we hash the proper number
of bytes out when computing the bitmap checksum.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
