Skip to content

docs(extending): simplify hook-log alias body; drop brittle hash match - #2169

Merged
max-sixty merged 1 commit into
mainfrom
json-logs
Apr 13, 2026
Merged

max-sixty merged 1 commit into
mainfrom
json-logs

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Two small polish changes to the hook-log alias recipe added in #2161:

  • Multi-line the alias body so the 217-char pipeline becomes readable in the rendered docs. The jq expression lives inside single quotes, so literal newlines are safe; the outer shell pipeline reads top-to-bottom without wrapping.
  • Drop the startswith($name + "-") branch. It was meant to also match the sanitized-with-hash form, but only covers the specific 3-char suffix shape and would misfire on hook names that naturally end in -<3alnum>. The limitation is documented instead: users with hook names that required sanitization should pass the on-disk sanitized form.

A follow-up PR (dispatched separately) adds a sanitize_hash template filter so the alias can pre-sanitize its input and match reliably across all hook names.

This was written by Claude Code on behalf of Maximilian Roos

… match

- Break the alias across lines. The jq expression is inside single quotes,
  so literal newlines are safe; the outer shell pipeline stays in
  `$(...)` and reads top-to-bottom without wrapping.
- Drop the `startswith($name + "-")` arm. It was meant to also match
  the sanitized-with-hash form, but only covers the specific 3-char
  suffix shape and would misfire on hook names that naturally end in
  `-<3alnum>`. Document the limitation instead: users with hook names
  that required sanitization should pass the on-disk sanitized form.

A follow-up PR (dispatched separately) adds a `sanitize_hash` template
filter so the alias can pre-sanitize its input and match reliably.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit cec8d93 into main Apr 13, 2026
24 checks passed
@max-sixty
max-sixty deleted the json-logs branch April 13, 2026 04:23
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