fix(setup): preserve hook file paths in monorepos - #283
Conversation
Deploying rstack-cli with
|
| Latest commit: |
3522914
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://52b17149.rstack-cli.pages.dev |
| Branch Preview URL: | https://chenjiahan-fix-hook-file-arg.rstack-cli.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35229142d1
ℹ️ 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
- 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 address that feedback".
| rs_remote_location=\${2-} | ||
| [ -n "$rs_remote_name" ] && [ -n "$rs_remote_location" ] || exit 1 | ||
| case "$rs_remote_location" in | ||
| /*|[A-Za-z]:/*) ;; |
There was a problem hiding this comment.
Preserve backslash UNC remote paths
On Git for Windows, a pre-push remote may be configured as a UNC path such as \\server\share\repo.git. Git supplies the remote location as the hook’s second parameter (pre-push documentation), but this absolute-path pattern recognizes only slash-prefixed paths and drive paths using forward slashes. The UNC value therefore reaches the default branch and becomes $rs_root/\\server\share\repo.git, so a nested project's pre-push hook receives a nonexistent repository-relative path and can reject an otherwise valid push.
Useful? React with 👍 / 👎.
This PR fixes message hooks in nested Rstack projects after the dispatcher switches to the owning project directory. Relative commit message paths passed by Git are now resolved against the repository root before the working directory changes, while absolute paths and additional hook arguments are preserved. Runtime coverage includes
applypatch-msg,commit-msg, andprepare-commit-msg.Related Links