Skip to content

follow-up: guard-git.sh grep patterns still use \s (BSD portability) #1157

@carlos-alm

Description

@carlos-alm

Deferred from PR #1153 review (Greptile).

Original reviewer comment: #1153 (comment)

Context: After PR #1146 fixed the BSD-sed issues in .claude/hooks/guard-git.sh (replaced \s with [[:space:]] in sed patterns and split the ;t; chain), all remaining grep -qE patterns in the same file still use \s (lines 25, 56, 61, 66, 71, 72, 78, 83, 161, 167, 175 on main).

BSD grep on macOS happens to accept \s in ERE mode as a vendor extension, so these still work — but \s is not POSIX ERE. Replacing them with [[:space:]] would make the script uniformly portable to any POSIX-compliant grep (e.g. busybox in Alpine containers, some CI runners) and consistent with the convention established by #1146.

PR #1153 was closed as superseded by #1146 before this suggestion could be addressed, hence this follow-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upDeferred work from PR reviews that needs tracking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions