Skip to content

feat: replace hook symlinks with shell wrapper scripts#9

Merged
alecthomas merged 1 commit intomainfrom
hook-wrapper-scripts
Mar 17, 2026
Merged

feat: replace hook symlinks with shell wrapper scripts#9
alecthomas merged 1 commit intomainfrom
hook-wrapper-scripts

Conversation

@alecthomas
Copy link
Copy Markdown
Collaborator

Instead of symlinking hook names to the lhm binary and detecting the
hook from argv[0], write shell scripts that invoke 'lhm run-hook '.
This makes hook identity independent of filename, so other tools that
rename hooks in hooksPath no longer break dispatch.

  • Add 'run-hook' subcommand that takes hook name explicitly
  • Replace create_hook_symlinks with create_hook_scripts
  • Remove file before writing to avoid writing through existing symlinks
  • Remove legacy argv[0]-based hook detection and invoked_name()
  • Update README to describe new mechanism

@alecthomas alecthomas enabled auto-merge (squash) March 17, 2026 00:06
Instead of symlinking hook names to the lhm binary and detecting the
hook from argv[0], write shell scripts that invoke 'lhm run-hook <name>'.
This makes hook identity independent of filename, so other tools that
rename hooks in hooksPath no longer break dispatch.

- Add 'run-hook' subcommand that takes hook name explicitly
- Replace create_hook_symlinks with create_hook_scripts
- Remove file before writing to avoid writing through existing symlinks
- Remove legacy argv[0]-based hook detection and invoked_name()
- Update README to describe new mechanism
@alecthomas alecthomas force-pushed the hook-wrapper-scripts branch from 78cc6c1 to 2780935 Compare March 17, 2026 00:06
@alecthomas alecthomas changed the title Replace hook symlinks with shell wrapper scripts feat: replace hook symlinks with shell wrapper scripts Mar 17, 2026
@alecthomas alecthomas merged commit dd8a01d into main Mar 17, 2026
7 of 9 checks passed
@alecthomas alecthomas deleted the hook-wrapper-scripts branch March 17, 2026 00:10
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