# swarmops ancestry

> Release: 0.11.0 · Last changed: 2026-11-09 · Source: https://github.com/KeiaiLab/SwarmOps/blob/stable/docs/reference/commands/ancestry.md

Compare two revisions' ancestry along every parent: whether FROM is an ancestor of TO, their merge bases, and a page of the changesets TO reaches and FROM does not.

```yaml
title: "swarmops ancestry"
description: "Compare two revisions' ancestry along every parent: whether FROM is an ancestor of TO, their merge bases, and a page of the changesets TO reaches and FROM does not."
group: "read"
since: "0.9.0"
mutates: false
identity_required: false
mcp_tool: "ancestry"
envelope_op: "ancestry"
exit_codes: [0]
errors: []
syntax: "swarmops ancestry [OPTIONS] <FROM> <TO>"
```

## Syntax

```text
swarmops ancestry [OPTIONS] <FROM> <TO>
```

## Required arguments

### `FROM`

Syntax: `<FROM>`.

The first revision: the ancestor asked about, and the side the list leaves out.

### `TO`

Syntax: `<TO>`.

The second revision: the side whose changesets the list holds.

## Optional arguments

The command also takes the [global options](../cli.md#global-options).

### `--limit`

Syntax: `-n, --limit <N>`.
Default: `50`.

The most changesets to list, 0 to 1,000: 0 lists none.

### `--cursor`

Syntax: `--cursor <CURSOR>`.

Resume the list: the previous page's cursor, exactly as it was returned, with the same FROM and TO.

## Examples

### CLI

No recorded example yet.

### MCP

No recorded example yet.

## Return information

`result` is a `AncestryResp` (`swarmops schema AncestryResp` prints its JSON Schema).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string or null` | no | When more entries follow: where the next page continues. Opaque: pass it back as given, as the next request's `cursor`, with the same `from` and `to`. |
| `entries` | `array of ChangesetSummary` | yes | The changesets `to` reaches and `from` does not, after the request's cursor. |
| `from` | `string` | yes | The full id `from` named. |
| `is_ancestor` | `boolean` | yes | Whether `from` is an ancestor of `to` along any parents; a changeset is its own. |
| `merge_bases` | `array of string` | yes | The merge bases: the common ancestors that no other common ancestor reaches, at most 64; `from` alone when it is an ancestor of `to`, none when the two share no history. |
| `merge_bases_truncated` | `boolean` | yes | Whether there are more merge bases than the 64 listed. |
| `to` | `string` | yes | The full id `to` named. |

Envelope `op`: `ancestry`.

Exit codes:

- `0`: Success.

## Errors

No golden step shows this command failing yet.

Any command that opens a store may also fail with a store error, such as [`E_NOT_A_REPO`](../errors.md#e_not_a_repo), [`E_IO`](../errors.md#e_io) or [`E_STORE_CORRUPT`](../errors.md#e_store_corrupt); a command line the grammar refuses is [`E_INVALID_ARG`](../errors.md#e_invalid_arg) (exit 2).

## See also

- [`swarmops blob get`](blob-get.md)
- [`swarmops resolve`](resolve.md)
- [`swarmops cat`](cat.md)
- [`swarmops ls`](ls.md)
- [`swarmops show`](show.md)
- [`swarmops log`](log.md)
- [`swarmops history`](history.md)
- [`swarmops diff`](diff.md)
- [`swarmops merge-base`](merge-base.md)
- [CLI reference](../cli.md)
- [Error codes](../errors.md)
