jumanjihouse / pre-commit-hooks

git pre-commit hooks that work with http://pre-commit.com/
MIT License
114 stars 52 forks source link

post-merge doesn't seem to find files to check #107

Closed jangroth closed 2 years ago

jangroth commented 2 years ago

I want to trigger a custom commit hook on post merge, ideally with a list of of incoming file changes.

Custom hook config:

-   id: run-pbi-tools-post-merge
    name: pbi-tools compile (post merge)
    description: invoke pbi-tools to compile powerbi proj-folders into reports
    entry: run-pbi-tools-post-merge
    language: python
    files: ''                   # all files
    require_serial: true        # no parallel invocation
    verbose: true
    stages: [post-merge]

Client-side repo config:

repos:
- [...]
-   repo: https://github.com/myorg/precommit_hooks
    rev: 0.1.3
    hooks:
    -   id: run-pbi-tools-post-merge

I've installed pre-commit for post-merge (pre-commit install -t post-merge), however pre-commit isn't invoking the hook:

git pull
Updating 87c6d50..f51cb2a
Fast-forward
 trigger.txt | Bin 0 -> 82 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 trigger.txt
pbi-tools compile (post merge).......................(no files to check)Skipped
- hook id: run-pbi-tools-post-merge

I would expect the hook to be invoked for trigger.txt.

Is this a misconception on my end?

jangroth commented 2 years ago

Sorry, I created this in the wrong repository.