Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ $ uvx --from 'vcspull' --prerelease allow vcspull
_Notes on upcoming releases will be added here_
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->

### Breaking changes

#### Structural project containment replaces `vcspull trust` (#619)

{ref}`Configuration scope resolution <config-scopes>` now enforces structural
project containment ({ref}`ADR 0002 <adr-structural-project-containment>`)
instead of interactive or stateful directory trust:

- Upward-walked `.vcspull.{yaml,yml,json}` project files whose checkout
destinations stay at or beneath their own directory continue to load
automatically.
- Discovered project files with destinations outside their own directory are
skipped with a one-line warning naming `-f FILE` and user configuration (or
silently when `--json` / `--ndjson` writes to `stdout`), and appear in
{ref}`cli-config` (`vcspull config ls`) as `(outside directory, skipped)`.
- `vcspull trust`, `--trust-project`, `VCSPULL_YES`,
`$XDG_STATE_HOME/vcspull/trusted`, and `vcspull.config.ensure_config_trusted`
are removed; {func}`~vcspull.config.project_config_contained` replaces
`ensure_config_trusted` for configuration writers, and {ref}`migration` covers
switching cross-directory manifests to `-f FILE` or `~/.config/vcspull/`.

### Fixes

#### Symlinked user configuration deduplication (#600)
Expand Down Expand Up @@ -154,8 +175,8 @@ remaining entries (#598).

vcspull v1.70.0 resolves configuration across system, user, and ancestor
project scopes ({ref}`config-scopes`) with consent-gated project checkouts,
adding {ref}`cli-config` (`vcspull config ls`) and {ref}`cli-trust` (`vcspull
trust`). {ref}`cli-sync` updates matched repositories concurrently by default
adding {ref}`cli-config` (`vcspull config ls`) and `vcspull trust`.
{ref}`cli-sync` updates matched repositories concurrently by default
with `--jobs` (`-j`) and a multi-row terminal progress footer, while
{ref}`cli-fmt` adds `--style {concise,standard,verbose}` to convert entries
across URL strings, standard mappings, and verbose remote definitions. Public
Expand Down Expand Up @@ -238,16 +259,16 @@ Project configurations whose checkout destinations stay inside their own
directory load without prompting. Escaping project configurations require
consent, persisted per project directory in `$XDG_STATE_HOME/vcspull/trusted`
(`~/.local/state/vcspull/trusted` by default). {ref}`cli-config` (`vcspull
config ls`) inspects active files and overrides, {ref}`cli-trust` (`vcspull
trust`) manages trusted project directories, `--no-project`
(`VCSPULL_NO_PROJECT=1`) skips ancestor project files, and `--trust-project`
(`VCSPULL_YES=1`) authorizes escaping project files without prompting.
config ls`) inspects active files and overrides, `vcspull trust` manages trusted
project directories, `--no-project` (`VCSPULL_NO_PROJECT=1`) skips ancestor
project files, and `--trust-project` (`VCSPULL_YES=1`) authorizes escaping
project files without prompting.

In Python, {mod}`vcspull.config` exposes
{func}`~vcspull.config.load_scoped_configs`,
{func}`~vcspull.config.repo_destinations`,
{func}`~vcspull.config.source_escapes`, and
{func}`~vcspull.config.ensure_config_trusted`. CLI commands report actionable
{func}`~vcspull.config.source_escapes`, and `vcspull.config.ensure_config_trusted`.
CLI commands report actionable
{exc}`~vcspull.exc.VCSPullError` failures on stderr as `vcspull: <message>`
instead of a traceback unless `--log-level debug` is set.

Expand Down
41 changes: 38 additions & 3 deletions MIGRATION
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,41 @@ well.

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

### Structural project containment replaces `vcspull trust`

Upward-walked `.vcspull.{yaml,yml,json}` project files are now governed by
structural path containment ({ref}`ADR 0002 <adr-structural-project-containment>`):
project files whose destinations stay inside their own directory load
automatically, while discovered project files targeting paths outside their
directory are skipped with a one-line warning (or silently under `--json` /
`--ndjson`). `vcspull trust`, `--trust-project`, `VCSPULL_YES`,
`$XDG_STATE_HOME/vcspull/trusted`, and `vcspull.config.ensure_config_trusted`
are removed; {func}`vcspull.config.project_config_contained` replaces
`ensure_config_trusted` for configuration writers.

Manifests that intentionally manage checkouts outside their own directory should
be passed explicitly with `--file` or placed (or symlinked) under
`~/.vcspull.yaml` or `~/.config/vcspull/`.

Before:

```console
$ vcspull trust ~/work/meta && vcspull sync --trust-project --all
```

After:

```console
$ vcspull sync --file ~/work/meta/.vcspull.yaml --all
```

Or link the manifest into your user configuration directory so every command
loads it automatically:

```console
$ ln -s ~/work/meta/.vcspull.yaml ~/.config/vcspull/meta.yaml && vcspull sync --all
```

## vcspull 1.70.0 (2026-11-29)

### Exceptions renamed with an `Error` suffix
Expand Down Expand Up @@ -72,9 +107,9 @@ exits `1` when standard input is not a terminal.

Non-interactive callers and CI jobs running inside directories that contain
escaping project configurations can pre-authorize a project directory with
{ref}`vcspull trust <cli-trust>`, pass `--trust-project` (or export
`VCSPULL_YES=1`), pass `--no-project` (or export `VCSPULL_NO_PROJECT=1`) to
skip project configurations, or pass `--file` to load a single explicit file:
`vcspull trust`, pass `--trust-project` (or export `VCSPULL_YES=1`), pass
`--no-project` (or export `VCSPULL_NO_PROJECT=1`) to skip project
configurations, or pass `--file` to load a single explicit file:

```console
$ vcspull --no-project sync --all
Expand Down
6 changes: 3 additions & 3 deletions docs/_ext/vcspull_output_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class VcspullOutputLexer(RegexLexer):
(Token.Comment, '•')
>>> tokens[2]
(Token.Name.Function, 'flask')
>>> [tok for tok in lexer.get_tokens("vcspull trust") if tok[1].strip()]
[(Token.Name.Builtin, 'vcspull'), (Token.Name.Builtin, 'trust')]
>>> [tok for tok in lexer.get_tokens("vcspull config") if tok[1].strip()]
[(Token.Name.Builtin, 'vcspull'), (Token.Name.Builtin, 'config')]
"""

name = "vcspull Output"
Expand Down Expand Up @@ -139,7 +139,7 @@ class VcspullOutputLexer(RegexLexer):
(
(
r"\b(sync|list|add|status|search|discover|fmt|"
r"migrate|import|worktree|config|trust)\b(?=\s|$)"
r"migrate|import|worktree|config)\b(?=\s|$)"
),
Name.Builtin,
),
Expand Down
7 changes: 3 additions & 4 deletions docs/cli/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,9 @@ and the `.vcspull.*` files above your working directory. See
{ref}`config-scopes` for the full order.

`add` writes to your user configuration by default, and falls back to
creating `./.vcspull.yaml` when you have none. When writing to an existing
`./.vcspull.yaml` whose entries escape its own directory, pass
`--trust-project` (or export `VCSPULL_YES=1`) to authorize the file without
prompting.
creating `./.vcspull.yaml` when you have none. When an existing
`./.vcspull.yaml` targets paths outside its own directory, pass `-f` / `--file`
to modify it explicitly.

Specify a file explicitly with `-f/--file`:

Expand Down
23 changes: 8 additions & 15 deletions docs/cli/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
vcspull rarely reads just one file. `vcspull config ls` answers the question
that follows from that: standing here, which files are in effect, and which
one wins? Reach for it when `vcspull sync` picks up a repository you did not
expect, or refuses one you did.
expect, or skips a project file you did.

## Command

Expand All @@ -32,27 +32,20 @@ Rows run weakest to strongest, the same order
declares; "overridden" is how many of those a nearer file replaced. The final
line is the total you will actually sync.

## Diagnosing a refusal
## Diagnosing a skipped project file

A project config that would check a repository out beyond its own directory
needs {ref}`trust <cli-trust>` before it loads. `config ls` shows it rather
than dropping it, and never prompts — this is the command you run *because*
something else refused:
A discovered project config whose destinations resolve outside its own directory
is skipped during {ref}`scope resolution <config-scopes>`. `config ls` keeps it
visible in place rather than omitting it, so you can see why its entries are not
in effect:

```vcspull-output
user ~/.vcspull.yaml 2 repos
project ~/work/proj/.vcspull.yaml 1 repo
project ~/work/proj/escaping/.vcspull.yaml 1 repo (untrusted)
project ~/work/proj/escaping/.vcspull.yaml 1 repo (outside directory, skipped)

3 repositories in effect.
Untrusted configs are not loaded. Allow one with 'vcspull trust DIR'.
```

Pass `--trust-project` (or export `VCSPULL_YES=1`) to preview effective counts
as if untrusted project configs were authorized:

```console
$ vcspull config ls --trust-project
Skipped project configs target paths outside their directory; pass '-f FILE' or link them in user config.
```

## Ignoring the project scope
Expand Down
15 changes: 5 additions & 10 deletions docs/cli/discover.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ it when consolidating checkouts or standardizing workspace labels:
$ vcspull discover ~ --recursive --workspace ~/code/ --yes
```

## Choosing configuration files and project trust
## Choosing configuration files

Specify a target configuration file with `--file` (`-f`):

Expand All @@ -150,15 +150,10 @@ $ vcspull discover ~/company \
```

Without `--file`, `discover` writes to `~/.vcspull.yaml` when present, or falls
back to `./.vcspull.yaml` (creating the file if it does not exist). When writing
to an existing project-scoped `.vcspull.yaml` whose entries escape its own
directory, vcspull runs the {ref}`project trust check <config-scopes>` first;
pass `--trust-project` (or export `VCSPULL_YES=1`) to authorize it without
prompting in automation:

```console
$ vcspull discover . --yes --trust-project
```
back to `./.vcspull.yaml` (creating the file if it does not exist). When an
existing project-scoped `.vcspull.yaml` targets paths outside its own directory,
vcspull enforces {ref}`project containment <config-scopes>` and requires
`--file` (`-f`) to modify that file explicitly.

## Repository detection

Expand Down
6 changes: 3 additions & 3 deletions docs/cli/fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ files. Each formatted file is reported individually:
$ vcspull fmt --all --write
```

Pass `--no-project` (`VCSPULL_NO_PROJECT=1`) to skip ancestor project files, or
`--trust-project` (`VCSPULL_YES=1`) to authorize discovered project files whose
destinations escape their directory without prompting:
Pass `--no-project` (`VCSPULL_NO_PROJECT=1`) to skip ancestor project files
(project files targeting paths outside their directory are skipped automatically
unless named with `--file`):

```console
$ vcspull fmt --all --no-project --write
Expand Down
13 changes: 1 addition & 12 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@
{ref}`vcspull config <cli-config>` shows which config files are in effect.
:::

:::{grid-item-card} Trust
:link: trust
:link-type: doc
{ref}`vcspull trust <cli-trust>` allows a project config to act outside its directory.
:::

:::{grid-item-card} Completion
:link: completion
:link-type: doc
Expand All @@ -102,7 +96,6 @@ worktree/index
fmt
migrate
config
trust
```

```{toctree}
Expand All @@ -124,10 +117,6 @@ Top-level options apply across subcommands:
- `--no-project` (or `VCSPULL_NO_PROJECT=1`) skips ancestor `.vcspull.*` files
during {ref}`scope resolution <config-scopes>`. Accepted before or after any
subcommand that resolves configuration scopes.
- `--trust-project` (or `VCSPULL_YES=1`) authorizes project configurations whose
checkout destinations resolve outside their own directory without prompting;
see {ref}`cli-trust`. Accepted before or after any subcommand that acts on
project configurations.

(cli-main)=

Expand All @@ -144,5 +133,5 @@ Top-level options apply across subcommands:
:no-description:

subparser_name : @replace
See :ref:`cli-sync`, :ref:`cli-add`, :ref:`cli-import`, :ref:`cli-discover`, :ref:`cli-list`, :ref:`cli-search`, :ref:`cli-status`, :ref:`cli-worktree`, :ref:`cli-fmt`, :ref:`cli-migrate`, :ref:`cli-config`, :ref:`cli-trust`
See :ref:`cli-sync`, :ref:`cli-add`, :ref:`cli-import`, :ref:`cli-discover`, :ref:`cli-list`, :ref:`cli-search`, :ref:`cli-status`, :ref:`cli-worktree`, :ref:`cli-fmt`, :ref:`cli-migrate`, :ref:`cli-config`
```
7 changes: 1 addition & 6 deletions docs/cli/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,12 @@ $ vcspull list --file ~/projects/.vcspull.yaml
```

Skip ancestor `.vcspull.*` project configs with `--no-project` (or export
`VCSPULL_NO_PROJECT=1`), and authorize escaping project configs without
prompting with `--trust-project` (or export `VCSPULL_YES=1`):
`VCSPULL_NO_PROJECT=1`):

```console
$ vcspull list --no-project
```

```console
$ vcspull list --trust-project
```

## Workspace filtering

Filter repositories by workspace root with `-w/--workspace/--workspace-root`:
Expand Down
6 changes: 3 additions & 3 deletions docs/cli/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ files:
$ vcspull migrate --all --write
```

Pass `--no-project` (`VCSPULL_NO_PROJECT=1`) to skip ancestor project files, or
`--trust-project` (`VCSPULL_YES=1`) to authorize discovered project files whose
destinations escape their directory without prompting:
Pass `--no-project` (`VCSPULL_NO_PROJECT=1`) to skip ancestor project files
(project files targeting paths outside their directory are skipped automatically
unless named with `--file`):

```console
$ vcspull migrate --all --no-project --write
Expand Down
5 changes: 2 additions & 3 deletions docs/cli/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ $ vcspull search --ndjson django
## Choosing configuration files and workspace filtering

By default, `search` unions every active {ref}`configuration scope <config-scopes>`.
Replace the stack with a single file via `--file` (`-f`), skip ancestor project
configs with `--no-project` (`VCSPULL_NO_PROJECT=1`), or authorize escaping
project configs non-interactively with `--trust-project` (`VCSPULL_YES=1`):
Replace the stack with a single file via `--file` (`-f`), or skip ancestor
project configs with `--no-project` (`VCSPULL_NO_PROJECT=1`):

```console
$ vcspull search --file ~/projects/.vcspull.yaml django
Expand Down
7 changes: 1 addition & 6 deletions docs/cli/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,12 @@ $ vcspull status --file ~/projects/.vcspull.yaml
```

Skip ancestor `.vcspull.*` project configs with `--no-project`
(`VCSPULL_NO_PROJECT=1`), or authorize escaping project configs without
prompting with `--trust-project` (`VCSPULL_YES=1`):
(`VCSPULL_NO_PROJECT=1`):

```console
$ vcspull status --no-project
```

```console
$ vcspull status --trust-project
```

## Workspace filtering

Filter repositories by workspace root with `-w/--workspace` or `--workspace-root`:
Expand Down
8 changes: 1 addition & 7 deletions docs/cli/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,12 @@ $ vcspull sync --file ~/projects/.vcspull.yaml --all
```

Ignore ancestor project configs for one run with `--no-project`
(`VCSPULL_NO_PROJECT=1`), or pre-authorize an escaping project config in CI
with `--trust-project` (`VCSPULL_YES=1`; see {ref}`cli-trust` — this never
authorizes `dirty: discard`):
(`VCSPULL_NO_PROJECT=1`):

```console
$ vcspull sync --no-project --all
```

```console
$ vcspull sync --trust-project --all
```

## Workspace filtering

Filter repositories by workspace root with `-w`, `--workspace`, or
Expand Down
Loading