Skip to content

fix(setup): preserve hook file paths in monorepos - #283

Open
chenjiahan wants to merge 2 commits into
mainfrom
chenjiahan/fix-hook-file-arguments
Open

fix(setup): preserve hook file paths in monorepos#283
chenjiahan wants to merge 2 commits into
mainfrom
chenjiahan/fix-hook-file-arguments

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Aug 10, 2026

Copy link
Copy Markdown
Member

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, and prepare-commit-msg.

Related Links

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

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

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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 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]:/*) ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant