Heredocs & Redirects Patterns

Heredoc and redirect patterns I’ve actually used. Every entry has a date and context.

2026-03+: Heredoc Git Commit Workflow

Problem: Multi-line commit messages are awkward with git commit -m "…​"

Context: Daily workflow, all domus-* repos

The Fix:

# Custom zsh function for heredoc commits
gach() {
    git add -A && git commit -m "$(cat)"
}

# Usage
gach << 'EOF'
docs(patterns): Add security engineering patterns

- Vault cert issuance workflow
- EAP-TLS nmcli configuration
- gopass/gocryptfs patterns
EOF

Rule: $(cat) in commit message reads from stdin, enabling heredoc multi-line messages. Quote 'EOF' to prevent variable expansion.