# dev.knotless.getCompare

> The repositories a pull into a repository can come from, itself and its forks, and, given a branch, what that branch has since it left the base, as a pull from it would show. No authentication; responses are not personalized.

- Kind: query
- Authority: knotless.dev
- Lexicon: 1
- Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.getCompare)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.getCompare/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.getCompare/analytics)

## Query (`dev.knotless.getCompare`)

Type: query · GET

### Parameters (query string)

- `base` (string): The branch to merge into; the default branch if not given.
  - Constraints: maxLength: 1024
- `branch` (string): The branch to bring in. Without one, only the repositories are answered.
  - Constraints: maxLength: 1024
- `head` (string · at-uri): The repository the branch is on: this one, if not given, or a fork of it.
- `repo` (string · at-uri, required): The repository to merge into: its dev.knotless.repo record. Its authority may be a handle.

### Output (application/json)

- `changes` (ref): What the branch brings in, given one.
  - Reference: `dev.knotless.defs#changesView`
- `heads` (array, required): The repositories a pull can come from: this one first, then its forks the index knows, oldest first.
  - `items` (ref)
    - Reference: `dev.knotless.defs#repoViewBasic`

### Errors

- `NotFound`: No such repository, or no such branch on either.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "The repositories a pull into a repository can come from, itself and its forks, and, given a branch, what that branch has since it left the base, as a pull from it would show. No authentication; responses are not personalized.",
      "errors": [
        {
          "description": "No such repository, or no such branch on either.",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "changes": {
              "description": "What the branch brings in, given one.",
              "ref": "dev.knotless.defs#changesView",
              "type": "ref"
            },
            "heads": {
              "description": "The repositories a pull can come from: this one first, then its forks the index knows, oldest first.",
              "items": {
                "ref": "dev.knotless.defs#repoViewBasic",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "heads"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "base": {
            "description": "The branch to merge into; the default branch if not given.",
            "maxLength": 1024,
            "type": "string"
          },
          "branch": {
            "description": "The branch to bring in. Without one, only the repositories are answered.",
            "maxLength": 1024,
            "type": "string"
          },
          "head": {
            "description": "The repository the branch is on: this one, if not given, or a fork of it.",
            "format": "at-uri",
            "type": "string"
          },
          "repo": {
            "description": "The repository to merge into: its dev.knotless.repo record. Its authority may be a handle.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "repo"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "description": "What a pull from a branch would bring into a repository, before it is opened.",
  "id": "dev.knotless.getCompare",
  "lexicon": 1
}
```
