feat(remote): scope fetch/pull to locally tracked files when no targets given#457
Open
tbroadley wants to merge 1 commit into
Open
feat(remote): scope fetch/pull to locally tracked files when no targets given#457tbroadley wants to merge 1 commit into
tbroadley wants to merge 1 commit into
Conversation
8d0b84d to
b7e9742
Compare
There was a problem hiding this comment.
Pull request overview
This PR changes the default behavior of pivot fetch and pivot pull so that, when no explicit targets are provided, they operate only on artifacts referenced by local tracking state (tracked .pvt files and stage lockfile outputs), aligning defaults with pivot checkout.
Changes:
- Added
get_locally_tracked_targets()to collect locally tracked artifact paths from.pvtfiles and stage lockfiles. - Updated
fetch/pullto use locally tracked targets when no CLI targets are provided, and removed the previous “fetch everything from remote” dry-run path. - Removed an unused
asyncioimport fromcli/remote.py.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/pivot/src/pivot/cli/remote.py | Switches fetch/pull default target selection to locally tracked targets and updates dry-run logic accordingly. |
| packages/pivot/src/pivot/cli/helpers.py | Introduces helper to enumerate locally tracked targets via .pvt discovery and stage lockfile parsing. |
536bde2 to
103eaec
Compare
…ts given Previously, `pivot fetch` and `pivot pull` with no targets would fetch everything from the remote, which could take a very long time on large projects. Now, when no targets are specified, fetch/pull scopes to files referenced by local tracking files (.pvt files and stage lockfiles), matching the existing behavior of `pivot checkout` with no targets.
103eaec to
2ad4e6f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pivot fetchandpivot pullwith no targets fetches everything from the remote, which can take a very long time on large projects with lots of data that isn't needed locally.Solution
When no targets are specified,
fetchandpullnow scope to files referenced by local tracking files — the same set thatpivot checkoutwith no targets already uses:.pvtpointer files.pivot/stages/*.lock)This makes the three commands consistent: all three default to "what's tracked locally" rather than "everything on remote".
The old behavior (fetch everything from remote) can still be achieved by running
pivot fetch --allor by explicitly passing targets.Changes
cli/helpers.py: addget_locally_tracked_targets()helper that collects paths from.pvtfiles and stage lockfilescli/remote.py: use that helper infetchandpullwhen no targets given; remove now-unusedasyncioimport