Skip to content

Multi branch / tag support #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 7, 2024
Merged

Conversation

brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Nov 6, 2024

The following PR adds support for indexing multiple revisions (branches & tags) of a given GitHub, GitLab, or Gitea repository. Configuration of which revisions are included is made via the revisions property:

{
    "$schema": "./schemas/v2/index.json",
    "repos": [
        {
            "type": "github",
            "revisions": {
                 // Specify branches to index...
                "branches": [
                    "main",
                    "release/*"
                ],
                // ... or specify tags
                "tags": [
                    "v*.*.*"
                ]
            },
            "repos": [
                "org/repoa",
                "org/repob"
            ]
        }
   ]
}

The branch / tag values support glob patterns. In this case, we will match against the main branch + all branches starting with release/, as well as all tags that match the semver v*.*.* format. The branches / tags in a given repo (in this case, org/repoa and org/repob) and that match a glob pattern will be included during indexing. The revisions object is similarly supported for GitLab and GItea.

To search a particular revision, the revision: or rev: qualifier can be included in a query. For example:
image

The original zoekt branch: or b: qualifier may also be used.

Fixes #29

@msukkari msukkari self-requested a review November 7, 2024 00:04
@msukkari
Copy link
Contributor

msukkari commented Nov 7, 2024

nit: scroll bars in repos page seem broken on windows
image

@msukkari
Copy link
Contributor

msukkari commented Nov 7, 2024

what does the "+ 2" here mean? If it's supposed to reference how many branch hits there are, would it be better to instead mention this in the search results at the top (ex. Found X matches in Y files across Z branches)? It's not really intuitive what this number means at first glance
image

msukkari
msukkari previously approved these changes Nov 7, 2024
@brendan-kellam
Copy link
Contributor Author

what does the "+ 2" here mean? If it's supposed to reference how many branch hits there are, would it be better to instead mention this in the search results at the top (ex. Found X matches in Y files across Z branches)? It's not really intuitive what this number means at first glance image

We could surface a "Found X matches in Y files across Z branches" at the top, but we still probably need a per-match UI since different matches may exist in a different number of branches.

@brendan-kellam brendan-kellam merged commit ada53fc into main Nov 7, 2024
1 check passed
@brendan-kellam brendan-kellam deleted the bkellam/multi_branch_support branch November 7, 2024 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FR: Support indexing of branches
2 participants