ServicesCatalogHTTP APICommits

Find merge bases

POST
/api/catalog/projects/{project_id}/commits/merge-bases

Return all best common ancestors of two commits. When the history has more than one best common ancestor, the response contains all of them. An empty list means that the histories are not related. 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
left*||

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

right*||

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

Response Body

Success

application/json
  1. response

All best common ancestors of the two resolved commits. Empty means unrelated histories; multiple bases are preserved rather than arbitrarily choosing one.

leftCommitId*catalog.CommitId

Immutable UUIDv7 project commit identity.

Formatuuid
mergeBaseCommitIds*array<>
rightCommitId*catalog.CommitId

Immutable UUIDv7 project commit identity.

Formatuuid
curl -X POST 'https://api.spiraldb.dev/api/catalog/projects/string/commits/merge-bases' \  -H 'Content-Type: application/json' \  -d '{  "left": {    "branch": {      "branch": "string"    },    "type": "branch"  },  "right": {    "branch": {      "branch": "string"    },    "type": "branch"  }}'
{  "leftCommitId": "975da972-7690-498d-b121-d5957a16ab54",  "mergeBaseCommitIds": [    "ad0efc5e-539b-4d2f-a07b-3e96d5a599c9"  ],  "rightCommitId": "a9e8d0a4-9811-4f7d-b26a-68c77023e273"}