ServicesCatalogHTTP APICommits

Compare two commits

POST
/api/catalog/projects/{project_id}/commits/compare

Compare a base and a head commit. The response contains the exact number of commits that each side has and the other does not, and a bounded part of the graph that only the head has. When the comparison is larger than the traversal limits, the response is CommitTraversalLimitExceeded. You must have permission to read the project.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Path Parameters

project_id*string

Owning project identifier. Nonempty, at most 128 UTF-8 bytes, with no control characters. Project creation belongs to the project service.

Request Body

application/json
  1. body
base*||

A commit identity or a movable branch/immutable tag resolved exactly once per request. Relative expressions such as main~3 are not supported.

head*||

A commit identity or a movable branch/immutable tag resolved exactly once per request. Relative expressions such as main~3 are not supported.

maxCommits?|null

Response Body

Success

application/json
  1. response

Exact ahead/behind counts and bounded head-only commit graph. Counts serialize as unsigned decimal strings. continuationCommitIds is a graph frontier with the same duplicate-handling responsibility and 1000-identity bound as CommitLog; it is not a page token. Internal traversal is bounded to 100000 commits per side and exceeding that bound is a named error.

aheadCount*|
baseCommitId*catalog.CommitId

Immutable UUIDv7 project commit identity.

Formatuuid
behindCount*|
commits*array<>
continuationCommitIds*array<>
headCommitId*catalog.CommitId

Immutable UUIDv7 project commit identity.

Formatuuid
mergeBaseCommitIds*array<>
truncated*boolean
curl -X POST 'https://api.spiraldb.dev/api/catalog/projects/string/commits/compare' \  -H 'Content-Type: application/json' \  -d '{  "base": {    "branch": {      "branch": "string"    },    "type": "branch"  },  "head": {    "branch": {      "branch": "string"    },    "type": "branch"  }}'
{  "aheadCount": "string",  "baseCommitId": "444e6d44-c77c-4d6f-9c8c-82cfd8252d0c",  "behindCount": "string",  "commits": [    {      "actor": "string",      "commitId": "a1b223ee-0195-4e35-9b2a-72c93f345117",      "committedAtMicros": "string",      "message": "string",      "namespaceChangeCount": 0,      "parentCommitIds": [        "2a998c40-3602-476d-9578-67b2702f3d8f"      ],      "resourceChangeCount": 0,      "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc"    }  ],  "continuationCommitIds": [    "438269c6-dafc-41eb-a1b7-225881b25a61"  ],  "headCommitId": "ccbbf3ab-15f4-491f-bfd0-0193cd890679",  "mergeBaseCommitIds": [    "ad0efc5e-539b-4d2f-a07b-3e96d5a599c9"  ],  "truncated": true}