Skip to content

Commit 85efaff

Browse files
docs
1 parent 502f8fa commit 85efaff

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed
655 KB
Loading
878 KB
Loading

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Added support for indexing and searching repositories across multiple revisions (tag or branch). ([#58](https://github.com/sourcebot-dev/sourcebot/pull/58))
13+
1014
## [2.3.0] - 2024-11-01
1115

1216
### Added

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,46 @@ docker run -e <b>GITEA_TOKEN=my-secret-token</b> /* additional args */ ghcr.io/s
267267

268268
If you're using a self-hosted GitLab or GitHub instance with a custom domain, you can specify the domain in your config file. See [configs/self-hosted.json](configs/self-hosted.json) for examples.
269269

270+
## Searching multiple branches
271+
272+
By default, Sourcebot will index the default branch. To configure Sourcebot to index multiple branches (or tags), the `revisions` field can be used:
273+
274+
```jsonc
275+
{
276+
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v2/index.json",
277+
"repos": [
278+
{
279+
"type": "github",
280+
"revisions": {
281+
// Index the `main` branch and any branches matching the `releases/*` glob pattern.
282+
"branches": [
283+
"main",
284+
"releases/*"
285+
],
286+
// Index the `latest` tag and any tags matching the `v*.*.*` glob pattern.
287+
"tags": [
288+
"latest",
289+
"v*.*.*"
290+
]
291+
},
292+
"repos": [
293+
"my_org/repo_a",
294+
"my_org/repo_b"
295+
]
296+
}
297+
]
298+
}
299+
```
300+
301+
For each repository (in this case, `repo_a` and `repo_b`), Sourcebot will index all branches and tags matching the `branches` and `tags` patterns provided. Any branches or tags that don't match the patterns will be ignored and not indexed.
302+
303+
To search on a specific revision, use the `revision` filter in the search bar:
304+
305+
<picture>
306+
<source media="(prefers-color-scheme: dark)" srcset=".github/images/revisions_filter_dark.png">
307+
<img style="max-width:700px;width:100%" src=".github/images/revisions_filter_light.png">
308+
</picture>
309+
270310
## Searching a local directory
271311

272312
Local directories can be searched by using the `local` type in your config file:

configs/multi-branch.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "../schemas/v2/index.json",
3+
"repos": [
4+
{
5+
"type": "github",
6+
"revisions": {
7+
// Specify branches to index...
8+
"branches": [
9+
"main",
10+
"release/*"
11+
],
12+
// ... or specify tags
13+
"tags": [
14+
"v*.*.*"
15+
]
16+
},
17+
// For each repo (repoa, repob), Sourcebot will index all branches and tags in the repo
18+
// matching the `branches` and `tags` patterns above. Any branches or tags that don't
19+
// match the patterns will be ignored and not indexed.
20+
"repos": [
21+
"org/repoa",
22+
"org/repob"
23+
]
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)