Skip to content

feat(gc): allow num with all-branches#11013

Open
shcheklein wants to merge 1 commit intotreeverse:mainfrom
shcheklein:feat/gc-add-num-to-all-branches
Open

feat(gc): allow num with all-branches#11013
shcheklein wants to merge 1 commit intotreeverse:mainfrom
shcheklein:feat/gc-add-num-to-all-branches

Conversation

@shcheklein
Copy link
Contributor

dvc gc now supports using -n/--num with --all-branches, so garbage collection can preserve the last N commits from each branch tip, including when --projects repos share the same cache. This keeps the existing shared-cache union behavior and extends revision expansion rather than adding project-specific logic.

Example: dvc gc --all-branches --num 2 --projects ../repo-a ../repo-b --force

Docs will be updated when / if this is approved first.


Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@github-project-automation github-project-automation bot moved this to Backlog in DVC Mar 10, 2026
@CLAassistant
Copy link

CLAassistant commented Mar 10, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 91.42857% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.98%. Comparing base (2431ec6) to head (38bd8f3).
⚠️ Report is 194 commits behind head on main.

Files with missing lines Patch % Lines
dvc/commands/gc.py 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11013      +/-   ##
==========================================
+ Coverage   90.68%   90.98%   +0.29%     
==========================================
  Files         504      505       +1     
  Lines       39795    41132    +1337     
  Branches     3141     3261     +120     
==========================================
+ Hits        36087    37422    +1335     
- Misses       3042     3071      +29     
+ Partials      666      639      -27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shcheklein
Copy link
Contributor Author

@skshetry test failures are related to tabulate version bump it seems, not touching it here.

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.

2 participants