<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, branch seen</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=seen</id>
<link rel='self' href='https://git.shady.money/git/atom?h=seen'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-05-18T05:29:04Z</updated>
<entry>
<title>Merge branch 'kn/refs-fsck-skip-lock-files' into seen</title>
<updated>2026-05-18T05:29:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-05-18T05:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65449f03cec74e0c2b60ee16a64b34708d168c4b'/>
<id>urn:sha1:65449f03cec74e0c2b60ee16a64b34708d168c4b</id>
<content type='text'>
The consistency checks for the files reference backend have been updated
to skip lock files earlier, avoiding unnecessary parsing of
intermediate files.

* kn/refs-fsck-skip-lock-files:
  refs/files: skip lock files during consistency checks
</content>
</entry>
<entry>
<title>refs/files: skip lock files during consistency checks</title>
<updated>2026-05-17T23:43:32Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-05-17T17:32:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0fcba2d9cf86ba45943066924f111006d55ba08'/>
<id>urn:sha1:e0fcba2d9cf86ba45943066924f111006d55ba08</id>
<content type='text'>
Consistency checks in the files reference backend involve two steps:

1. Iterate over all entries within the 'refs/' directory and call
`files_fsck_ref()` on each.
2. Iterate over all root refs via `for_each_root_ref()` and call
`files_fsck_ref()` on each.

`files_fsck_ref()` then runs all fsck checks defined in
`fsck_refs_fn[]`. Step 2 goes through the refs API and only sees valid
refs, but step 1 iterates the directory directly and may also encounter
intermediate '*.lock' files.

Currently, `files_fsck_refs_name()`, one of the functions in
`fsck_refs_fn[]`, filters out lock files itself. The other function,
`files_fsck_refs_content()`, has no such check and would parse the lock
file. Any new function added to `fsck_refs_fn[]` would have the same
problem.

Move the filter up into `files_fsck_refs_dir()`, where the directory
iteration happens. Since step 2 cannot produce lock files, this is the
only site where the filter is needed, and individual checks no longer
have to re-implement 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>Merge branch 'kn/refs-generic-helpers' into jch</title>
<updated>2026-05-17T13:58:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-05-17T13:58:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65fab109594dbca83910101f669d09cf63d108d2'/>
<id>urn:sha1:65fab109594dbca83910101f669d09cf63d108d2</id>
<content type='text'>
Refactor service routines in the ref subsystem backends.

* kn/refs-generic-helpers:
  refs: use peeled tag values in reference backends
  refs: add peeled object ID to the `ref_update` struct
  refs: move object parsing to the generic layer
  update-ref: handle rejections while adding updates
  update-ref: move `print_rejected_refs()` up
  refs: return `ref_transaction_error` from `ref_transaction_update()`
  refs: extract out reflog config to generic layer
  refs: introduce `ref_store_init_options`
  refs: remove unused typedef 'ref_transaction_commit_fn'
</content>
</entry>
<entry>
<title>Merge branch 'sp/refs-reduce-the-repository'</title>
<updated>2026-05-11T01:05:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-05-11T01:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=655096d1dccbedf51295d574df8d7746d6c5aedc'/>
<id>urn:sha1:655096d1dccbedf51295d574df8d7746d6c5aedc</id>
<content type='text'>
Code clean-up to use the right instance of a repository instance in
calls inside refs subsystem.

* sp/refs-reduce-the-repository:
  refs/reftable-backend: drop uses of the_repository
  refs: remove the_hash_algo global state
  refs: add struct repository parameter in get_files_ref_lock_timeout_ms()
</content>
</entry>
<entry>
<title>refs: use peeled tag values in reference backends</title>
<updated>2026-05-05T07:34:08Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-05-04T17:44:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ab3d5077dc7048f9a0209e06f7de30971a303d7'/>
<id>urn:sha1:3ab3d5077dc7048f9a0209e06f7de30971a303d7</id>
<content type='text'>
The reference backends peel tag objects when storing references to them.
This is to provide optimized reads which avoids hitting the odb. The
previous commits ensures that the peeled value is now propagated via the
generic layer. So modify the packed and reftable backend to directly use
this value instead of calling `peel_object()` independently.

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: add peeled object ID to the `ref_update` struct</title>
<updated>2026-05-05T07:34:08Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-05-04T17:44:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ad0f76d7824558e08cc35f77df2fc0e48ee1b28b'/>
<id>urn:sha1:ad0f76d7824558e08cc35f77df2fc0e48ee1b28b</id>
<content type='text'>
Certain reference backends {packed, reftable}, have the ability to also
store the peeled object ID for a reference pointing to a tag object.
This has the added benefit that during retrieval of such references, we
also obtain the peeled object ID without having to use the ODB.

To provide this functionality, each backend independently calls the ODB
to obtain the peeled OID. To move this functionality to the generic
layer, there must be support infrastructure to pass in a peeled OID for
reference updates.

Add a `peeled` field to the `ref_update` structure and modify
`ref_transaction_add_update()` to receive and copy this object ID to the
`ref_update` structure. Finally, modify `ref_transaction_update()` to
peel tag objects and pass the peeled OID to
`ref_transaction_add_update()`.

Update all callers of these functions with the new function parameters.
Callers which only add reflog updates, need to only pass in NULL, since
for reflogs, we don't store peeled OIDs. Reference deletions also only
need to pass in NULL. For others, pass along the peeled OID if
available.

In a following commit, we'll modify the backends to use this peeled OID
instead of parsing it themselves.

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 object parsing to the generic layer</title>
<updated>2026-05-05T07:34:08Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-05-04T17:44:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b32c23be3bf444ad8d56e8daee4a704ff8cae0ea'/>
<id>urn:sha1:b32c23be3bf444ad8d56e8daee4a704ff8cae0ea</id>
<content type='text'>
Regular reference updates made via reference transactions validate that
the provided object ID exists in the object database, which is done by
calling 'parse_object()'. This check is done independently by the
backends which leads to duplicated logic.

Let's move this to the generic layer, ensuring the backends only have to
care about reference storage and not about validation of the object IDs.
With this also remove the 'REF_TRANSACTION_ERROR_INVALID_NEW_VALUE'
error type as its no longer used.

Since we don't iterate over individual references in
`ref_transaction_prepare()`, we add this check to
`ref_transaction_update()`. This means that the validation is done as
soon as an update is queued, without needing to prepare the
transaction. It can be argued that this is more ideal, since this
validation has no dependency on the reference transaction being
prepared.

It must be noted that the change in behavior means that this error
cannot be ignored even with usage of batched updates, since this happens
when the update is being added to the transaction. But since the caller
gets specific error codes, they can either abort the transaction or
continue adding other updates to the transaction.

Modify 'builtin/receive-pack.c' to now capture the error type so that
the error propagated to the client stays the same. Also remove two of
the tests which validates batch-updates with invalid new_oid.

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 reflog config to generic layer</title>
<updated>2026-05-05T07:34:07Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-05-04T17:44:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc42c88945753363d67d130c79640e3c682e1334'/>
<id>urn:sha1:cc42c88945753363d67d130c79640e3c682e1334</id>
<content type='text'>
The reference backends need to know when to create reflog entries, this
is dictated by the 'core.logallrefupdates' config. Instead of relying on
the backends to call `repo_settings_get_log_all_ref_updates()` to obtain
this config value, let's do this in the generic layer and pass down the
value to the backends.

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: introduce `ref_store_init_options`</title>
<updated>2026-05-05T07:34:07Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-05-04T17:44:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d194dffcfd3ad26105149f8e0fbd3b6537bf1986'/>
<id>urn:sha1:d194dffcfd3ad26105149f8e0fbd3b6537bf1986</id>
<content type='text'>
Reference backends are initiated via the `init()` function. When
initiating the function, the backend is also provided flags which denote
the access levels of the initiator. Create a new structure
`ref_store_init_options` to house such options and move the access flags
to this structure.

This allows easier extension of providing further options to the
backends. In the following commit, we'll also provide config around
reflog creation to the backends via the same structure.

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: remove unused typedef 'ref_transaction_commit_fn'</title>
<updated>2026-05-05T07:34:07Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2026-05-04T17:44:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a349a1d7970ed2c6fcac8ea0c1d641384ad082d'/>
<id>urn:sha1:8a349a1d7970ed2c6fcac8ea0c1d641384ad082d</id>
<content type='text'>
The typedef 'ref_transaction_commit_fn' is not used anywhere in our
code, let's remove 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>
</feed>
