Conversation
Member
Author
|
It also seems like using Wasn't able to get autocomplete for repo names. |
| For each directory in `repoDirs`, check if the repo exists by running a **separate** Bash call for each: | ||
|
|
||
| ```bash | ||
| test -d <repoDir>/<repo-name>/.git |
There was a problem hiding this comment.
Bug: The script uses test -d to check for a .git directory, which fails for git worktrees where .git is a file, not a directory.
Severity: MEDIUM
Suggested Fix
Replace the directory check test -d <path>/.git with a check that validates both files and directories, such as test -e <path>/.git. A more robust alternative is to use a git-native command like git -C <path> rev-parse --is-inside-work-tree to correctly identify all valid git repositories, including worktrees.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: plugins/sentry-skills/skills/local-repo/SKILL.md#L55
Potential issue: The skill checks if a given path is a git repository by testing if a
`.git` directory exists using `test -d <repoDir>/<repo-name>/.git`. This check is
incorrect for git worktrees, a standard git feature, where `.git` is a file containing a
reference to the main repository's git directory, not a directory itself. As a result,
the test will fail for any repository set up as a worktree, causing the skill to
incorrectly report the repository as "not found" and preventing users with worktree
setups from using this feature.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A skill that lets you investigate, compare and modify other local git repositories from your current chat in a single repo.
How it works
The
~/.claude/repos.local.jsonconfig file is used to specify which directories contain repositories on your machine.When using the skill, it'll look for a matching repo in all configured directories and then use that.
It will notify you if the repo is missing.
It will also notify you if the referenced repo is outdated, on a non main branch or has local changes.
Why
An alternative to setting up workspaces in Cursor that include multiple repos.
I used to start a new chat in a specific (SDK) repo just to answer a question about some internals of that SDK. This involved lots of duplicate explaining and also becomes annoying to manage in terms of which chat on repo A goes with which chat on repo B etc.
Example usages
Recommended permissions
NOTE: Please review those before copying them.
In
~/.claude/settings.json: