Skip to content

git hooks are always #!/usr/bin/env bash even when bash is not available on the system #1323

@nivintw

Description

@nivintw

Summary

title pretty much says it all.
Reproduce by using a container image like something alpine based (and that specifically doesn't have bash installed).

  1. install prek
  2. install hooks via prek install
  3. Open .git/hooks and check any of the relevant (real) hook files
  4. you'll see the first line is #!/usr/bin/env bash

Platform

docker image python:3.14.2-alpine3.23

Version

0.2.27

.pre-commit-config.yaml

No response

Log file

This won't happen when running prek directly; it's an issue with the hooks files that prek generates when running prek install. Run prek install and then examine the created hooks files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions