Skip to content

feat(cli): add clone, remote, fetch, push and pull - #134

Open
PiquelChips wants to merge 1 commit into
feat/sync-test-helpersfrom
feat/sync-commands
Open

PiquelChips wants to merge 1 commit into
feat/sync-test-helpersfrom
feat/sync-commands

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

With sync in place, the command line needs to use it: a repository has at most one remote, shared by its workspaces.

Clone:

  • origin clone <url> [<path>] [--target <target>] follows policy and one target, fetching their chains and only the tip's snapshot, and starts a change on it.
  • Other snapshots are fetched when a command needs them, such as a checkout, a diff or a merge.
  • A move fetches what it needs before writing its marker, so an offline move changes nothing.

Other commands:

  • remote shows or sets the remote, fetch brings the chains and the changes that moved, and push shares changes.
  • pull fetches, then catches up.
  • The remote's event cursor is kept with its generation; setting a new remote forgets it. Fetching never changes your files.

Review fixes: a failed clone into an empty directory empties it again. clone canonicalizes its root, can create missing parent directories, and on failure removes exactly what it created, never a dangling symlink it was given. Proved with focused tests that fail without their fix.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57a305fa-3dd6-43fa-915c-3a7198ae5d41
Commits

Reviewing files that changed from the base of the PR and between 05a6e71 and 35be168.

Files selected for processing: 10

  • AGENTS.md
  • README.md
  • apps/origin-src/src/cli.rs
  • apps/origin-src/src/sync.rs
  • apps/origin-src/src/workspace/land.rs
  • apps/origin-src/src/workspace/mod.rs
  • apps/origin-src/src/workspace/registry.rs
  • apps/origin-src/src/workspace/remote.rs
  • apps/origin-src/tests/common/mod.rs
  • apps/origin-src/tests/sync.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/sync-commands branch 3 times, most recently from 85363c0 to f5a9828 Compare November 22, 2026 18:54
A repository has at most one remote, named in `.origin/remote`, which its
workspaces share. `origin clone <url> [<path>] [--target <target>]`
creates a repository that follows `policy` and one target, and starts a
change on its tip: only that snapshot is fetched. Whenever a command
needs a snapshot the repository lacks, such as a checkout, a diff or a
merge, it's fetched from the remote, skipping what the working copy
already holds. A move fetches what it needs before it publishes its
`moving` marker, so a move that cannot fetch changes nothing.

`origin remote [<url>]` shows or sets the remote, `origin fetch
[--target <t>]... [--change <id>]...` fetches the chains followed and the
records of the changes that moved, `origin push [<change>]...` shares
changes, and `origin pull` fetches first. The remote's event cursor as
of the last fetch is kept in `.origin/remote-cursor`, with its op log's
generation; setting a new remote forgets it. Fetching never changes the
files under a workspace.

A clone canonicalizes its root, creates missing parents, and on failure
removes exactly what it created, or empties the directory it found
empty, never a dangling symlink it was given. `show` prints a change's
full id, which `fetch --change` takes.
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