<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-write.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-12-15T00:09:38Z</updated>
<entry>
<title>git: remove duplicate includes</title>
<updated>2022-12-15T00:09:38Z</updated>
<author>
<name>Seija Kijin</name>
<email>doremylover123@gmail.com</email>
</author>
<published>2022-12-14T16:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92cb135855b71333a77aabe7b5364189c66bf07b'/>
<id>urn:sha1:92cb135855b71333a77aabe7b5364189c66bf07b</id>
<content type='text'>
These files are already included; we do not need to include them again

Signed-off-by: Seija Kijin &lt;doremylover123@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-write: drop always-NULL parameter</title>
<updated>2022-06-16T18:59:55Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-06-16T13:13:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82db195e1be63cfa274c26351ef782b2df0a21fd'/>
<id>urn:sha1:82db195e1be63cfa274c26351ef782b2df0a21fd</id>
<content type='text'>
write_mtimes_file() takes an mtimes parameter as its first option, but
the only caller passes a NULL constant. Drop this parameter to simplify
logic. This can be reverted if that parameter is needed in the future.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-mtimes: support writing pack .mtimes files</title>
<updated>2022-05-26T22:48:26Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-05-20T23:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5dfaf49a5a651d3e8c3552bc2e833312a3671a4f'/>
<id>urn:sha1:5dfaf49a5a651d3e8c3552bc2e833312a3671a4f</id>
<content type='text'>
Now that the `.mtimes` format is defined, supplement the pack-write API
to be able to conditionally write an `.mtimes` file along with a pack by
setting an additional flag and passing an oidmap that contains the
timestamps corresponding to each object in the pack.

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>chunk-format.h: extract oid_version()</title>
<updated>2022-05-26T22:48:26Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-05-20T23:17:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9fef9d90d27b6794350ec3bc622042b79397088'/>
<id>urn:sha1:d9fef9d90d27b6794350ec3bc622042b79397088</id>
<content type='text'>
There are three definitions of an identical function which converts
`the_hash_algo` into either 1 (for SHA-1) or 2 (for SHA-256). There is a
copy of this function for writing both the commit-graph and
multi-pack-index file, and another inline definition used to write the
.rev header.

Consolidate these into a single definition in chunk-format.h. It's not
clear that this is the best header to define this function in, but it
should do for now.

(Worth noting, the .rev caller expects a 4-byte unsigned, but the other
two callers work with a single unsigned byte. The consolidated version
uses the latter type, and lets the compiler widen it when required).

Another caller will be added in a subsequent patch.

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: pass 'struct packing_data' to 'stage_tmp_packfiles'</title>
<updated>2022-05-26T22:48:26Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-05-20T23:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1c573cdd7219db5600fb2b5249f7c8835c8d416d'/>
<id>urn:sha1:1c573cdd7219db5600fb2b5249f7c8835c8d416d</id>
<content type='text'>
This structure will be used to communicate the per-object mtimes when
writing a cruft pack. Here, we need the full packing_data structure
because the mtime information is stored in an array there, not on the
individual object_entry's themselves (to avoid paying the overhead in
structure width for operations which do not generate a cruft pack).

We haven't passed this information down before because one of the two
callers (in bulk-checkin.c) does not have a packing_data structure at
all. In that case (where no cruft pack will be generated), NULL is
passed instead.

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>core.fsync: introduce granular fsync control infrastructure</title>
<updated>2022-03-10T23:10:22Z</updated>
<author>
<name>Neeraj Singh</name>
<email>neerajsi@microsoft.com</email>
</author>
<published>2022-03-10T22:43:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=020406eaa52e67440d9b78087ec2ce25532cb219'/>
<id>urn:sha1:020406eaa52e67440d9b78087ec2ce25532cb219</id>
<content type='text'>
This commit introduces the infrastructure for the core.fsync
configuration knob. The repository components we want to sync
are identified by flags so that we can turn on or off syncing
for specific components.

If core.fsyncObjectFiles is set and the core.fsync configuration
also includes FSYNC_COMPONENT_LOOSE_OBJECT, we will fsync any
loose objects. This picks the strictest data integrity behavior
if core.fsync and core.fsyncObjectFiles are set to conflicting values.

This change introduces the currently unused fsync_component
helper, which will be used by a later patch that adds fsyncing to
the refs backend.

Actual configuration and documentation of the fsync components
list are in other patches in the series to separate review of
the underlying mechanism from the policy of how it's configured.

Helped-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Neeraj Singh &lt;neerajsi@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/pack-finalize-ordering'</title>
<updated>2021-09-20T22:20:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-20T22:20:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a1af5333234b42e9e44729280a0e92b989bd865d'/>
<id>urn:sha1:a1af5333234b42e9e44729280a0e92b989bd865d</id>
<content type='text'>
The order in which various files that make up a single (conceptual)
packfile has been reevaluated and straightened up.  This matters in
correctness, as an incomplete set of files must not be shown to a
running Git.

* tb/pack-finalize-ordering:
  pack-objects: rename .idx files into place after .bitmap files
  pack-write: split up finish_tmp_packfile() function
  builtin/index-pack.c: move `.idx` files into place last
  index-pack: refactor renaming in final()
  builtin/repack.c: move `.idx` files into place last
  pack-write.c: rename `.idx` files after `*.rev`
  pack-write: refactor renaming in finish_tmp_packfile()
  bulk-checkin.c: store checksum directly
  pack.h: line-wrap the definition of finish_tmp_packfile()
</content>
</entry>
<entry>
<title>Merge branch 'ab/reverse-midx-optim'</title>
<updated>2021-09-15T20:15:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-15T20:15:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ea5e46cb96d17c3b3927b4eff9765183cf87f8d'/>
<id>urn:sha1:1ea5e46cb96d17c3b3927b4eff9765183cf87f8d</id>
<content type='text'>
The code that optionally creates the *.rev reverse index file has
been optimized to avoid needless computation when it is not writing
the file out.

* ab/reverse-midx-optim:
  pack-write: skip *.rev work when not writing *.rev
</content>
</entry>
<entry>
<title>pack-write: split up finish_tmp_packfile() function</title>
<updated>2021-09-10T01:23:11Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-09-09T23:24:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ec02dd5a8261bc837b961ef36788081ded5c2bc'/>
<id>urn:sha1:2ec02dd5a8261bc837b961ef36788081ded5c2bc</id>
<content type='text'>
Split up the finish_tmp_packfile() function and use the split-up version
in pack-objects.c in preparation for moving the step of renaming the
*.idx file later as part of a function change.

Since the only other caller of finish_tmp_packfile() was in
bulk-checkin.c, and it won't be needing a change to its *.idx renaming,
provide a thin wrapper for the old function as a static function in that
file. If other callers end up needing the simpler version it could be
moved back to "pack-write.c" and "pack.h".

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
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.c: rename `.idx` files after `*.rev`</title>
<updated>2021-09-10T01:23:11Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2021-09-09T23:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16a86907bca0ae7ed9f1dfaa6261234215151396'/>
<id>urn:sha1:16a86907bca0ae7ed9f1dfaa6261234215151396</id>
<content type='text'>
We treat the presence of an `.idx` file as the indicator of whether or
not it's safe to use a packfile. But `finish_tmp_packfile()` (which is
responsible for writing the pack and moving the temporary versions of
all of its auxiliary files into place) is inconsistent about the write
order.

Specifically, it moves the `.rev` file into place after the `.idx`,
leaving open the possibility to open a pack which looks "ready" (because
the `.idx` file exists and is readable) but appears momentarily to not
have a `.rev` file. This causes Git to fall back to generating the
pack's reverse index in memory.

Though racy, this amounts to an unnecessary slow-down at worst, and
doesn't affect the correctness of the resulting reverse index.

Close this race by moving the .rev file into place before moving the
.idx file into place.

This still leaves the issue of `.idx` files being renamed into place
before the auxiliary `.bitmap` file is renamed when in pack-object.c's
write_pack_file() "write_bitmap_index" is true. That race will be
addressed in subsequent commits.

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