Skip to main content
By default, only the default branch of a repository is indexed and can be searched. Sourcebot can be configured to index additional branches (or tags) enabling multi-branch search. This is useful for scenarios such as:
  • Searching across different releases
  • Searching through feature branches during development
  • Tracking changes across multiple maintenance branches simultaneously

Configuration

Multi-branch indexing is currently limited to 64 branches and tags. Please see this issue for more details.
Multi-branch indexing is configured in the connection using the revisions.branches and revisions.tags arrays. Glob patterns are supported. For example:
For each repo defined in the connection, any branches or tags matching the patterns in branches and tags array will be indexed.

Per-repository overrides

Use revisions.overrides to index different branches or tags for specific repos in a connection. For example, you can index datastore-release/* branches only for the acme/datastore repo:
Each override has the following fields: The mode controls how the override combines with the connection-level branches and tags:
  • append indexes the connection-level patterns and the override’s patterns.
  • replace indexes only the override’s patterns. If you omit branches or tags from the override, the connection-level value is used for that field.
How repos are matched:
  • repos patterns match the repo’s display name (e.g., acme/datastore) or its full name (e.g., github.com/acme/datastore).
  • Matching is case-insensitive.
  • If more than one override matches a repo, only the first one is applied.
  • The 64 revision limit applies after overrides are resolved. Use replace to narrow the revisions for repos with many matching branches.

Search syntax

To search branches other than the default, the rev: prefix can be used followed by the branch (or tag) name: To search across all branches, rev:*: Additional info:
  • refs/heads/ or refs/tags/ can be included to fully qualify a branch or a tag, respectively. E.g., rev:refs/heads/foo will search the branch foo, while rev:refs/tags/foo will search the tag foo.
  • rev: does not support regular expressions or glob patterns. It uses a simple contains call between the branch name and the pattern. See here.

Platform support