Skip to content

prepare-commit-msg Not passing all parameters #2406

@M-Whitaker

Description

@M-Whitaker

search tried in the issue tracker

Yes

describe your issue

When I run git commit with certain arguments I expect to get two or more arguments passed to argv of my script as per the specification:

image

def main(argv, argc):
     print(argv, argc)

Will print

['tools/hooks/add-commit-template.py', '.git/COMMIT_EDITMSG'] 2

It looks to me from looking at your auto-created hook installed that you are passing all args to the script so it maybe I haven't configured this correctly.

Thanks

pre-commit --version

pre-commit 2.19.0

.pre-commit-config.yaml

repos:
   - repo:
     hooks:
        - id: commit-template-local
          name: Provide Commit Message Template
          entry: tools/hooks/add-commit-template.py
          language: python
          stages: [ prepare-commit-msg ]

~/.cache/pre-commit/pre-commit.log (if present)

No response

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