The Quality Gates workflow enforces pipefail in all bin scripts, but adding it naively breaks pipes that use | head due to SIGPIPE (exit 141).
Requires a careful refactor:
- Switch shebang from
#\!/bin/sh to #\!/usr/bin/env bash (pipefail is not POSIX)
- Add
set -o pipefail after set -e in all 20 executable scripts
- Handle SIGPIPE in all
| head, | sed ... | head, and similar truncating pipelines
- Options:
trap '' PIPE, || true on specific pipes, or restructure to avoid early-exit readers
Affected pipelines (examples):
git log ... | sed | head -1 in git-issue-show (state extraction)
git for-each-ref ... | awk | sort in git-issue-ls
- Similar patterns in most bin scripts (6,301 total lines, 400+ pipe usages)
Attempted quick fix (shebang + pipefail) caused exit 141 across core tests. Reverted.
The Quality Gates workflow enforces pipefail in all bin scripts, but adding it naively breaks pipes that use
| headdue to SIGPIPE (exit 141).Requires a careful refactor:
#\!/bin/shto#\!/usr/bin/env bash(pipefail is not POSIX)set -o pipefailafterset -ein all 20 executable scripts| head,| sed ... | head, and similar truncating pipelinestrap '' PIPE,|| trueon specific pipes, or restructure to avoid early-exit readersAffected pipelines (examples):
git log ... | sed | head -1in git-issue-show (state extraction)git for-each-ref ... | awk | sortin git-issue-lsAttempted quick fix (shebang + pipefail) caused exit 141 across core tests. Reverted.