# Migration notes

Migration and deprecation notes for vcspull are here, see {ref}`changelog` as
well.

```{admonition} Welcome on board! 👋
1. 📌 For safety, **always** pin the package
2. 📖 Check the migration notes _(You are here)_
3. 📣 If you feel something got deprecated and it interrupted you - past, present, or future - voice your opinion on the [tracker].

   We want to make vcspull fun, reliable, and useful for users.

   API changes can be painful.

   If we can do something to draw the sting, we'll do it. We're taking a balanced approach. That's why these notes are here!

   (Please pin the package. 🙏)

   [tracker]: https://github.com/vcs-python/vcspull/discussions
```

## Next release

<!-- Maintainers, insert changes / features for the next release here -->

## vcspull 1.69.0 (2026-11-28)

### Bounded CLI synchronization

CLI sync requires POSIX process-group ownership. Timeouts and Ctrl-C stop
the worker and its native descendants before the command continues or exits.
Interrupted JSON/NDJSON events report unknown state and `retained_recoveries`
discovered by a separately bounded inspection. Discovery can include tokens
from earlier operations; it does not restore or release them automatically.
The same ownership applies to `sync --include-worktrees` and `worktree sync`.
Each linked checkout has a separate deadline; standalone `worktree sync`
accepts `--timeout`. A timed-out worktree prevents further worktrees for that
repository from starting. Interrupted worktree metadata remains unknown when
the worker did not return it.

### Guarded worktree creation

Worktree creation fetches configured remotes before selecting its initial
target. A failed requested worktree lock returns an error with completed
creation state; inspect that result before retrying an occupied destination.

### Explicit checkout policy and sync results

The main checkout passes its selector kind, remote, and `sync` policy to
libvcs. Git defaults to aborting on local changes; choose `dirty: preserve`
to retain and restore them. Configuring `dirty: discard` also requires
`vcspull sync --yes` on each invocation.

Python callers of `vcspull.cli.sync.update_repo` receive `SyncExecution`:
use `.project` for the backend instance and `.result` for its complete
`SyncResult`. Failures still raise `SyncFailedError`, whose `.result` now
retains recovery tokens, conflicts, and operation outcomes. Programmatic
discard requires `yes=True`.

### Exact numeric values

Integer configuration fields accept values up to `9007199254740991`
(`2**53 - 1`), so Python and JavaScript editors validate the same values.
For a larger Git filter limit, use a native string such as
`filter: "tree:18446744073709551615"` or a quoted `blob:limit` mapping's
`limit`. These strings retain Git's full uint64 range. Quote large revision
identifiers as strings. Metadata remains ordinary JSON-compatible data.

### Stable URL inference

Backend inference uses ASCII word and digit classes on every supported Python
version. Unprefixed SCP URLs whose path starts with a non-ASCII character,
such as `host:éx`, need `vcs: git` or an explicit `git+ssh://host/éx` URL.
Unicode hostnames and other path characters remain supported. Explicit backend
settings continue to resolve unknown or ambiguous URLs.

### Separate checkout targets and backend options

Run {ref}`cli-migrate` once to move both top-level tuning and the `options`
block into the canonical layout:

```console
$ vcspull migrate --write
```

Before:

```yaml
~/code/:
  libvcs:
    repo: git+https://github.com/vcs-python/libvcs.git
    options:
      rev: v0.46.0
      depth: 50
      pin:
        import: true
```

After:

```yaml
~/code/:
  libvcs:
    repo: git+https://github.com/vcs-python/libvcs.git
    working_copy:
      rev: v0.46.0
    git:
      depth: 50
    pin:
      import: true
```

`shallow: true` becomes `git.depth: 1`. `git_options`, `hg_options`, and
`svn_options` become `git`, `hg`, and `svn`. `pin_reason` and
`allow_overwrite` move from `options` to the entry level alongside `pin`.
Existing canonical values take precedence. Every supplied setting is
validated before precedence applies, including overridden values. Unknown
legacy `options` keys produce an error before the file is written. Remove
invalid values instead of relying on another field to hide them. Both `url`
and `repo` must be valid strings when present; `url` still takes precedence.
Metadata must contain JSON-compatible values with string keys.

`add` and `discover` write the canonical layout. `import` and `fmt` migrate
entries they rewrite; entries pinned for that command stay unchanged. Use
`migrate --write` to upgrade every entry, including pinned entries.

Loading normalizes the same legacy locations in memory and warns once per
file. Unknown entry or backend fields now fail during loading; metadata
belongs in `metadata`, not in a libvcs constructor argument. Sync constructs
the matching immutable libvcs options object from `git`, `hg`, or `svn`.

To omit historical file contents without truncating commit history, add
`git.filter: blob:none`. The value can also be an atomic native filter
string, a kind-tagged mapping, or a nonempty list of filters. Express combined
filters as `{kind: combine, filters: [blob:none, "tree:3"]}` or nested lists;
`vcspull migrate --write` converts native `combine:` strings to that form.
Filter and depth changes only affect a new clone; they do not reconfigure an
existing checkout.

## vcspull 1.62.0 (2026-05-31)

### Per-repository sync keys moved under `options:`

_via #552_

The per-repository `rev`, `shallow`, and the new `depth` keys are now written
under an `options:` block instead of the repository entry root. The top-level
form still loads, but {ref}`vcspull sync <cli-sync>` now warns when it reads
it and points you here. Rewrite your configs in place:

```console
$ vcspull migrate --write
```

Before:

```yaml
~/code/:
  flask:
    repo: git+https://github.com/pallets/flask.git
    shallow: true
```

After:

```yaml
~/code/:
  flask:
    repo: git+https://github.com/pallets/flask.git
    options:
      shallow: true
```

`depth: N` is new — record a numeric clone depth (`git clone --depth N`) when a
boolean `shallow` (depth 1) is too little. See {ref}`configuration` and
{ref}`cli-migrate`.

## vcspull 1.15.4 (2022-10-16)

### Completions for `-c` / `--config` files

_via #403_

After updating, you can re-run [shtab]'s setup (see the
{ref}`completions page <cli-completions>`) completion of:

```console
$ vcspull sync -c [tab]
```

```console
$ vcspull sync --config [tab]
```

## vcspull 1.15.0 (2022-10-09)

### Completions have changed

_via #400_

Completions now use a different tool: [shtab]. See the
{ref}`completions page <cli-completions>` for more information.

If you were using earlier versions of vcspull (earlier than 1.15.0), you may need to uninstall the old completions, first.

[shtab]: https://docs.iterative.ai/shtab/

## vcspull v1.13.0 (2022-09-25)

### Pulling all repositories

_via #394_

Empty command will now show help output

```console
$ vcspull sync
Usage: vcspull sync [OPTIONS] [REPO_TERMS]...

Options:
-c, --config PATH Specify config
-x, --exit-on-error Exit immediately when encountering an error syncing
multiple repos
-h, --help Show this message and exit.
```

To achieve the equivalent behavior of syncing all repos, pass `'*'`:

```console
$ vcspull sync '*'
```

Depending on how shell escaping works in your shell setup with [wild card / asterisk], you may not need to quote `*`.

[wild card / asterisk]: https://tldp.org/LDP/abs/html/special-chars.html#:~:text=wild%20card%20%5Basterisk%5D.

### Terms with no match in config will show a notice

_via #394_

> No repo found in config(s) for "non_existent_repo"

- Syncing will now skip to the next repos if an error is encountered

- Learned `--exit-on-error` / `-x`

Usage:

```console
$ vcspull sync --exit-on-error grako django
```

Print traceback for errored repos:

```console
$ vcspull --log-level DEBUG sync --exit-on-error grako django
```

### Untracked files

_via https://github.com/vcs-python/libvcs/pull/425_

Syncing in git repositories with untracked files has been improved (via libvcs
0.17)

<!---
# vim: set filetype=markdown:
-->
