<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.h, branch v2.50.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.50.1</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.50.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-04-16T20:54:19Z</updated>
<entry>
<title>Merge branch 'kn/non-transactional-batch-updates'</title>
<updated>2025-04-16T20:54:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-04-16T20:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47478802daddf3f9916111307f153c6298ffc0bc'/>
<id>urn:sha1:47478802daddf3f9916111307f153c6298ffc0bc</id>
<content type='text'>
Updating multiple references have only been possible in all-or-none
fashion with transactions, but it can be more efficient to batch
multiple updates even when some of them are allowed to fail in a
best-effort manner.  A new "best effort batches of updates" mode
has been introduced.

* kn/non-transactional-batch-updates:
  update-ref: add --batch-updates flag for stdin mode
  refs: support rejection in batch updates during F/D checks
  refs: implement batch reference update support
  refs: introduce enum-based transaction error types
  refs/reftable: extract code from the transaction preparation
  refs/files: remove duplicate duplicates check
  refs: move duplicate refname update check to generic layer
  refs/files: remove redundant check in split_symref_update()
</content>
</entry>
<entry>
<title>refs: support rejection in batch updates during F/D checks</title>
<updated>2025-04-08T14:57:21Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2025-04-08T08:51:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=31726bb90d70236f7afaa345bf45195e2ef62d22'/>
<id>urn:sha1:31726bb90d70236f7afaa345bf45195e2ef62d22</id>
<content type='text'>
The `refs_verify_refnames_available()` is used to batch check refnames
for F/D conflicts. While this is the more performant alternative than
its individual version, it does not provide rejection capabilities on a
single update level. For batched updates, this would mean a rejection of
the entire transaction whenever one reference has a F/D conflict.

Modify the function to call `ref_transaction_maybe_set_rejected()` to
check if a single update can be rejected. Since this function is only
internally used within 'refs/' and we want to pass in a `struct
ref_transaction *` as a variable. We also move and mark
`refs_verify_refnames_available()` to 'refs-internal.h' to be an
internal function.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Acked-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: implement batch reference update support</title>
<updated>2025-04-08T14:57:20Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2025-04-08T08:51:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=23fc8e4f613179900ce28da959757a387543b468'/>
<id>urn:sha1:23fc8e4f613179900ce28da959757a387543b468</id>
<content type='text'>
Git supports making reference updates with or without transactions.
Updates with transactions are generally better optimized. But
transactions are all or nothing. This means, if a user wants to batch
updates to take advantage of the optimizations without the hard
requirement that all updates must succeed, there is no way currently to
do so. Particularly with the reftable backend where batching multiple
reference updates is more efficient than performing them sequentially.

Introduce batched update support with a new flag,
'REF_TRANSACTION_ALLOW_FAILURE'. Batched updates while different from
transactions, use the transaction infrastructure under the hood. When
enabled, this flag allows individual reference updates that would
typically cause the entire transaction to fail due to non-system-related
errors to be marked as rejected while permitting other updates to
proceed. System errors referred by 'REF_TRANSACTION_ERROR_GENERIC'
continue to result in the entire transaction failing. This approach
enhances flexibility while preserving transactional integrity where
necessary.

The implementation introduces several key components:

  - Add 'rejection_err' field to struct `ref_update` to track failed
    updates with failure reason.

  - Add a new struct `ref_transaction_rejections` and a field within
    `ref_transaction` to this struct to allow quick iteration over
    rejected updates.

  - Modify reference backends (files, packed, reftable) to handle
    partial transactions by using `ref_transaction_set_rejected()`
    instead of failing the entire transaction when
    `REF_TRANSACTION_ALLOW_FAILURE` is set.

  - Add `ref_transaction_for_each_rejected_update()` to let callers
    examine which updates were rejected and why.

This foundational change enables batched update support throughout the
reference subsystem. A following commit will expose this capability to
users by adding a `--batch-updates` flag to 'git-update-ref(1)',
providing both a user-facing feature and a testable implementation.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Acked-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: introduce enum-based transaction error types</title>
<updated>2025-04-08T14:57:20Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2025-04-08T08:51:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=76e760b99923cb9afb52ef08607f736ff3eeaad7'/>
<id>urn:sha1:76e760b99923cb9afb52ef08607f736ff3eeaad7</id>
<content type='text'>
Replace preprocessor-defined transaction errors with a strongly-typed
enum `ref_transaction_error`. This change:

  - Improves type safety and function signature clarity.
  - Makes error handling more explicit and discoverable.
  - Maintains existing error cases, while adding new error cases for
    common scenarios.

This refactoring paves the way for more comprehensive error handling
which we will utilize in the upcoming commits to add batch reference
update support.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Acked-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/refname-avail-check-optim'</title>
<updated>2025-03-29T07:39:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-03-29T07:39:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d6413a1bef7876b9c17a79358bd70b764ffacba'/>
<id>urn:sha1:8d6413a1bef7876b9c17a79358bd70b764ffacba</id>
<content type='text'>
The code paths to check whether a refname X is available (by seeing
if another ref X/Y exists, etc.) have been optimized.

* ps/refname-avail-check-optim:
  refs: reuse iterators when determining refname availability
  refs/iterator: implement seeking for files iterators
  refs/iterator: implement seeking for packed-ref iterators
  refs/iterator: implement seeking for ref-cache iterators
  refs/iterator: implement seeking for reftable iterators
  refs/iterator: implement seeking for merged iterators
  refs/iterator: provide infrastructure to re-seek iterators
  refs/iterator: separate lifecycle from iteration
  refs: stop re-verifying common prefixes for availability
  refs/files: batch refname availability checks for initial transactions
  refs/files: batch refname availability checks for normal transactions
  refs/reftable: batch refname availability checks
  refs: introduce function to batch refname availability checks
  builtin/update-ref: skip ambiguity checks when parsing object IDs
  object-name: allow skipping ambiguity checks in `get_oid()` family
  object-name: introduce `repo_get_oid_with_flags()`
</content>
</entry>
<entry>
<title>refs: introduce function to batch refname availability checks</title>
<updated>2025-03-12T18:31:17Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-03-12T15:56:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ff58dec493ab5bebb6943b814461ba4e9937e15'/>
<id>urn:sha1:2ff58dec493ab5bebb6943b814461ba4e9937e15</id>
<content type='text'>
The `refs_verify_refname_available()` functions checks whether a
reference update can be committed or whether it would conflict with
either a prefix or suffix thereof. This function needs to be called once
per reference that one wants to check, which requires us to redo a
couple of checks every time the function is called.

Introduce a new function `refs_verify_refnames_available()` that does
the same, but for a list of references. For now, the new function uses
the exact same implementation, except that we loop through all refnames
provided by the caller. This will be tuned in subsequent commits.

The existing `refs_verify_refname_available()` function is reimplemented
on top of the new function. As such, the diff is best viewed with the
`--ignore-space-change option`.

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 'tz/doc-txt-to-adoc-fixes'</title>
<updated>2025-03-06T22:06:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-03-06T22:06:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=62c58891e177bb3860ab19d2dc2e23909759c6ed'/>
<id>urn:sha1:62c58891e177bb3860ab19d2dc2e23909759c6ed</id>
<content type='text'>
Fallouts from recent renaming of documentation files from .txt
suffix to the new .adoc suffix have been corrected.

* tz/doc-txt-to-adoc-fixes: (38 commits)
  xdiff: *.txt -&gt; *.adoc fixes
  unpack-trees.c: *.txt -&gt; *.adoc fixes
  transport.h: *.txt -&gt; *.adoc fixes
  trace2/tr2_sysenv.c: *.txt -&gt; *.adoc fixes
  trace2.h: *.txt -&gt; *.adoc fixes
  t6434: *.txt -&gt; *.adoc fixes
  t6012: *.txt -&gt; *.adoc fixes
  t/helper/test-rot13-filter.c: *.txt -&gt; *.adoc fixes
  simple-ipc.h: *.txt -&gt; *.adoc fixes
  setup.c: *.txt -&gt; *.adoc fixes
  refs.h: *.txt -&gt; *.adoc fixes
  pseudo-merge.h: *.txt -&gt; *.adoc fixes
  parse-options.h: *.txt -&gt; *.adoc fixes
  object-name.c: *.txt -&gt; *.adoc fixes
  list-objects-filter-options.h: *.txt -&gt; *.adoc fixes
  fsck.h: *.txt -&gt; *.adoc fixes
  diffcore.h: *.txt -&gt; *.adoc fixes
  diff.h: *.txt -&gt; *.adoc fixes
  contrib/long-running-filter: *.txt -&gt; *.adoc fixes
  config.c: *.txt -&gt; *.adoc fixes
  ...
</content>
</entry>
<entry>
<title>refs.h: *.txt -&gt; *.adoc fixes</title>
<updated>2025-03-03T21:49:24Z</updated>
<author>
<name>Todd Zullinger</name>
<email>tmz@pobox.com</email>
</author>
<published>2025-03-03T20:44:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=72d385824a75e1d39b2a4395852dc954907fcc7d'/>
<id>urn:sha1:72d385824a75e1d39b2a4395852dc954907fcc7d</id>
<content type='text'>
Signed-off-by: Todd Zullinger &lt;tmz@pobox.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kn/ref-migrate-skip-reflog'</title>
<updated>2025-02-27T23:23:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-02-27T23:23:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c0f4abaf5b3e47d9426bb2bffb06d5ee47b1c95'/>
<id>urn:sha1:3c0f4abaf5b3e47d9426bb2bffb06d5ee47b1c95</id>
<content type='text'>
"git refs migrate" can optionally be told not to migrate the reflog.

* kn/ref-migrate-skip-reflog:
  builtin/refs: add '--no-reflog' flag to drop reflogs
</content>
</entry>
<entry>
<title>builtin/refs: add '--no-reflog' flag to drop reflogs</title>
<updated>2025-02-21T17:55:02Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2025-02-21T10:04:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89be7d2774f81f3d8663999975a6ab64d46bf42e'/>
<id>urn:sha1:89be7d2774f81f3d8663999975a6ab64d46bf42e</id>
<content type='text'>
The "git refs migrate" subcommand converts the backend used for ref
storage. It always migrates reflog data as well as refs. Introduce an
option to exclude reflogs from migration, allowing them to be discarded
when they are unnecessary.

This is particularly useful in server-side repositories, where reflogs
are typically not expected. However, some repositories may still have
them due to historical reasons, such as bugs, misconfigurations, or
administrative decisions to enable reflogs for debugging. In such
repositories, it would be optimal to drop reflogs during the migration.

To address this, introduce the '--no-reflog' flag, which prevents reflog
migration. When this flag is used, reflogs from the original reference
backend are migrated. Since only the new reference backend remains in
the repository, all previous reflogs are permanently discarded.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>
</feed>
