Skip to content

fix(setup-hooks): resolve destination from core.hooksPath#16

Merged
tannn merged 2 commits intocommit-normalizefrom
copilot/sub-pr-14-again
Mar 3, 2026
Merged

fix(setup-hooks): resolve destination from core.hooksPath#16
tannn merged 2 commits intocommit-normalizefrom
copilot/sub-pr-14-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

setup-hooks.sh hardcoded .git/hooks as the install target, silently ignoring core.hooksPath when configured — hooks were installed but never executed by Git.

Changes

  • scripts/setup-hooks.sh: Resolve HOOKS_DEST via git config core.hooksPath at runtime, falling back to .git/hooks only when unset. Handles both absolute and relative configured paths.
# Respect core.hooksPath when configured; fall back to .git/hooks
_configured_path="$(git -C "$REPO_ROOT" config core.hooksPath 2>/dev/null || true)"
if [[ -n "$_configured_path" ]]; then
  case "$_configured_path" in
    /*) HOOKS_DEST="$_configured_path" ;;
    *)  HOOKS_DEST="$REPO_ROOT/$_configured_path" ;;
  esac
else
  HOOKS_DEST="$REPO_ROOT/.git/hooks"
fi

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: tannn <831788+tannn@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve commit message normalization based on review feedback fix(setup-hooks): resolve destination from core.hooksPath Mar 3, 2026
Copilot finished work on behalf of tannn March 3, 2026 06:50
@tannn tannn marked this pull request as ready for review March 3, 2026 07:46
@tannn tannn merged commit eeafbc2 into commit-normalize Mar 3, 2026
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@tannn tannn deleted the copilot/sub-pr-14-again branch March 3, 2026 07:46
tannn added a commit that referenced this pull request Mar 3, 2026
* chore: add conventional-commits commit-msg hook and setup script

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift

* fix(commit-msg): reject commit subjects with trailing period (#15)

* Initial plan

* fix: reject commit subjects ending with a trailing period

Co-authored-by: tannn <831788+tannn@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tannn <831788+tannn@users.noreply.github.com>

* fix(setup-hooks): resolve destination from core.hooksPath (#16)

* Initial plan

* fix: resolve hook destination from git config core.hooksPath

Co-authored-by: tannn <831788+tannn@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tannn <831788+tannn@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tannn <831788+tannn@users.noreply.github.com>
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.

2 participants