<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/object-file.c, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-04-08T17:20:51Z</updated>
<entry>
<title>Merge branch 'jt/index-fd-wo-repo-regression-fix-maint'</title>
<updated>2026-04-08T17:20:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-08T17:20:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=fe4ab2e698d544a082862a14120efc6b49047382'/>
<id>urn:sha1:fe4ab2e698d544a082862a14120efc6b49047382</id>
<content type='text'>
During Git 2.52 timeframe, we broke streaming computation of object
hash outside a repository, which has been corrected.

* jt/index-fd-wo-repo-regression-fix-maint:
  object-file: avoid ODB transaction when not writing objects
</content>
</entry>
<entry>
<title>Merge branch 'ps/odb-cleanup'</title>
<updated>2026-04-08T17:19:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-08T17:19:17Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9797fed6cea706f65de64396222545d545226e15'/>
<id>urn:sha1:9797fed6cea706f65de64396222545d545226e15</id>
<content type='text'>
Various code clean-up around odb subsystem.

* ps/odb-cleanup:
  odb: drop unneeded headers and forward decls
  odb: rename `odb_has_object()` flags
  odb: use enum for `odb_write_object` flags
  odb: rename `odb_write_object()` flags
  treewide: use enum for `odb_for_each_object()` flags
  CodingGuidelines: document our style for flags
</content>
</entry>
<entry>
<title>object-file: avoid ODB transaction when not writing objects</title>
<updated>2026-04-08T00:32:36Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2026-04-07T20:17:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7d8727ff0b621a9729c2de6a3698063b7b3ba2d6'/>
<id>urn:sha1:7d8727ff0b621a9729c2de6a3698063b7b3ba2d6</id>
<content type='text'>
In ce1661f9da (odb: add transaction interface, 2025-09-16), existing
ODB transaction logic is adapted to create a transaction interface
at the ODB layer. The intent here is for the ODB transaction
interface to eventually provide an object source agnostic means to
manage transactions.

An unintended consequence of this change though is that
`object-file.c:index_fd()` may enter the ODB transaction path even
when no object write is requested. In non-repository contexts, this
can result in a NULL dereference and segfault. One such case occurs
when running git-diff(1) outside of a repository with
"core.bigFileThreshold" forcing the streaming path in `index_fd()`:

        $ echo foo &gt;foo
        $ echo bar &gt;bar
        $ git -c core.bigFileThreshold=1 diff -- foo bar

In this scenario, the caller only needs to compute the object ID. Object
hashing does not require an ODB, so starting a transaction is both
unnecessary and invalid.

Fix the bug by avoiding the use of ODB transactions in `index_fd()` when
callers are only interested in computing the object hash.

Reported-by: Luca Stefani &lt;luca.stefani.ge1@gmail.com&gt;
Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
[jc: adjusted to fd13909e (Merge branch 'jt/odb-transaction', 2025-10-02)]
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/fsck-wo-the-repository'</title>
<updated>2026-04-07T21:59:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-07T21:59:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7b6d0cd51b30e842ffb95d045385100b7c677886'/>
<id>urn:sha1:7b6d0cd51b30e842ffb95d045385100b7c677886</id>
<content type='text'>
Internals of "git fsck" have been refactored to not depend on the
global `the_repository` variable.

* ps/fsck-wo-the-repository:
  builtin/fsck: stop using `the_repository` in error reporting
  builtin/fsck: stop using `the_repository` when marking objects
  builtin/fsck: stop using `the_repository` when checking packed objects
  builtin/fsck: stop using `the_repository` with loose objects
  builtin/fsck: stop using `the_repository` when checking reflogs
  builtin/fsck: stop using `the_repository` when checking refs
  builtin/fsck: stop using `the_repository` when snapshotting refs
  builtin/fsck: fix trivial dependence on `the_repository`
  fsck: drop USE_THE_REPOSITORY
  fsck: store repository in fsck options
  fsck: initialize fsck options via a function
  fetch-pack: move fsck options into function scope
</content>
</entry>
<entry>
<title>odb: rename `odb_has_object()` flags</title>
<updated>2026-04-01T03:43:14Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-31T23:57:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c63911b052dc286de5daddba8d4a20fd59348cee'/>
<id>urn:sha1:c63911b052dc286de5daddba8d4a20fd59348cee</id>
<content type='text'>
Rename `odb_has_object()` flags to be properly prefixed with the
function name.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>odb: use enum for `odb_write_object` flags</title>
<updated>2026-04-01T03:43:13Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-31T23:57:49Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b2d421ece6a8e095394e76930e6929ee036571ef'/>
<id>urn:sha1:b2d421ece6a8e095394e76930e6929ee036571ef</id>
<content type='text'>
We've got a couple of functions that accept `odb_write_object()` flags,
but all of them accept the flags as an `unsigned` integer. In fact, we
don't even have an `enum` for the flags field.

Introduce this `enum` and adapt functions accordingly according to our
coding style.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>odb: rename `odb_write_object()` flags</title>
<updated>2026-04-01T03:43:13Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-31T23:57:48Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ff2e9d85d61f2f51793acbdb4bad68d48cc8bb85'/>
<id>urn:sha1:ff2e9d85d61f2f51793acbdb4bad68d48cc8bb85</id>
<content type='text'>
Rename `odb_write_object()` flags to be properly prefixed with the
function name.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsck: store repository in fsck options</title>
<updated>2026-03-23T15:33:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-23T15:02:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=374985390871cb67c02b1608b693480e89567b9a'/>
<id>urn:sha1:374985390871cb67c02b1608b693480e89567b9a</id>
<content type='text'>
The fsck subsystem relies on `the_repository` quite a bit. While we
could of course explicitly pass a repository down the callchain, we
already have a `struct fsck_options` that we pass to almost all
functions.

Extend the options to also store the repository to make it readily
available.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsck: initialize fsck options via a function</title>
<updated>2026-03-23T15:33:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-23T15:02:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f22360902621e0807a1c0a77476e3e4d323c708d'/>
<id>urn:sha1:f22360902621e0807a1c0a77476e3e4d323c708d</id>
<content type='text'>
We initialize the `struct fsck_options` via a set of macros, often in
global scope. In the next commit though we're about to introduce a new
repository field to the options that must be initialized, and naturally
we don't have a repo other than `the_repository` available in this
scope.

Refactor the code to instead intrdouce a new `fsck_options_init()`
function that initializes the options for us and move initialization
into function scope.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-name: move logic to compute loose abbreviation length</title>
<updated>2026-03-20T20:16:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-20T07:07:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ab3ab1038dd38d2be62e3bacf39a3248929a7a98'/>
<id>urn:sha1:ab3ab1038dd38d2be62e3bacf39a3248929a7a98</id>
<content type='text'>
The function `repo_find_unique_abbrev_r()` takes as input an object ID
as well as a minimum object ID length and returns the minimum required
prefix to make the object ID unique.

The logic that computes the abbreviation length for loose objects is
deeply tied to the loose object storage format. As such, it would fail
in case a different object storage format was used.

Prepare for making this logic generic to the backend by moving the logic
into a new `odb_source_loose_find_abbrev_len()` function that is part of
"object-file.c".

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
