-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[config] Detect git worktrees for project trust #2585
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
Conversation
Summary Review
If not already in the PR body, please add a short motivation: “Trust git worktrees based on the main repo’s trust, so users don’t have to trust each worktree individually.” Follow-up (outside this PR scope)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codex Review: Here are some suggestions.
Reply with @codex fix comments
to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
/// - If `cwd` is inside a linked worktree (where the repo root contains a | ||
/// `.git` file that points at `<main>/.git/worktrees/<name>`), returns the | ||
/// path to the main repository working directory (parent of `<main>/.git`). | ||
pub fn resolve_root_git_project_for_trust(cwd: &Path) -> Option<PathBuf> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's just shell out to git for this.
git rev-parse --git-common-dir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, nice
ae95776
to
9574b19
Compare
@nornagon-openai updated 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with nits
Summary
When resolving our current directory as a project, we want to be a little bit more clever:
Testing