Fix Git hooks ownership in devcontainer setup #56
Reference in New Issue
Block a user
Delete Branch "fix-hook-install"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR Type
Bug fix
Description
Fix
.git/hooksownership in devcontainer setupEnsure pre-commit hooks install correctly
Diagram Walkthrough
File Walkthrough
setup.sh
Add ownership fix for `.git/hooks`.devcontainer/setup.sh
sudo chown -R node:node .git/hooksbefore hook installfix: pre-commit hooks should now be installable in dev containersto Fix Git hooks ownership in devcontainer setupPR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Relative path usage
Using a relative path for
.git/hooksmay lead to incorrect directory targeting if the script is run from a different working directory. Consider using an absolute path or ensuring the script’s working directory is the repo root.Directory existence
The script assumes the
.git/hooksdirectory exists. If.gitis not initialized,chownwill fail. Add a check to verify the directory before attempting ownership changes.PR Code Suggestions ✨