Skip to content

prepre-commit-msg git hook breaks IDE #634

Closed
@eladchen

Description

@eladchen

Hi,

While integrating this tool I noticed that my IDE started to misbehave when it performed git operations.

The example in the docs offers the following approach, which assumes /dev/tty is always available:

exec < /dev/tty && git cz --hook # <-- This fails when "not a tty"

The below uses a short-circuit to exit with an exit code of 0 in case tty is not available.

exec < /dev/tty && git cz --hook || true

Using the above solved a case where my IDE got killed during a rebase
But I suspect that anything that interacts with git is susceptible to this pitfall.

Let me know if you agree, and i'll work on a PR.

P.S:

Found a case in point:
https://stackoverflow.com/questions/55815650/lint-staged-commitizen-configuration-suitable-for-command-line-and-intellij/56555664#56555664

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions