amaechler commented on code in PR #20477:
URL: https://github.com/apache/druid/pull/20477#discussion_r4174563360


##########
hooks/install-hooks.sh:
##########


Review Comment:
   Good call, `dev/intellij-setup.md` already says to run it without an 
argument. `DRUID_ROOT` now defaults to the script's parent directory, so 
`hooks/install-hooks.sh` works from any directory. Passing a path still works. 
Same change in `uninstall-hooks.sh`.



##########
hooks/install-hooks.sh:
##########
@@ -32,10 +32,11 @@ if [ $# != 1 ]
 fi
 
 DRUID_ROOT=$1
+GIT_HOOKS_DIR="$(git -C "${DRUID_ROOT}" rev-parse --path-format=absolute 
--git-common-dir)/hooks"

Review Comment:
   Fixed, both scripts now use `git rev-parse --path-format=absolute --git-path 
hooks`. It still resolves to the shared hooks folder from a linked worktree, 
and it follows `core.hooksPath`, both relative and absolute. One thing to know: 
with a global `core.hooksPath`, the hooks get installed into that global 
folder, because that's where git runs hooks from. `cp_if_not_exist` still won't 
overwrite an existing `pre-commit` or `pre-push` there.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to