<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/unit-tests, 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-04-10T15:00:07Z</updated>
<entry>
<title>t/unit-tests: add tests for the in-memory object source</title>
<updated>2026-04-10T15:00:07Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-04-10T12:12:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe633bd199547a581191c4c30755d39aa7c29280'/>
<id>urn:sha1:fe633bd199547a581191c4c30755d39aa7c29280</id>
<content type='text'>
While the in-memory object source is a full-fledged source, our code
base only exercises parts of its functionality because we only use it in
git-blame(1). Implement unit tests to verify that the yet-unused
functionality of the backend works as expected.

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>oidtree: add ability to store data</title>
<updated>2026-04-10T15:00:05Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-04-10T12:12:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d960bd0f21b7c34cafb05745e2440c5e03a944bf'/>
<id>urn:sha1:d960bd0f21b7c34cafb05745e2440c5e03a944bf</id>
<content type='text'>
The oidtree data structure is currently only used to store object IDs,
without any associated data. So consequently, it can only really be used
to track which object IDs exist, and we can use the tree structure to
efficiently operate on OID prefixes.

But there are valid use cases where we want to both:

  - Store object IDs in a sorted order.

  - Associated arbitrary data with them.

Refactor the oidtree interface so that it allows us to store arbitrary
payloads within the respective nodes. This will be used in the next
commit.

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/odb-generic-object-name-handling'</title>
<updated>2026-04-06T22:42:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-06T22:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d75badf83bc3fc8e47413970874bac681eeb5bbe'/>
<id>urn:sha1:d75badf83bc3fc8e47413970874bac681eeb5bbe</id>
<content type='text'>
Object name handling (disambiguation and abbreviation) has been
refactored to be backend-generic, moving logic into the respective
object database backends.

* ps/odb-generic-object-name-handling:
  odb: introduce generic `odb_find_abbrev_len()`
  object-file: move logic to compute packed abbreviation length
  object-name: move logic to compute loose abbreviation length
  object-name: simplify computing common prefixes
  object-name: abbreviate loose object names without `disambiguate_state`
  object-name: merge `update_candidates()` and `match_prefix()`
  object-name: backend-generic `get_short_oid()`
  object-name: backend-generic `repo_collect_ambiguous()`
  object-name: extract function to parse object ID prefixes
  object-name: move logic to iterate through packed prefixed objects
  object-name: move logic to iterate through loose prefixed objects
  odb: introduce `struct odb_for_each_object_options`
  oidtree: extend iteration to allow for arbitrary return codes
  oidtree: modernize the code a bit
  object-file: fix sparse 'plain integer as NULL pointer' error
</content>
</entry>
<entry>
<title>Merge branch 'ps/clar-wo-path-max'</title>
<updated>2026-03-24T19:31:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-24T19:31:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9d9cd3830f1f76009d17c408bd1d4f4e7a37b470'/>
<id>urn:sha1:9d9cd3830f1f76009d17c408bd1d4f4e7a37b470</id>
<content type='text'>
Clar (unit testing framework) update from the upstream.

* ps/clar-wo-path-max:
  clar: update to fix compilation on platforms without PATH_MAX
</content>
</entry>
<entry>
<title>oidtree: extend iteration to allow for arbitrary return codes</title>
<updated>2026-03-20T20:16:22Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-20T07:07:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe446b01aeaab307adcbfb39d4aaa72c37afbcda'/>
<id>urn:sha1:fe446b01aeaab307adcbfb39d4aaa72c37afbcda</id>
<content type='text'>
The interface `cb_each()` iterates through a crit-bit tree and calls a
specific callback function for each of the contained items. The callback
function is expected to return either:

  - `CB_CONTINUE` in case iteration shall continue.

  - `CB_BREAK` to abort iteration.

This is needlessly restrictive though, as callers may want to return
arbitrary values and have them be bubbled up to the `cb_each()` call
site. In fact, this is a rather common pattern we have: whenever such a
callback function returns a non-zero error code, we abort iteration and
bubble up the code as-is.

Refactor both the crit-bit tree and oidtree subsystems to behave
accordingly.

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>oidtree: modernize the code a bit</title>
<updated>2026-03-20T20:16:22Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-20T07:07:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1382e54a9c9e5f98271a943af9c10299c6ba934b'/>
<id>urn:sha1:1382e54a9c9e5f98271a943af9c10299c6ba934b</id>
<content type='text'>
The "oidtree.c" subsystem is rather small and self-contained and tends
to just work. It thus doesn't typically receive a lot of attention,
which has as a consequence that it's coding style is somewhat dated
nowadays.

Modernize the style of this subsystem a bit:

  - Rename the `oidtree_iter()` function to `oidtree_each_cb()`.

  - Rename `struct oidtree_iter_data` to `struct oidtree_each_data` to
    match the renamed callback function type.

  - Rename parameters and variables to clarify their intent.

  - Add comments that explain what some of the functions do.

  - Adapt the return value of `oidtree_contains()` to be a boolean.

This prepares for some changes to the subsystem that'll happen in the
next commit.

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/unit-test-c-escape-names.txt'</title>
<updated>2026-03-19T16:54:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-19T16:54:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=80595ab08ef501aef6d9b55856cdc9b092ed6e12'/>
<id>urn:sha1:80595ab08ef501aef6d9b55856cdc9b092ed6e12</id>
<content type='text'>
The unit test helper function was taught to use backslash +
mnemonic notation for certain control characters like "\t", instead
of octal notation like "\011".

* ps/unit-test-c-escape-names.txt:
  test-lib: print escape sequence names
</content>
</entry>
<entry>
<title>clar: update to fix compilation on platforms without PATH_MAX</title>
<updated>2026-03-16T17:00:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-16T07:50:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3cf4024117f5c15361e68c5d9b0c3e9dd01ec105'/>
<id>urn:sha1:3cf4024117f5c15361e68c5d9b0c3e9dd01ec105</id>
<content type='text'>
Update clar to e4172e3 (Merge pull request #134 from
clar-test/ethomson/const, 2026-01-10). Besides some changes to
"generate.py" which don't have any impact on us, this commit also fixes
compilation on platforms that don't have PATH_MAX, like for example
GNU/Hurd.

Reported-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&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>Merge branch 'sk/oidmap-clear-with-custom-free-func'</title>
<updated>2026-03-12T17:56:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-12T17:56:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a591a99d000059f10e9095bb2adee2d28c4318d'/>
<id>urn:sha1:9a591a99d000059f10e9095bb2adee2d28c4318d</id>
<content type='text'>
A bit of OIDmap API enhancement and cleanup.

* sk/oidmap-clear-with-custom-free-func:
  builtin/rev-list: migrate missing_objects cleanup to oidmap_clear_with_free()
  oidmap: make entry cleanup explicit in oidmap_clear
</content>
</entry>
<entry>
<title>test-lib: print escape sequence names</title>
<updated>2026-03-11T18:38:54Z</updated>
<author>
<name>Pablo Sabater</name>
<email>pabloosabaterr@gmail.com</email>
</author>
<published>2026-03-11T03:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e30e9442fd9b90d96dde2fad4a6b26d7a03dee5e'/>
<id>urn:sha1:e30e9442fd9b90d96dde2fad4a6b26d7a03dee5e</id>
<content type='text'>
When printing expected/actual characters in failed checks, use
their names (\a, \b, \n, ...) instead of their octal representation,
making it easier to read.

Add tests to test-example-tap.c
Update t0080-unit-test-output.sh to match the desired output

Teach 'print_one_char()' the equivalent name

Signed-off-by: Pablo Sabater &lt;pabloosabaterr@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
