]> git.ipfire.org Git - thirdparty/git.git/commit - reachable.h
reachable: add options to add_unseen_recent_objects_to_traversal
authorTaylor Blau <me@ttaylorr.com>
Fri, 20 May 2022 23:17:54 +0000 (19:17 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2022 22:48:26 +0000 (15:48 -0700)
commit2fb90409b8133803bae89773ac9a9db629443dc6
tree176d4a1db494f1e2744fa970122ad17cdc98266e
parentb757353676d6ffe1ac275366fa8b5b42b5d9727d
reachable: add options to add_unseen_recent_objects_to_traversal

This function behaves very similarly to what we will need in
pack-objects in order to implement cruft packs with expiration. But it
is lacking a couple of things. Namely, it needs:

  - a mechanism to communicate the timestamps of individual recent
    objects to some external caller

  - and, in the case of packed objects, our future caller will also want
    to know the originating pack, as well as the offset within that pack
    at which the object can be found

  - finally, it needs a way to skip over packs which are marked as kept
    in-core.

To address the first two, add a callback interface in this patch which
reports the time of each recent object, as well as a (packed_git,
off_t) pair for packed objects.

Likewise, add a new option to the packed object iterators to skip over
packs which are marked as kept in core. This option will become
implicitly tested in a future patch.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
reachable.c
reachable.h