[PATCH v2 0/2] Reuse --contains traversal results
- From
Tamir Duberstein <tamird@gmail.com>
- Date
- Jun 9, 2026, 02:36 UTC
- Message-ID
- <20260608-ref-filter-memoized-contains-v2-0-e72720344a7c@gmail.com>
The memoized traversal used by git tag avoids repeating graph walks for refs with shared history. Extend it to the other ref-filter users after making the existing traversal safe for cycles introduced by replacement refs.
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
--- Changes in v2: - Split cycle handling into a preparatory patch. - Exercise cycle handling through the existing git tag path. - Move perf result verification out of setup. - Link to v1: https://patch.msgid.link/20260607-ref-filter-memoized-contains-v1-1-a1972dde9c76@gmail.com
---
Tamir Duberstein (2):
commit-reach: handle cycles in contains walk
ref-filter: memoize --contains with generationscommit-reach.c | 43 ++++++++++++++++++++++++++++++------ commit-reach.h | 10 ++++++++- t/perf/p1500-graph-walks.sh | 49 +++++++++++++++++++++++++++++++++++++++++- t/t6301-for-each-ref-errors.sh | 22 +++++++++++++++++++ t/t7004-tag.sh | 21 ++++++++++++++++++ 5 files changed, 137 insertions(+), 8 deletions(-) --- base-commit: 9ac3f193c05c2237e2b14ebaa1149e9fc8a1abe0 change-id: 20260607-ref-filter-memoized-contains-7cb6b3bccad1
Best regards, -- Tamir Duberstein <tamird@gmail.com>