Skip to content

Add checkout_store to share git checkouts across projects - #376

Open
aottavianoTT wants to merge 2 commits into
pulp-platform:masterfrom
aottavianoTT:aottaviano/checkout-store
Open

aottavianoTT wants to merge 2 commits into
pulp-platform:masterfrom
aottavianoTT:aottaviano/checkout-store

Conversation

@aottavianoTT

Copy link
Copy Markdown

db_dir lets projects share the bare git repositories, but every project still writes its own working tree for each dependency. With large dependency sets and many short-lived workspaces (CI jobs, fresh clones), writing those trees dominates bender checkout.

This adds an optional checkout_store config field. When set, a git dependency is checked out at <checkout_store>/<name>-<hash>/<revision>/, keyed by its URL and locked revision, and every project locked to that revision uses that checkout. A project on another revision gets its own entry, so no project changes a checkout another one uses.

  • The existing per-path checkout lock serializes concurrent checkouts of the same entry.
  • Unless db_dir is set, the bare repositories live under <checkout_store>/git/db/, so the shared checkouts' --shared alternates never point into one project's .bender.
  • Projects with workspace.checkout_dir keep their own checkouts; bender clone still copies into a private working copy; bender clean leaves the store alone.

Tested (without the slang feature): cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test, the CLI regression against master (57 passed) and tests/iss*.sh. By hand: two projects on one lock (the second writes no files), a third on another revision, four concurrent checkouts into an empty store, and checkout_dir, clone, clean and update.

@aottavianoTT
aottavianoTT marked this pull request as ready for review November 3, 2026 07:24
@aottavianoTT

Copy link
Copy Markdown
Author

@micprog this addresses one pain point from working on large projects at TT where checkout time matters. Please have a look

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant