<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs/reftable-backend.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-02T17:45:43Z</updated>
<entry>
<title>reftable/stack: provide fsync(3p) via system header</title>
<updated>2026-04-02T17:45:43Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-04-02T07:31:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b45ea595e6f6b03a749abc2c8e508504429a4cf3'/>
<id>urn:sha1:b45ea595e6f6b03a749abc2c8e508504429a4cf3</id>
<content type='text'>
Users of the reftable library are expected to provide their own function
callback in cases they want to sync(3p) data to disk via the reftable
write options. But if no such function was provided we end up calling
fsync(3p) directly, which may not even be available on some systems.

While dropping the explicit call to fsync(3p) would work, it would lead
to an unsafe default behaviour where a project may have forgotten to set
up the callback function, and that could lead to potential data loss. So
this is not a great solution.

Instead, drop the callback function and make it mandatory for the
project to define fsync(3p). In the case of Git, we can then easily
inject our custom implementation via the "reftable-system.h" header so
that we continue to use `fsync_component()`.

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>Merge branch 'ps/refs-for-each'</title>
<updated>2026-03-09T21:36:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-09T21:36:55Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d445aecfb013ae7b45e946f9aea06464aee69ed8'/>
<id>urn:sha1:d445aecfb013ae7b45e946f9aea06464aee69ed8</id>
<content type='text'>
Code refactoring around refs-for-each-* API functions.

* ps/refs-for-each:
  refs: replace `refs_for_each_fullref_in()`
  refs: replace `refs_for_each_namespaced_ref()`
  refs: replace `refs_for_each_glob_ref()`
  refs: replace `refs_for_each_glob_ref_in()`
  refs: replace `refs_for_each_rawref_in()`
  refs: replace `refs_for_each_rawref()`
  refs: replace `refs_for_each_ref_in()`
  refs: improve verification for-each-ref options
  refs: generalize `refs_for_each_fullref_in_prefixes()`
  refs: generalize `refs_for_each_namespaced_ref()`
  refs: speed up `refs_for_each_glob_ref_in()`
  refs: introduce `refs_for_each_ref_ext`
  refs: rename `each_ref_fn`
  refs: rename `do_for_each_ref_flags`
  refs: move `do_for_each_ref_flags` further up
  refs: move `refs_head_ref_namespaced()`
  refs: remove unused `refs_for_each_include_root_ref()`
</content>
</entry>
<entry>
<title>Merge branch 'kn/ref-location'</title>
<updated>2026-03-04T18:52:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-04T18:52:58Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1d0a2acb78f157d39937a088548e561b27722e8d'/>
<id>urn:sha1:1d0a2acb78f157d39937a088548e561b27722e8d</id>
<content type='text'>
Allow the directory in which reference backends store their data to
be specified.

* kn/ref-location:
  refs: add GIT_REFERENCE_BACKEND to specify reference backend
  refs: allow reference location in refstorage config
  refs: receive and use the reference storage payload
  refs: move out stub modification to generic layer
  refs: extract out `refs_create_refdir_stubs()`
  setup: don't modify repo in `create_reference_database()`
</content>
</entry>
<entry>
<title>refs: receive and use the reference storage payload</title>
<updated>2026-02-25T17:27:12Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-02-25T09:40:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d74aacd7c41573e586c1a9d7204aaaebf9901bd1'/>
<id>urn:sha1:d74aacd7c41573e586c1a9d7204aaaebf9901bd1</id>
<content type='text'>
An upcoming commit will add support for providing an URI via the
'extensions.refStorage' config. The URI will contain the reference
backend and a corresponding payload. The payload can be then used for
providing an alternate locations for the reference backend.

To prepare for this, modify the existing backends to accept such an
argument when initializing via the 'init()' function. Both the files
and reftable backends will parse the information to be filesystem paths
to store references. Given that no callers pass any payload yet this is
essentially a no-op change for now.

To enable this, provide a 'refs_compute_filesystem_location()' function
which will parse the current 'gitdir' and the 'payload' to provide the
final reference directory and common reference directory (if working in
a linked worktree).

The documentation and tests will be added alongside the extension of the
config variable.

Helped-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: move out stub modification to generic layer</title>
<updated>2026-02-25T17:27:12Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-02-25T09:40:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2a32ac429e9faaecaf1c15c18e7873da5754a8d7'/>
<id>urn:sha1:2a32ac429e9faaecaf1c15c18e7873da5754a8d7</id>
<content type='text'>
When creating the reftable reference backend on disk, we create stubs to
ensure that the directory can be recognized as a Git repository. This is
done by calling `refs_create_refdir_stubs()`. Move this to the generic
layer as this is needed for all backends excluding from the files
backends. In an upcoming commit where we introduce alternate reference
backend locations, we'll have to also create stubs in the $GIT_DIR
irrespective of the backend being used. This commit builds the base to
add that logic.

Similarly, move the logic for deletion of stubs to the generic layer.
The files backend recursively calls the remove function of the
'packed-backend', here skip calling the generic function since that
would try to delete stubs.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: extract out `refs_create_refdir_stubs()`</title>
<updated>2026-02-25T17:27:12Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-02-25T09:40:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=4ffbb02ee4bde38b4792b93cfba48755b394a130'/>
<id>urn:sha1:4ffbb02ee4bde38b4792b93cfba48755b394a130</id>
<content type='text'>
For Git to recognize a directory as a Git directory, it requires the
directory to contain:

  1. 'HEAD' file
  2. 'objects/' directory
  3. 'refs/' directory

Here, #1 and #3 are part of the reference storage mechanism,
specifically the files backend. Since then, newer backends such as the
reftable backend have moved to using their own path ('reftable/') for
storing references. But to ensure Git still recognizes the directory as
a Git directory, we create stubs.

There are two locations where we create stubs:

- In 'refs/reftable-backend.c' when creating the reftable backend.
- In 'clone.c' before spawning transport helpers.

In a following commit, we'll add another instance. So instead of
repeating the code, let's extract out this code to
`refs_create_refdir_stubs()` and use it.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: rename `do_for_each_ref_flags`</title>
<updated>2026-02-23T21:21:18Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-02-23T11:59:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=8f0720a5a781562fb1f750b351e14129fc8930ea'/>
<id>urn:sha1:8f0720a5a781562fb1f750b351e14129fc8930ea</id>
<content type='text'>
The enum `do_for_each_ref_flags` and its individual values don't match
to our current best practices when it comes to naming things. Rename it
to `refs_for_each_flag`.

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>Merge branch 'kn/ref-batch-output-error-reporting-fix'</title>
<updated>2026-02-09T20:09:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-09T20:09:10Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6176ee2349ae9b4c54948e86fb8de4b9fd4f0c94'/>
<id>urn:sha1:6176ee2349ae9b4c54948e86fb8de4b9fd4f0c94</id>
<content type='text'>
A handful of code paths that started using batched ref update API
(after Git 2.51 or so) lost detailed error output, which have been
corrected.

* kn/ref-batch-output-error-reporting-fix:
  fetch: delay user information post committing of transaction
  receive-pack: utilize rejected ref error details
  fetch: utilize rejected ref error details
  update-ref: utilize rejected error details if available
  refs: add rejection detail to the callback function
  refs: skip to next ref when current ref is rejected
</content>
</entry>
<entry>
<title>refs: skip to next ref when current ref is rejected</title>
<updated>2026-01-26T06:27:33Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-01-25T22:52:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b52a28b03ec99f2cfe4ef921b0d47250c665b0c6'/>
<id>urn:sha1:b52a28b03ec99f2cfe4ef921b0d47250c665b0c6</id>
<content type='text'>
In `refs_verify_refnames_available()` we have two nested loops: the
outer loop iterates over all references to check, while the inner loop
checks for filesystem conflicts for a given ref by breaking down its
path.

With batched updates, when we detect a filesystem conflict, we mark the
update as rejected and execute 'continue'. However, this only skips to
the next iteration of the inner loop, not the outer loop as intended.
This causes the same reference to be repeatedly rejected. Fix this by
using a goto statement to skip to the next reference in the outer loop.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/reftable: introduce generic checks for refs</title>
<updated>2026-01-12T14:55:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:03:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=06d6ead762ba525c5837812e7f509406253cdacd'/>
<id>urn:sha1:06d6ead762ba525c5837812e7f509406253cdacd</id>
<content type='text'>
In a preceding commit we have extracted generic checks for both direct
and symbolic refs that apply for all backends. Wire up those checks for
the "reftable" backend.

Note that this is done by iterating through all refs manually with the
low-level reftable ref iterator. We explicitly don't want to use the
higher-level iterator that is exposed to users of the reftable backend
as that iterator may swallow for example broken refs.

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