diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19358afd3..fe6cefd41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [EE] Added mermaid diagram rendering to Ask Sourcebot answers, with pan/zoom, copy/export, in-thread deep links, and an interleaved right-panel view. [#1369](https://github.com/sourcebot-dev/sourcebot/pull/1369)
- [EE] Added a context-window usage gauge to the Ask Sourcebot chat details, showing how much of the selected model's context window each turn occupies. Window sizes are resolved from the models.dev catalog. [#1370](https://github.com/sourcebot-dev/sourcebot/pull/1370)
- Added language model input-modality and document capability resolution, automatically resolved from the models.dev catalog (falls back to text-only for uncatalogued/self-hosted models). [#1372](https://github.com/sourcebot-dev/sourcebot/pull/1372)
+- Added `revisions.branchSort` and `revisions.tagSort` config options for controlling which matching refs are indexed first. [#1379](https://github.com/sourcebot-dev/sourcebot/pull/1379)
### Fixed
- Send anonymous server-side PostHog events as personless so unauthenticated requests don't inflate person counts. [#1367](https://github.com/sourcebot-dev/sourcebot/pull/1367)
diff --git a/docs/docs/features/search/multi-branch-indexing.mdx b/docs/docs/features/search/multi-branch-indexing.mdx
index 9857ed3c0..de8891286 100644
--- a/docs/docs/features/search/multi-branch-indexing.mdx
+++ b/docs/docs/features/search/multi-branch-indexing.mdx
@@ -12,7 +12,7 @@ By default, only the default branch of a repository is indexed and can be search
## Configuration
-Multi-branch indexing is currently limited to 64 branches and tags. Please see [this issue](https://github.com/sourcebot-dev/sourcebot/issues/461) for more details.
+Multi-branch indexing is currently limited to 64 total revisions per repository, including the default branch. Sourcebot indexes the default branch first, then matching branches, then matching tags. Please see [this issue](https://github.com/sourcebot-dev/sourcebot/issues/461) for more details.
Multi-branch indexing is configured in the [connection](/docs/connections/indexing-your-code) using the `revisions.branches` and `revisions.tags` arrays. Glob patterns are supported. For example:
@@ -39,6 +39,8 @@ Multi-branch indexing is configured in the [connection](/docs/connections/indexi
// Glob patterns
"feature/*" // Matches: feature/auth, feature/ui, etc.
],
+ // Optional. Defaults to "committerdate" (newest first).
+ "branchSort": "committerdate",
// These tags (if they exist):
"tags": [
@@ -48,14 +50,19 @@ Multi-branch indexing is configured in the [connection](/docs/connections/indexi
// Glob patterns
"v3.*.*", // Matches: v3.0.0, v3.0.1, etc.
"rc-*" // Matches: rc-1, rc-2, etc.
- ]
+ ],
+ // Optional. Defaults to "creatordate" (newest first).
+ "tagSort": "creatordate"
}
}
}
}
```
-For each repo defined in the connection, any branches or tags matching the patterns in `branches` and `tags` array will be indexed.
+For each repo defined in the connection, any branches or tags matching the patterns in the `branches` and `tags` arrays will be considered for indexing.
+When more matching refs exist than can be indexed, Sourcebot keeps the default branch first, then adds matching branches using `branchSort`, then adds matching tags using `tagSort`, and finally truncates the combined list to 64 total revisions. If matching branches fill the revision budget, matching tags may be skipped.
+
+Supported sort values are `committerdate`, `creatordate`, and `refname`. These map to Git `for-each-ref` sort keys. Date-based sorts use newest-first ordering; `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
## Search syntax
@@ -91,4 +98,3 @@ Additional info:
| Gitea | ✅ |
| Gerrit | ✅ |
| Generic git host | ✅ |
-
diff --git a/docs/snippets/schemas/v3/azuredevops.schema.mdx b/docs/snippets/schemas/v3/azuredevops.schema.mdx
index b3b3d282c..82330597a 100644
--- a/docs/snippets/schemas/v3/azuredevops.schema.mdx
+++ b/docs/snippets/schemas/v3/azuredevops.schema.mdx
@@ -151,11 +151,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -170,9 +170,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -186,6 +196,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/bitbucket.schema.mdx b/docs/snippets/schemas/v3/bitbucket.schema.mdx
index 56895a892..656e193b5 100644
--- a/docs/snippets/schemas/v3/bitbucket.schema.mdx
+++ b/docs/snippets/schemas/v3/bitbucket.schema.mdx
@@ -124,11 +124,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -143,9 +143,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -159,6 +169,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/connection.schema.mdx b/docs/snippets/schemas/v3/connection.schema.mdx
index 4671abf74..2c66098ed 100644
--- a/docs/snippets/schemas/v3/connection.schema.mdx
+++ b/docs/snippets/schemas/v3/connection.schema.mdx
@@ -167,11 +167,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -186,9 +186,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -202,6 +212,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -378,11 +398,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -397,9 +417,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -413,6 +443,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -542,11 +582,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -561,9 +601,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -577,6 +627,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -658,11 +718,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -677,9 +737,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -693,6 +763,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -837,11 +917,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -856,9 +936,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -872,6 +962,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1054,11 +1154,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1073,9 +1173,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1089,6 +1199,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1132,11 +1252,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1151,9 +1271,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1167,6 +1297,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/genericGitHost.schema.mdx b/docs/snippets/schemas/v3/genericGitHost.schema.mdx
index e9c4b1195..cd44a82a2 100644
--- a/docs/snippets/schemas/v3/genericGitHost.schema.mdx
+++ b/docs/snippets/schemas/v3/genericGitHost.schema.mdx
@@ -22,11 +22,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -41,9 +41,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -57,6 +67,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/gerrit.schema.mdx b/docs/snippets/schemas/v3/gerrit.schema.mdx
index cfffb2ec5..18f490bb7 100644
--- a/docs/snippets/schemas/v3/gerrit.schema.mdx
+++ b/docs/snippets/schemas/v3/gerrit.schema.mdx
@@ -62,11 +62,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -81,9 +81,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -97,6 +107,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/gitea.schema.mdx b/docs/snippets/schemas/v3/gitea.schema.mdx
index 45e034744..1f9d83d15 100644
--- a/docs/snippets/schemas/v3/gitea.schema.mdx
+++ b/docs/snippets/schemas/v3/gitea.schema.mdx
@@ -110,11 +110,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -129,9 +129,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -145,6 +155,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/github.schema.mdx b/docs/snippets/schemas/v3/github.schema.mdx
index 7d731cdc5..f3955a3cb 100644
--- a/docs/snippets/schemas/v3/github.schema.mdx
+++ b/docs/snippets/schemas/v3/github.schema.mdx
@@ -163,11 +163,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -182,9 +182,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -198,6 +208,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/gitlab.schema.mdx b/docs/snippets/schemas/v3/gitlab.schema.mdx
index f911c68a7..1aa497a89 100644
--- a/docs/snippets/schemas/v3/gitlab.schema.mdx
+++ b/docs/snippets/schemas/v3/gitlab.schema.mdx
@@ -157,11 +157,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -176,9 +176,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -192,6 +202,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/index.schema.mdx b/docs/snippets/schemas/v3/index.schema.mdx
index 864359251..d1d89feb0 100644
--- a/docs/snippets/schemas/v3/index.schema.mdx
+++ b/docs/snippets/schemas/v3/index.schema.mdx
@@ -658,11 +658,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -677,9 +677,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -693,6 +703,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -869,11 +889,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -888,9 +908,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -904,6 +934,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1033,11 +1073,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1052,9 +1092,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1068,6 +1118,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1149,11 +1209,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1168,9 +1228,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1184,6 +1254,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1328,11 +1408,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1347,9 +1427,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1363,6 +1453,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1545,11 +1645,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1564,9 +1664,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1580,6 +1690,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1623,11 +1743,11 @@
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1642,9 +1762,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1658,6 +1788,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/docs/snippets/schemas/v3/shared.schema.mdx b/docs/snippets/schemas/v3/shared.schema.mdx
index 270d85b4b..9ed157d55 100644
--- a/docs/snippets/schemas/v3/shared.schema.mdx
+++ b/docs/snippets/schemas/v3/shared.schema.mdx
@@ -36,11 +36,11 @@
},
"GitRevisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -55,9 +55,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -71,6 +81,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/backend/src/git.test.ts b/packages/backend/src/git.test.ts
index c9c32cf57..f695d4295 100644
--- a/packages/backend/src/git.test.ts
+++ b/packages/backend/src/git.test.ts
@@ -92,6 +92,33 @@ describe("git ref ordering", () => {
expect(tags.indexOf("z-newest")).toBeLessThan(tags.indexOf("a-oldest"));
});
+ test("getTags supports sorting by ref name", async () => {
+ const repoPath = await createTempRepo();
+ repoPaths.push(repoPath);
+ runGit(repoPath, ["config", "tag.sort", "creatordate"]);
+
+ await commitFile({
+ repoPath,
+ fileName: "README.md",
+ content: "base\n",
+ message: "initial commit",
+ timestamp: "2024-01-01T00:00:00Z",
+ });
+
+ runGit(repoPath, ["tag", "-a", "a-oldest", "-m", "oldest tag"], {
+ GIT_COMMITTER_DATE: "2024-01-02T00:00:00Z",
+ });
+ runGit(repoPath, ["tag", "-a", "z-newest", "-m", "newest tag"], {
+ GIT_COMMITTER_DATE: "2024-01-03T00:00:00Z",
+ });
+
+ const tags = await getTags(repoPath, { sort: "refname" });
+
+ expect(tags).toContain("a-oldest");
+ expect(tags).toContain("z-newest");
+ expect(tags.indexOf("a-oldest")).toBeLessThan(tags.indexOf("z-newest"));
+ });
+
test("getBranches returns newest branches first by last commit date", async () => {
const repoPath = await createTempRepo();
repoPaths.push(repoPath);
@@ -133,4 +160,47 @@ describe("git ref ordering", () => {
branches.indexOf("aaa-oldest"),
);
});
+
+ test("getBranches supports sorting by ref name", async () => {
+ const repoPath = await createTempRepo();
+ repoPaths.push(repoPath);
+ runGit(repoPath, ["config", "branch.sort", "committerdate"]);
+
+ await commitFile({
+ repoPath,
+ fileName: "README.md",
+ content: "base\n",
+ message: "initial commit",
+ timestamp: "2024-01-01T00:00:00Z",
+ });
+
+ runGit(repoPath, ["checkout", "-b", "aaa-oldest"]);
+ await commitFile({
+ repoPath,
+ fileName: "oldest.txt",
+ content: "oldest\n",
+ message: "oldest branch commit",
+ timestamp: "2024-01-02T00:00:00Z",
+ });
+
+ runGit(repoPath, ["checkout", "main"]);
+ runGit(repoPath, ["checkout", "-b", "zzz-newest"]);
+ await commitFile({
+ repoPath,
+ fileName: "newest.txt",
+ content: "newest\n",
+ message: "newest branch commit",
+ timestamp: "2024-01-03T00:00:00Z",
+ });
+
+ runGit(repoPath, ["checkout", "main"]);
+
+ const branches = await getBranches(repoPath, { sort: "refname" });
+
+ expect(branches).toContain("aaa-oldest");
+ expect(branches).toContain("zzz-newest");
+ expect(branches.indexOf("aaa-oldest")).toBeLessThan(
+ branches.indexOf("zzz-newest"),
+ );
+ });
});
diff --git a/packages/backend/src/git.ts b/packages/backend/src/git.ts
index d827a5714..40acaad7a 100644
--- a/packages/backend/src/git.ts
+++ b/packages/backend/src/git.ts
@@ -305,6 +305,16 @@ const parseRefNames = (refs: string) =>
.map((ref) => ref.trim())
.filter(Boolean);
+type GitRevisionSort = "committerdate" | "creatordate" | "refname";
+
+const toGitSort = (sort: GitRevisionSort) => {
+ if (sort === "refname") {
+ return sort;
+ }
+
+ return `-${sort}`;
+};
+
const getSortedRefs = async ({
path,
sort,
@@ -326,18 +336,28 @@ const getSortedRefs = async ({
);
};
-export const getBranches = async (path: string) => {
+export const getBranches = async (
+ path: string,
+ options: {
+ sort?: GitRevisionSort,
+ } = {},
+) => {
return getSortedRefs({
path,
- sort: "-committerdate",
+ sort: toGitSort(options.sort ?? "committerdate"),
refNamespace: "refs/heads",
});
};
-export const getTags = async (path: string) => {
+export const getTags = async (
+ path: string,
+ options: {
+ sort?: GitRevisionSort,
+ } = {},
+) => {
return getSortedRefs({
path,
- sort: "-creatordate",
+ sort: toGitSort(options.sort ?? "creatordate"),
refNamespace: "refs/tags",
});
};
diff --git a/packages/backend/src/repoCompileUtils.ts b/packages/backend/src/repoCompileUtils.ts
index 04632a796..75df902cc 100644
--- a/packages/backend/src/repoCompileUtils.ts
+++ b/packages/backend/src/repoCompileUtils.ts
@@ -32,6 +32,20 @@ const logger = createLogger('repo-compile-utils');
const MAX_CONCURRENT_GIT_OPERATIONS = 100;
const gitOperationLimit = pLimit(MAX_CONCURRENT_GIT_OPERATIONS);
+const getRevisionMetadata = (
+ revisions: {
+ branches?: string[],
+ tags?: string[],
+ branchSort?: RepoMetadata["branchSort"],
+ tagSort?: RepoMetadata["tagSort"],
+ } | undefined,
+) => ({
+ branches: revisions?.branches ?? undefined,
+ branchSort: revisions?.branchSort ?? undefined,
+ tags: revisions?.tags ?? undefined,
+ tagSort: revisions?.tagSort ?? undefined,
+} satisfies Pick);
+
/**
* Extracts the host with port from an HTTP(S) URL string, preserving the port
* even if it's a default port (e.g., 443 for https, 80 for http).
@@ -68,8 +82,7 @@ export const compileGithubConfig = async (
const record = createGitHubRepoRecord({
repo,
hostUrl,
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ revisions: config.revisions,
})
return {
@@ -91,14 +104,12 @@ export const compileGithubConfig = async (
export const createGitHubRepoRecord = ({
repo,
hostUrl,
- branches,
- tags,
+ revisions,
isAutoCleanupDisabled,
}: {
repo: OctokitRepository,
hostUrl: string,
- branches?: string[],
- tags?: string[],
+ revisions?: Parameters[0],
isAutoCleanupDisabled?: boolean,
}) => {
const repoNameRoot = new URL(hostUrl)
@@ -145,8 +156,7 @@ export const createGitHubRepoRecord = ({
'zoekt.public': marshalBool(isPublic),
'zoekt.display-name': repoDisplayName,
},
- branches,
- tags,
+ ...getRevisionMetadata(revisions),
codeHostMetadata: {
github: {
topics: repo.topics ?? [],
@@ -226,8 +236,7 @@ export const compileGitlabConfig = async (
'zoekt.public': marshalBool(isPublic),
'zoekt.display-name': repoDisplayName,
},
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ ...getRevisionMetadata(config.revisions),
codeHostMetadata: {
gitlab: {
topics: project.topics ?? [],
@@ -301,8 +310,7 @@ export const compileGiteaConfig = async (
'zoekt.public': marshalBool(isPublic),
'zoekt.display-name': repoDisplayName,
},
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ ...getRevisionMetadata(config.revisions),
} satisfies RepoMetadata,
};
@@ -385,8 +393,7 @@ export const compileGerritConfig = async (
'zoekt.public': marshalBool(true),
'zoekt.display-name': repoDisplayName,
},
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ ...getRevisionMetadata(config.revisions),
} satisfies RepoMetadata,
};
@@ -537,8 +544,7 @@ export const compileBitbucketConfig = async (
'zoekt.public': marshalBool(isPublic),
'zoekt.display-name': displayName,
},
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ ...getRevisionMetadata(config.revisions),
...(codeHostType === 'bitbucketCloud' ? {
codeHostMetadata: {
bitbucketCloud: {
@@ -674,8 +680,7 @@ export const compileGenericGitHostConfig_file = async (
}
},
metadata: {
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ ...getRevisionMetadata(config.revisions),
// @NOTE: We don't set a gitConfig here since local repositories
// are readonly.
gitConfig: undefined,
@@ -757,8 +762,7 @@ export const compileGenericGitHostConfig_url = async (
'zoekt.public': marshalBool(true),
'zoekt.display-name': repoName,
},
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ ...getRevisionMetadata(config.revisions),
} satisfies RepoMetadata,
};
@@ -835,8 +839,7 @@ export const compileAzureDevOpsConfig = async (
'zoekt.public': marshalBool(isPublic),
'zoekt.display-name': repoDisplayName,
},
- branches: config.revisions?.branches ?? undefined,
- tags: config.revisions?.tags ?? undefined,
+ ...getRevisionMetadata(config.revisions),
} satisfies RepoMetadata,
};
diff --git a/packages/backend/src/repoIndexManager.test.ts b/packages/backend/src/repoIndexManager.test.ts
index 684f1a826..db6045959 100644
--- a/packages/backend/src/repoIndexManager.test.ts
+++ b/packages/backend/src/repoIndexManager.test.ts
@@ -519,6 +519,113 @@ describe('RepoIndexManager', () => {
expect(revisions).not.toContain('refs/heads/feature/6');
});
+ test('truncates mixed branch and tag revisions after default branch and matching branches', async () => {
+ const matchingBranches = Array.from(
+ { length: 70 },
+ (_, index) => `feature/${String(index + 1).padStart(2, '0')}`,
+ );
+ const repo = createMockRepoWithConnections({
+ metadata: {
+ branches: ['feature/**'],
+ tags: ['v*'],
+ branchSort: 'refname',
+ tagSort: 'refname',
+ },
+ });
+ (existsSync as Mock).mockReturnValue(true);
+ (getBranches as Mock).mockResolvedValue(matchingBranches);
+ (getTags as Mock).mockResolvedValue(['v1.0.0', 'v2.0.0']);
+
+ manager = new RepoIndexManager(mockPrisma, mockSettings, mockRedis, mockPromClient as any);
+
+ (mockPrisma.repoIndexingJob.findUniqueOrThrow as Mock).mockResolvedValue({
+ status: RepoIndexingJobStatus.PENDING,
+ });
+ (mockPrisma.repoIndexingJob.update as Mock).mockResolvedValue({
+ type: RepoIndexingJobType.INDEX,
+ repo,
+ });
+
+ const mockJob = {
+ data: {
+ jobId: 'job-1',
+ type: 'INDEX',
+ repoId: repo.id,
+ repoName: repo.name,
+ },
+ moveToDelayed: vi.fn(),
+ } as unknown as Job;
+
+ const { Worker } = await import('bullmq');
+ const processor = (Worker as unknown as Mock).mock.calls[0][1];
+ await processor(mockJob);
+
+ const revisions = (indexGitRepository as Mock).mock.calls.at(-1)?.[2] as string[];
+
+ expect(getBranches).toHaveBeenCalledWith('/test-data/repos/1', { sort: 'refname' });
+ expect(getTags).toHaveBeenCalledWith('/test-data/repos/1', { sort: 'refname' });
+ expect(revisions).toHaveLength(64);
+ expect(revisions[0]).toBe('refs/heads/main');
+ expect(revisions).toContain('refs/heads/feature/01');
+ expect(revisions).toContain('refs/heads/feature/63');
+ expect(revisions).not.toContain('refs/heads/feature/64');
+ expect(revisions).not.toContain('refs/tags/v1.0.0');
+ expect(revisions).not.toContain('refs/tags/v2.0.0');
+ });
+
+ test('passes configured branch and tag sort values to git ref lookup', async () => {
+ const repo = createMockRepoWithConnections({
+ metadata: {
+ branches: ['release/**'],
+ tags: ['v*'],
+ branchSort: 'refname',
+ tagSort: 'refname',
+ },
+ });
+ (existsSync as Mock).mockReturnValue(true);
+ (getBranches as Mock).mockResolvedValue(['release/1', 'release/2']);
+ (getTags as Mock).mockResolvedValue(['v1.0.0', 'v2.0.0']);
+
+ manager = new RepoIndexManager(mockPrisma, mockSettings, mockRedis, mockPromClient as any);
+
+ (mockPrisma.repoIndexingJob.findUniqueOrThrow as Mock).mockResolvedValue({
+ status: RepoIndexingJobStatus.PENDING,
+ });
+ (mockPrisma.repoIndexingJob.update as Mock).mockResolvedValue({
+ type: RepoIndexingJobType.INDEX,
+ repo,
+ });
+
+ const mockJob = {
+ data: {
+ jobId: 'job-1',
+ type: 'INDEX',
+ repoId: repo.id,
+ repoName: repo.name,
+ },
+ moveToDelayed: vi.fn(),
+ } as unknown as Job;
+
+ const { Worker } = await import('bullmq');
+ const processor = (Worker as unknown as Mock).mock.calls[0][1];
+ await processor(mockJob);
+
+ expect(getBranches).toHaveBeenCalledWith('/test-data/repos/1', { sort: 'refname' });
+ expect(getTags).toHaveBeenCalledWith('/test-data/repos/1', { sort: 'refname' });
+ expect(indexGitRepository).toHaveBeenCalledWith(
+ repo,
+ mockSettings,
+ [
+ 'refs/heads/main',
+ 'refs/heads/release/1',
+ 'refs/heads/release/2',
+ 'refs/tags/v1.0.0',
+ 'refs/tags/v2.0.0',
+ ],
+ expect.any(Object)
+ );
+ });
+
test('updates repo.indexedAt and indexedCommitHash on completion', async () => {
const repo = createMockRepoWithConnections();
(existsSync as Mock).mockReturnValue(true);
diff --git a/packages/backend/src/repoIndexManager.ts b/packages/backend/src/repoIndexManager.ts
index aea1291dc..7e305cd83 100644
--- a/packages/backend/src/repoIndexManager.ts
+++ b/packages/backend/src/repoIndexManager.ts
@@ -471,7 +471,7 @@ export class RepoIndexManager {
if (metadata.branches) {
const branchGlobs = metadata.branches
- const allBranches = await getBranches(repoPath);
+ const allBranches = await getBranches(repoPath, { sort: metadata.branchSort });
const matchingBranches =
allBranches
.filter((branch) => micromatch.isMatch(branch, branchGlobs))
@@ -485,7 +485,7 @@ export class RepoIndexManager {
if (metadata.tags) {
const tagGlobs = metadata.tags;
- const allTags = await getTags(repoPath);
+ const allTags = await getTags(repoPath, { sort: metadata.tagSort });
const matchingTags =
allTags
.filter((tag) => micromatch.isMatch(tag, tagGlobs))
@@ -500,7 +500,7 @@ export class RepoIndexManager {
// De-duplicate revisions to ensure we don't have duplicate branches/tags
revisions = [...new Set(revisions)];
- // zoekt has a limit of 64 branches/tags to index.
+ // zoekt has a limit of 64 total revisions to index, including the default branch.
if (revisions.length > 64) {
logger.warn(`Too many revisions (${revisions.length}) for repo ${repo.id}, truncating to 64`);
captureEvent('backend_revisions_truncated', {
diff --git a/packages/schemas/src/v3/azuredevops.schema.ts b/packages/schemas/src/v3/azuredevops.schema.ts
index 8b730bda5..9f48211c9 100644
--- a/packages/schemas/src/v3/azuredevops.schema.ts
+++ b/packages/schemas/src/v3/azuredevops.schema.ts
@@ -150,11 +150,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -169,9 +169,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -185,6 +195,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/azuredevops.type.ts b/packages/schemas/src/v3/azuredevops.type.ts
index 28f35f1ad..af6f51b0f 100644
--- a/packages/schemas/src/v3/azuredevops.type.ts
+++ b/packages/schemas/src/v3/azuredevops.type.ts
@@ -83,15 +83,23 @@ export interface AzureDevOpsConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
diff --git a/packages/schemas/src/v3/bitbucket.schema.ts b/packages/schemas/src/v3/bitbucket.schema.ts
index 11bbb3221..cb40cd9a4 100644
--- a/packages/schemas/src/v3/bitbucket.schema.ts
+++ b/packages/schemas/src/v3/bitbucket.schema.ts
@@ -123,11 +123,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -142,9 +142,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -158,6 +168,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/bitbucket.type.ts b/packages/schemas/src/v3/bitbucket.type.ts
index ee5647064..b41ec7437 100644
--- a/packages/schemas/src/v3/bitbucket.type.ts
+++ b/packages/schemas/src/v3/bitbucket.type.ts
@@ -78,15 +78,23 @@ export interface BitbucketConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
diff --git a/packages/schemas/src/v3/connection.schema.ts b/packages/schemas/src/v3/connection.schema.ts
index c539e918d..33e7d736e 100644
--- a/packages/schemas/src/v3/connection.schema.ts
+++ b/packages/schemas/src/v3/connection.schema.ts
@@ -166,11 +166,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -185,9 +185,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -201,6 +211,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -377,11 +397,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -396,9 +416,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -412,6 +442,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -541,11 +581,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -560,9 +600,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -576,6 +626,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -657,11 +717,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -676,9 +736,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -692,6 +762,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -836,11 +916,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -855,9 +935,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -871,6 +961,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1053,11 +1153,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1072,9 +1172,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1088,6 +1198,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1131,11 +1251,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1150,9 +1270,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1166,6 +1296,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/connection.type.ts b/packages/schemas/src/v3/connection.type.ts
index fbfb16570..e47609e0e 100644
--- a/packages/schemas/src/v3/connection.type.ts
+++ b/packages/schemas/src/v3/connection.type.ts
@@ -94,17 +94,25 @@ export interface GithubConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
export interface GitlabConnectionConfig {
/**
diff --git a/packages/schemas/src/v3/genericGitHost.schema.ts b/packages/schemas/src/v3/genericGitHost.schema.ts
index 8cebd9cd4..2c833b690 100644
--- a/packages/schemas/src/v3/genericGitHost.schema.ts
+++ b/packages/schemas/src/v3/genericGitHost.schema.ts
@@ -21,11 +21,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -40,9 +40,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -56,6 +66,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/genericGitHost.type.ts b/packages/schemas/src/v3/genericGitHost.type.ts
index e1ce579b3..026809d96 100644
--- a/packages/schemas/src/v3/genericGitHost.type.ts
+++ b/packages/schemas/src/v3/genericGitHost.type.ts
@@ -20,15 +20,23 @@ export interface GenericGitHostConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
diff --git a/packages/schemas/src/v3/gerrit.schema.ts b/packages/schemas/src/v3/gerrit.schema.ts
index d37968873..f99f1da05 100644
--- a/packages/schemas/src/v3/gerrit.schema.ts
+++ b/packages/schemas/src/v3/gerrit.schema.ts
@@ -61,11 +61,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -80,9 +80,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -96,6 +106,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/gerrit.type.ts b/packages/schemas/src/v3/gerrit.type.ts
index 360a61e70..655fbec48 100644
--- a/packages/schemas/src/v3/gerrit.type.ts
+++ b/packages/schemas/src/v3/gerrit.type.ts
@@ -38,15 +38,23 @@ export interface GerritConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
diff --git a/packages/schemas/src/v3/gitea.schema.ts b/packages/schemas/src/v3/gitea.schema.ts
index 6626b1992..924e5bf92 100644
--- a/packages/schemas/src/v3/gitea.schema.ts
+++ b/packages/schemas/src/v3/gitea.schema.ts
@@ -109,11 +109,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -128,9 +128,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -144,6 +154,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/gitea.type.ts b/packages/schemas/src/v3/gitea.type.ts
index dbdeeb8c5..f761ffb54 100644
--- a/packages/schemas/src/v3/gitea.type.ts
+++ b/packages/schemas/src/v3/gitea.type.ts
@@ -62,15 +62,23 @@ export interface GiteaConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
diff --git a/packages/schemas/src/v3/github.schema.ts b/packages/schemas/src/v3/github.schema.ts
index 93c61ba90..9b9713d3f 100644
--- a/packages/schemas/src/v3/github.schema.ts
+++ b/packages/schemas/src/v3/github.schema.ts
@@ -162,11 +162,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -181,9 +181,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -197,6 +207,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/github.type.ts b/packages/schemas/src/v3/github.type.ts
index f7cdf4a2d..00c272ed6 100644
--- a/packages/schemas/src/v3/github.type.ts
+++ b/packages/schemas/src/v3/github.type.ts
@@ -85,15 +85,23 @@ export interface GithubConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
diff --git a/packages/schemas/src/v3/gitlab.schema.ts b/packages/schemas/src/v3/gitlab.schema.ts
index 78412a054..97bd716b1 100644
--- a/packages/schemas/src/v3/gitlab.schema.ts
+++ b/packages/schemas/src/v3/gitlab.schema.ts
@@ -156,11 +156,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -175,9 +175,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -191,6 +201,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/gitlab.type.ts b/packages/schemas/src/v3/gitlab.type.ts
index b73372105..a54cf5acf 100644
--- a/packages/schemas/src/v3/gitlab.type.ts
+++ b/packages/schemas/src/v3/gitlab.type.ts
@@ -80,15 +80,23 @@ export interface GitlabConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
diff --git a/packages/schemas/src/v3/index.schema.ts b/packages/schemas/src/v3/index.schema.ts
index 8c1d64b52..f3987aebe 100644
--- a/packages/schemas/src/v3/index.schema.ts
+++ b/packages/schemas/src/v3/index.schema.ts
@@ -657,11 +657,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -676,9 +676,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -692,6 +702,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -868,11 +888,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -887,9 +907,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -903,6 +933,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1032,11 +1072,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1051,9 +1091,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1067,6 +1117,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1148,11 +1208,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1167,9 +1227,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1183,6 +1253,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1327,11 +1407,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1346,9 +1426,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1362,6 +1452,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1544,11 +1644,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1563,9 +1663,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1579,6 +1689,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -1622,11 +1742,11 @@ const schema = {
},
"revisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1641,9 +1761,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -1657,6 +1787,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/index.type.ts b/packages/schemas/src/v3/index.type.ts
index 7fa7f5a17..0a96be8fc 100644
--- a/packages/schemas/src/v3/index.type.ts
+++ b/packages/schemas/src/v3/index.type.ts
@@ -321,17 +321,25 @@ export interface GithubConnectionConfig {
enforcePermissionsForPublicRepos?: boolean;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
export interface GitlabConnectionConfig {
/**
diff --git a/packages/schemas/src/v3/shared.schema.ts b/packages/schemas/src/v3/shared.schema.ts
index 91a34529b..390dd919c 100644
--- a/packages/schemas/src/v3/shared.schema.ts
+++ b/packages/schemas/src/v3/shared.schema.ts
@@ -35,11 +35,11 @@ const schema = {
},
"GitRevisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -54,9 +54,19 @@ const schema = {
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -70,6 +80,16 @@ const schema = {
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
diff --git a/packages/schemas/src/v3/shared.type.ts b/packages/schemas/src/v3/shared.type.ts
index 043d1c80c..3a8032040 100644
--- a/packages/schemas/src/v3/shared.type.ts
+++ b/packages/schemas/src/v3/shared.type.ts
@@ -22,20 +22,28 @@ export interface Shared {
[k: string]: unknown;
}
/**
- * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
+ * The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.
*
* This interface was referenced by `Shared`'s JSON-Schema
* via the `definition` "GitRevisions".
*/
export interface GitRevisions {
/**
- * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
+ * List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
branches?: string[];
/**
- * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
+ * Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.
+ */
+ branchSort?: "committerdate" | "creatordate" | "refname";
+ /**
+ * List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.
*/
tags?: string[];
+ /**
+ * Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.
+ */
+ tagSort?: "committerdate" | "creatordate" | "refname";
}
/**
* Optional headers to use with the model.
diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts
index 5951bab6b..1426929ba 100644
--- a/packages/shared/src/types.ts
+++ b/packages/shared/src/types.ts
@@ -3,6 +3,8 @@ import { z } from "zod";
export type ConfigSettings = Required;
+const gitRevisionSortSchema = z.enum(["committerdate", "creatordate", "refname"]);
+
// Structure of the `metadata` field in the `Repo` table.
//
// @WARNING: If you modify this schema, please make sure it is backwards
@@ -22,11 +24,21 @@ export const repoMetadataSchema = z.object({
*/
branches: z.array(z.string()).optional(),
+ /**
+ * Sort order to use before matching and truncating branches.
+ */
+ branchSort: gitRevisionSortSchema.optional(),
+
/**
* A list of tags to index. Glob patterns are supported.
*/
tags: z.array(z.string()).optional(),
+ /**
+ * Sort order to use before matching and truncating tags.
+ */
+ tagSort: gitRevisionSortSchema.optional(),
+
/**
* A list of revisions that were indexed for the repo.
*/
diff --git a/schemas/v3/shared.json b/schemas/v3/shared.json
index c45c834f0..996e3a100 100644
--- a/schemas/v3/shared.json
+++ b/schemas/v3/shared.json
@@ -34,11 +34,11 @@
},
"GitRevisions": {
"type": "object",
- "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
+ "description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed first. Sourcebot can index at most 64 total revisions per repository, including the default branch. Matching branches are considered before matching tags, and any revisions beyond the 64 revision limit are ignored.",
"properties": {
"branches": {
"type": "array",
- "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
+ "description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. Matching branches are considered before matching tags, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -53,9 +53,19 @@
],
"default": []
},
+ "branchSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate branches before matching branch glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name. For branches, `creatordate` follows Git object creator-date semantics and is not a branch creation timestamp.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "committerdate"
+ },
"tags": {
"type": "array",
- "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
+ "description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. Matching tags are considered after matching branches, and the combined default branch, branch, and tag revision list is capped at 64 total revisions.",
"items": {
"type": "string"
},
@@ -69,6 +79,16 @@
]
],
"default": []
+ },
+ "tagSort": {
+ "type": "string",
+ "description": "Sort order to use when listing candidate tags before matching tag glob patterns and applying the global 64 revision limit. Values map to Git `for-each-ref` sort keys. `committerdate` and `creatordate` sort newest-first, while `refname` sorts lexicographically by ref name.",
+ "enum": [
+ "committerdate",
+ "creatordate",
+ "refname"
+ ],
+ "default": "creatordate"
}
},
"additionalProperties": false
@@ -108,4 +128,4 @@
"additionalProperties": false
}
}
-}
\ No newline at end of file
+}