Skip to content

Commit c46d437

Browse files
finished docs
1 parent c8bbdd7 commit c46d437

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/docs/more/multi-branch-indexing.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,25 @@ For each repo defined in the connection, any branches or tags matching the patte
5959

6060
## Search syntax
6161

62-
todo
62+
To search branches other than the default, the `rev:` prefix can be used followed by the branch (or tag) name:
63+
64+
| Example | Explanation |
65+
| :--- | :--- |
66+
| `rev:feature/foo repo:A useEffect` | Search for `/useEffect/` on branch `feature/foo` in repo `A` |
67+
| `rev:feature/foo useEffect ` | Search for `/useEffect/` on branch `feature/foo` across all repos |
68+
| `rev:feature/ useEffect` | Search for `/useEffect/` on branches that contain `feature/` across all repos |
69+
| `rev:feature/a rev:feature/b foo` | Search for `/foo/` on branches `feature/a` and `feature/b` |
70+
| `rev:feature/ -rev:feature/a foo` | Search for `/foo/` on branches that contain `feature/` _except_ for `feature/a` across all repos |
71+
72+
To search across **all** branches, `rev:*`:
73+
| Example | Explanation |
74+
| :--- | :--- |
75+
| `rev:* repo:A "error message"` | Search for `/error message/` across **all** branches in repo `A` |
76+
| `rev:* "error message"` | Search for `/error message/` across **all** branches and **all** repos |
77+
78+
Additional info:
79+
- `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`.
80+
- `rev:` does **not** support regular expressions or glob patterns. It uses a simple `contains` call between the branch name and the pattern. See [here](https://github.com/sourcebot-dev/zoekt/blob/7d1896215eea6f97af66c9549c9ec70436356b51/matchtree.go#L1067).
6381

6482

6583
## Platform support

0 commit comments

Comments
 (0)