Skip to content

feat(remote): scope fetch/pull to locally tracked files when no targets given#457

Open
tbroadley wants to merge 1 commit into
sjawhar:mainfrom
tbroadley:feat/fetch-pull-scope-to-local-tracking
Open

feat(remote): scope fetch/pull to locally tracked files when no targets given#457
tbroadley wants to merge 1 commit into
sjawhar:mainfrom
tbroadley:feat/fetch-pull-scope-to-local-tracking

Conversation

@tbroadley

Copy link
Copy Markdown
Contributor

Problem

pivot fetch and pivot pull with 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, fetch and pull now scope to files referenced by local tracking files — the same set that pivot checkout with no targets already uses:

  • .pvt pointer files
  • stage lockfile outputs (.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 --all or by explicitly passing targets.

Changes

  • cli/helpers.py: add get_locally_tracked_targets() helper that collects paths from .pvt files and stage lockfiles
  • cli/remote.py: use that helper in fetch and pull when no targets given; remove now-unused asyncio import

Copilot AI review requested due to automatic review settings April 16, 2026 22:39
@tbroadley tbroadley force-pushed the feat/fetch-pull-scope-to-local-tracking branch from 8d0b84d to b7e9742 Compare April 16, 2026 22:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .pvt files and stage lockfiles.
  • Updated fetch/pull to use locally tracked targets when no CLI targets are provided, and removed the previous “fetch everything from remote” dry-run path.
  • Removed an unused asyncio import from cli/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.

Comment thread packages/pivot/src/pivot/cli/remote.py
Comment thread packages/pivot/src/pivot/cli/remote.py
Comment thread packages/pivot/src/pivot/cli/helpers.py
Comment thread packages/pivot/src/pivot/cli/remote.py
@tbroadley tbroadley force-pushed the feat/fetch-pull-scope-to-local-tracking branch 3 times, most recently from 536bde2 to 103eaec Compare April 16, 2026 23:32
…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.
@tbroadley tbroadley force-pushed the feat/fetch-pull-scope-to-local-tracking branch from 103eaec to 2ad4e6f Compare April 16, 2026 23:43
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