<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-write.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-04-08T20:23:25Z</updated>
<entry>
<title>Merge branch 'tb/reverse-midx'</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=e6b971fcf5d85db821636f2d887cfaf204b32bda'/>
<id>urn:sha1:e6b971fcf5d85db821636f2d887cfaf204b32bda</id>
<content type='text'>
An on-disk reverse-index to map the in-pack location of an object
back to its object name across multiple packfiles is introduced.

* tb/reverse-midx:
  midx.c: improve cache locality in midx_pack_order_cmp()
  pack-revindex: write multi-pack reverse indexes
  pack-write.c: extract 'write_rev_file_order'
  pack-revindex: read multi-pack reverse indexes
  Documentation/technical: describe multi-pack reverse indexes
  midx: make some functions non-static
  midx: keep track of the checksum
  midx: don't free midx_name early
  midx: allow marking a pack as preferred
  t/helper/test-read-midx.c: add '--show-objects'
  builtin/multi-pack-index.c: display usage on unrecognized command
  builtin/multi-pack-index.c: don't enter bogus cmd_mode
  builtin/multi-pack-index.c: split sub-commands
  builtin/multi-pack-index.c: define common usage with a macro
  builtin/multi-pack-index.c: don't handle 'progress' separately
  builtin/multi-pack-index.c: inline 'flags' with options
</content>
</entry>
<entry>
<title>pack-write.c: extract 'write_rev_file_order'</title>
<updated>2021-04-01T20:07:37Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2021-03-30T15:04:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a587b5a7869e9a399d4de6edea0b3f32a3548639'/>
<id>urn:sha1:a587b5a7869e9a399d4de6edea0b3f32a3548639</id>
<content type='text'>
Existing callers provide the reverse index code with an array of 'struct
pack_idx_entry *'s, which is then sorted by pack order (comparing the
offsets of each object within the pack).

Prepare for the multi-pack index to write a .rev file by providing a way
to write the reverse index without an array of pack_idx_entry (which the
MIDX code does not have).

Instead, callers can invoke 'write_rev_index_positions()', which takes
an array of uint32_t's. The ith entry in this array specifies the ith
object's (in index order) position within the pack (in pack order).

Expose this new function for use in a later patch, and rewrite the
existing write_rev_file() in terms of this new function.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/transfer-fsck-across-packs'</title>
<updated>2021-03-01T22:02:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-03-01T22:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6ee353d42f389ec9454161b64ffbeb4167edebaa'/>
<id>urn:sha1:6ee353d42f389ec9454161b64ffbeb4167edebaa</id>
<content type='text'>
The approach to "fsck" the incoming objects in "index-pack" is
attractive for performance reasons (we have them already in core,
inflated and ready to be inspected), but fundamentally cannot be
applied fully when we receive more than one pack stream, as a tree
object in one pack may refer to a blob object in another pack as
".gitmodules", when we want to inspect blobs that are used as
".gitmodules" file, for example.  Teach "index-pack" to emit
objects that must be inspected later and check them in the calling
"fetch-pack" process.

* jt/transfer-fsck-across-packs:
  fetch-pack: print and use dangling .gitmodules
  fetch-pack: with packfile URIs, use index-pack arg
  http-fetch: allow custom index-pack args
  http: allow custom index-pack args
</content>
</entry>
<entry>
<title>fetch-pack: print and use dangling .gitmodules</title>
<updated>2021-02-22T20:07:40Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-02-22T19:20:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5476e1efded571e374cd97c7d69f17962ba1c44f'/>
<id>urn:sha1:5476e1efded571e374cd97c7d69f17962ba1c44f</id>
<content type='text'>
Teach index-pack to print dangling .gitmodules links after its "keep" or
"pack" line instead of declaring an error, and teach fetch-pack to check
such lines printed.

This allows the tree side of the .gitmodules link to be in one packfile
and the blob side to be in another without failing the fsck check,
because it is now fetch-pack which checks such objects after all
packfiles have been downloaded and indexed (and not index-pack on an
individual packfile, as it is before this commit).

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>pack-write.c: prepare to write 'pack-*.rev' files</title>
<updated>2021-01-26T02:32:43Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2021-01-25T23:37:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ef50d9958f7be21e38026433d30f72521b4de47'/>
<id>urn:sha1:8ef50d9958f7be21e38026433d30f72521b4de47</id>
<content type='text'>
This patch prepares for callers to be able to write reverse index files
to disk.

It adds the necessary machinery to write a format-compliant .rev file
from within 'write_rev_file()', which is called from
'finish_tmp_packfile()'.

Similar to the process by which the reverse index is computed in memory,
these new paths also have to sort a list of objects by their offsets
within a packfile. These new paths use a qsort() (as opposed to a radix
sort), since our specialized radix sort requires a full revindex_entry
struct per object, which is more memory than we need to allocate.

The qsort is obviously slower, but the theoretical slowdown would
require a repository with a large amount of objects, likely implying
that the time spent in, say, pack-objects during a repack would dominate
the overall runtime.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-write: die on error in write_promisor_file()</title>
<updated>2021-01-15T01:02:22Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2021-01-14T15:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c99bc23fcd69eeebf8a92263b5d90673c510a6a'/>
<id>urn:sha1:7c99bc23fcd69eeebf8a92263b5d90673c510a6a</id>
<content type='text'>
write_promisor_file() already uses xfopen(), so it would die
if the file cannot be opened for writing. To be consistent
with this behavior and not overlook issues, let's also die if
there are errors when we are actually writing to the file.

Suggested-by: Jeff King &lt;peff@peff.net&gt;
Suggested-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: refactor writing promisor file</title>
<updated>2021-01-13T00:01:07Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2021-01-12T08:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33add2ad7d6921489aa0cafd4a865504c3709512'/>
<id>urn:sha1:33add2ad7d6921489aa0cafd4a865504c3709512</id>
<content type='text'>
Let's replace the 2 different pieces of code that write a
promisor file in 'builtin/repack.c' and 'fetch-pack.c'
with a new function called 'write_promisor_file()' in
'pack-write.c' and 'pack.h'.

This might also help us in the future, if we want to put
back the ref names and associated hashes that were in
the promisor files we are repacking in 'builtin/repack.c'
as suggested by a NEEDSWORK comment just above the code
we are refactoring.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/hashwrite-be64'</title>
<updated>2020-11-25T23:24:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-25T23:24:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=455e8d18f81583d0270685edc6ec2ed201fc984c'/>
<id>urn:sha1:455e8d18f81583d0270685edc6ec2ed201fc984c</id>
<content type='text'>
Code simplification.

* rs/hashwrite-be64:
  pack-write: use hashwrite_be64()
  midx: use hashwrite_be64()
  csum-file: add hashwrite_be64()
</content>
</entry>
<entry>
<title>pack-write: use hashwrite_be64()</title>
<updated>2020-11-12T17:40:10Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-11-12T12:23:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=970909c2a7803564f82ab1d3660d77ad6a44b68f'/>
<id>urn:sha1:970909c2a7803564f82ab1d3660d77ad6a44b68f</id>
<content type='text'>
Call hashwrite_be64() to write a 64-bit value instead of open-coding it
using htonl() and hashwrite().  This shortens the code, gets rid of a
buffer and several magic numbers, and makes the intent clearer.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-write: use hashwrite_be32() instead of double-buffering array</title>
<updated>2020-11-01T23:52:51Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-11-01T08:52:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06d43fad18a2bb85b1a224b07c4cc572c7e41f7e'/>
<id>urn:sha1:06d43fad18a2bb85b1a224b07c4cc572c7e41f7e</id>
<content type='text'>
hashwrite() already buffers writes, so pass the fanout table entries
individually via hashwrite_be32(), which also does the endianess
conversion for us.  This avoids a memory copy, shortens the code and
reduces the number of magic numbers.

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