Skip to content

Check shebang executable modes outside Git repositories - #1290

Closed
MentalOfCrow wants to merge 1 commit into
pre-commit:mainfrom
MentalOfCrow:fix/749-shebang-outside-git
Closed

MentalOfCrow wants to merge 1 commit into
pre-commit:mainfrom
MentalOfCrow:fix/749-shebang-outside-git

Conversation

@MentalOfCrow

Copy link
Copy Markdown

Closes #749.

Running check-shebang-scripts-are-executable outside a Git working tree currently raises a Git error. On POSIX, the hook now checks the executable mode of the named files in that case. Inside a repository it still uses the staged mode. The regression tests cover running the hook outside Git and a staged mode that differs from the working file.

Verified on Linux with Python 3.12. The suite passed with 418 tests and 4 expected failures. The repository's pre-commit checks passed on the changed files.

AI assistance. Codex helped write and test the patch and draft this description.

@asottile asottile closed this Nov 30, 2026
@pre-commit pre-commit locked as spam and limited conversation to collaborators Nov 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

check-shebang-scripts-are-executable Assumes Git Repo

2 participants