<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/object-file.c, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-05-12T22:42:26Z</updated>
<entry>
<title>object-file: fix a unpack_loose_header() regression in 3b6a8db3b03</title>
<updated>2022-05-12T22:42:26Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-05-12T22:32:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4627c67fa68d5669be511962a6437a11c0db3c99'/>
<id>urn:sha1:4627c67fa68d5669be511962a6437a11c0db3c99</id>
<content type='text'>
Fix a regression in my 3b6a8db3b03 (object-file.c: use "enum" return
type for unpack_loose_header(), 2021-10-01) revealed both by running
the test suite with --valgrind, and with the amended "git fsck" test.

In practice this regression in v2.34.0 caused us to claim that we
couldn't parse the header, as opposed to not being able to unpack
it. Before the change in the C code the test_cmp added here would emit:

	-error: unable to unpack header of ./objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
	+error: unable to parse header of ./objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391

I.e. we'd proceed to call parse_loose_header() on the uninitialized
"hdr" value, and it would have been very unlikely for that
uninitialized memory to be a valid git object.

The other callers of unpack_loose_header() were already checking the
enum values exhaustively. See 3b6a8db3b03 and
5848fb11acd (object-file.c: return ULHR_TOO_LONG on "header too long",
2021-10-01).

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-file: pass filename to fsync_or_die</title>
<updated>2022-03-30T21:46:47Z</updated>
<author>
<name>Neeraj Singh</name>
<email>neerajsi@microsoft.com</email>
</author>
<published>2022-03-30T18:14:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c4e707f858813c097bd8b488baae07096aa280ad'/>
<id>urn:sha1:c4e707f858813c097bd8b488baae07096aa280ad</id>
<content type='text'>
If we die while trying to fsync a loose object file, pass the actual
filename we're trying to sync. This is likely to be more helpful for a
user trying to diagnose the cause of the failure than the former
'loose object file' string. It also sidesteps any concerns about
translating the die message differently for loose objects versus
something else that has a real path.

Reported-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&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 'ab/refs-various-fixes'</title>
<updated>2022-03-29T19:22:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-29T19:22:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d8046a820851621b8f195078fcac5b5c38fec86'/>
<id>urn:sha1:3d8046a820851621b8f195078fcac5b5c38fec86</id>
<content type='text'>
Code clean-up.

* ab/refs-various-fixes:
  refs debug: add a wrapper for "read_symbolic_ref"
  packed-backend: remove stub BUG(...) functions
  misc *.c: use designated initializers for struct assignments
  refs: use designated initializers for "struct ref_iterator_vtable"
  refs: use designated initializers for "struct ref_storage_be"
</content>
</entry>
<entry>
<title>Merge branch 'ns/core-fsyncmethod'</title>
<updated>2022-03-25T23:38:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-25T23:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb804cd405618ef78b772072685c39392aea4ac1'/>
<id>urn:sha1:eb804cd405618ef78b772072685c39392aea4ac1</id>
<content type='text'>
Replace core.fsyncObjectFiles with two new configuration variables,
core.fsync and core.fsyncMethod.

* ns/core-fsyncmethod:
  core.fsync: documentation and user-friendly aggregate options
  core.fsync: new option to harden the index
  core.fsync: add configuration parsing
  core.fsync: introduce granular fsync control infrastructure
  core.fsyncmethod: add writeout-only mode
  wrapper: make inclusion of Windows csprng header tightly scoped
</content>
</entry>
<entry>
<title>misc *.c: use designated initializers for struct assignments</title>
<updated>2022-03-17T17:36:42Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-17T17:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=501036492b74ad2f3bf9af70fc90056245b60525'/>
<id>urn:sha1:501036492b74ad2f3bf9af70fc90056245b60525</id>
<content type='text'>
Change a few miscellaneous non-designated initializer assignments to
use designated initializers.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/object-file-api-updates'</title>
<updated>2022-03-17T00:53:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-17T00:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=430883a70c79614e52279f2800a9a383ffc68fe5'/>
<id>urn:sha1:430883a70c79614e52279f2800a9a383ffc68fe5</id>
<content type='text'>
Object-file API shuffling.

* ab/object-file-api-updates:
  object-file API: pass an enum to read_object_with_reference()
  object-file.c: add a literal version of write_object_file_prepare()
  object-file API: have hash_object_file() take "enum object_type"
  object API: rename hash_object_file_literally() to write_*()
  object-file API: split up and simplify check_object_signature()
  object API users + docs: check &lt;0, not !0 with check_object_signature()
  object API docs: move check_object_signature() docs to cache.h
  object API: correct "buf" v.s. "map" mismatch in *.c and *.h
  object-file API: have write_object_file() take "enum object_type"
  object-file API: add a format_object_header() function
  object-file API: return "void", not "int" from hash_object_file()
  object-file.c: split up declaration of unrelated variables
</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>object-file API: pass an enum to read_object_with_reference()</title>
<updated>2022-02-26T01:16:32Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-04T23:48:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6aea6baeb3ece6c832dbdf1deed09f41aebf85c2'/>
<id>urn:sha1:6aea6baeb3ece6c832dbdf1deed09f41aebf85c2</id>
<content type='text'>
Change the read_object_with_reference() function to take an "enum
object_type". It was not prepared to handle an arbitrary "const
char *type", as it was itself calling type_from_string().

Let's change the only caller that passes in user data to use
type_from_string(), and convert the rest to use e.g. "OBJ_TREE"
instead of "tree_type".

The "cat-file" caller is not on the codepath that
handles"--allow-unknown", so the type_from_string() there is safe. Its
use of type_from_string() doesn't functionally differ from that of the
pre-image.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-file.c: add a literal version of write_object_file_prepare()</title>
<updated>2022-02-26T01:16:32Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-04T23:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2bbb28a3ee2f7252de02f5d0db4da79090b4f8fc'/>
<id>urn:sha1:2bbb28a3ee2f7252de02f5d0db4da79090b4f8fc</id>
<content type='text'>
Split off a *_literally() variant of the write_object_file_prepare()
function. To do this create a new "hash_object_body()" static helper.

We now defer the type_name() call until the very last moment in
format_object_header() for those callers that aren't "hash-object
--literally".

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-file API: have hash_object_file() take "enum object_type"</title>
<updated>2022-02-26T01:16:32Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-04T23:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44439c1c5827480f68b37c3cc38f257eaeb3ed2c'/>
<id>urn:sha1:44439c1c5827480f68b37c3cc38f257eaeb3ed2c</id>
<content type='text'>
Change the hash_object_file() function to take an "enum
object_type".

Since a preceding commit all of its callers are passing either
"{commit,tree,blob,tag}_type", or the result of a call to type_name(),
the parse_object() caller that would pass NULL is now using
stream_object_signature().

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