<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-05-17T13:58:43Z</updated>
<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>
<entry>
<title>Merge branch 'jk/c23-const-preserving-fixes-more'</title>
<updated>2026-04-09T18:21:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-09T18:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3eabc358a940e5ac2e0cb161957a51f3e2a5a3a0'/>
<id>urn:sha1:3eabc358a940e5ac2e0cb161957a51f3e2a5a3a0</id>
<content type='text'>
Further work to adjust the codebase for C23 that changes functions
like strchr() that discarded constness when they return a pointer into
a const string to preserve constness.

* jk/c23-const-preserving-fixes-more:
  git-compat-util: fix CONST_OUTPARAM typo and indentation
  refs/files-backend: drop const to fix strchr() warning
  http: drop const to fix strstr() warning
  range-diff: drop const to fix strstr() warnings
  pkt-line: make packet_reader.line non-const
  skip_prefix(): check const match between in and out params
  pseudo-merge: fix disk reads from find_pseudo_merge()
  find_last_dir_sep(): convert inline function to macro
  run-command: explicitly cast away constness when assigning to void
  pager: explicitly cast away strchr() constness
  transport-helper: drop const to fix strchr() warnings
  http: add const to fix strchr() warnings
  convert: add const to fix strchr() warnings
</content>
</entry>
<entry>
<title>Merge branch 'ps/reftable-portability'</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='https://git.shady.money/git/commit/?id=4fee6ff3b23321b55073ca2d13c4e2aa6adaea65'/>
<id>urn:sha1:4fee6ff3b23321b55073ca2d13c4e2aa6adaea65</id>
<content type='text'>
Update reftable library part with what is used in libgit2 to improve
portability to different target codebases and platforms.

* ps/reftable-portability:
  reftable/system: add abstraction to mmap files
  reftable/system: add abstraction to retrieve time in milliseconds
  reftable/fsck: use REFTABLE_UNUSED instead of UNUSED
  reftable/stack: provide fsync(3p) via system header
  reftable: introduce "reftable-system.h" header
</content>
</entry>
</feed>
