-
Notifications
You must be signed in to change notification settings - Fork 10
Multi branch indexing #8
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
base: main
Are you sure you want to change the base?
Conversation
This enables future multi-branch indexing by tracking branch state across indexing operations. Signed-off-by: Sasha Levin <sashal@kernel.org>
These functions enable branch resolution for queries and efficient incremental indexing across multiple branches. Signed-off-by: Sasha Levin <sashal@kernel.org>
- Add CLI flags for branch indexing: - --branch BRANCH (can be repeated) - --branches LIST (comma-separated) - --all-branches (index all local branches) - --remote-branches (include remote branches) - --update-branches (skip already-current branches) Signed-off-by: Sasha Levin <sashal@kernel.org>
Adds the --branch CLI flag to semcode query tool allowing users to query code at a specific branch instead of the current HEAD. Signed-off-by: Sasha Levin <sashal@kernel.org>
Adds three new commands to the query REPL: - `branches` (or `br`): List indexed branches with their status - `branch`: Show current branch information and target branch - `compare`: Compare two branches showing merge base and indexing status Signed-off-by: Sasha Levin <sashal@kernel.org>
Adds a new `branch` parameter to MCP tools that support git_sha: - find_function, find_type, find_callers, find_calls - find_callchain, grep_functions, vgrep_functions When branch is provided, it's resolved to a SHA and used for the query. Branch takes precedence over git_sha if both are specified. Signed-off-by: Sasha Levin <sashal@kernel.org>
Adds two new MCP tools for branch management: - list_branches: Lists all indexed branches with their status - compare_branches: Compares two branches showing merge base, ahead/behind status, and indexing status Signed-off-by: Sasha Levin <sashal@kernel.org>
|
Seems pretty reasonable, I'll look harder this week. Can I ask for some documentation updates with how you're using it? Especially for the table that tracks what has already been indexed, I'm curious how you're using that part. Also, you can use https://github.com/masoncl/semcode-devel if you'd prefer to use DCO instead of the CLA. |
Add branching-example.md explaining how to use semcode's multi-branch support for kernel stable tree maintenance. Signed-off-by: Sasha Levin <sashal@kernel.org>
|
Added some docs. In general, I use it for both autosel and the cve_classifier: in the case of autosel it helps identify how far a backport should go, and the range of affected kernels for cve assignments. The --update-branches makes it easy to keep multiple stable branches up to date as new stable kernels are released. |
|
The docs are great thank you, I can see how this would be really useful. The changes looked good to me, claude found a few potential issues. Also, reading the docs I think you want an option to just reindex all the branches that have changed? The only problem I really care about below is the db manager per branch, but I'll let you decide for the others. Also, I think the semcode br Recommendation: For initial indexing, consider using --git flag behavior or a configurable Issue 6: Remote Detection Logic Issue 7: Creates New DatabaseManager Per Branch |
Enables indexing and querying across multiple git branches.
The indexer accepts --branches to index several branches at once.
The query tool and MCP server accept a branch parameter to scope queries to a specific branch.
New REPL commands (branches, branch, compare) and MCP tools (list_branches, compare_branches) provide branch management.
The LSP server supports a target_branch configuration option.