post-merge doesn't seem to find files to check
See original GitHub issuesearch tried in the issue tracker
yes. a lot.
describe your issue
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
.
I’m getting similar output when manually invoking the hook for trigger.txt:
pre-commit run --verbose --hook-stage post-merge --files trigger.txt
pbi-tools compile (post merge).......................(no files to check)Skipped
- hook id: run-pbi-tools-post-merge
… or for all files:
pre-commit run --verbose --all-files --hook-stage post-merge
pbi-tools compile (post merge).......................(no files to check)Skipped
- hook id: run-pbi-tools-post-merge
Is this a misconception on my end? My use case is running a script on pull to restore meta-data that was split up on commit. Maybe someone could point me towards an example that does something similar? So far I haven’t been able to find any.
pre-commit --version
2.20.0 (running on Windows)
.pre-commit-config.yaml
repos:
- [...]
- repo: https://github.com/myorg/precommit_hooks
rev: 0.1.3
hooks:
- id: run-pbi-tools-post-merge
~/.cache/pre-commit/pre-commit.log (if present)
./.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Git Merge - Incomplete, Missing files and Folders
But when I checked this newly merged working tree is missing a lot of folders and files from dev. git status // Shows...
Read more >Skip or Merge files option missing after installing updates on ...
Try copying the files with same names and see if you get the Skip or replace option window. Method 2: Uncheck the Folder...
Read more >The Ultimate Guide to Post Merger (M&A) Integration Process
Post -Merger Integration (PMI) or M&A Integration: a process of rearranging business with the merger and acquisition of one company by another.
Read more >10 Common Mail Merge Problems in Microsoft Word
Problems can arise when mail merging in Microsoft Word. Here are some common problems found when mail merging in Word and how to...
Read more >git: fetch and merge, don't pull | Mark's Blog
When merging with git merge, you only specify the branch you want to merge ... (a) “Local branches”: what you see when you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Update for future readers that might search for issues with
post_merge
:This hook can be invoked without file names being submitted by configuring
always_run: true
in.pre-commit-config.yaml
Hi @asottile - thanks for getting back to me.
Let me make myself clear: I think pre-commit is great and I very much appreciate your work. Also, I understand that you are running this in your own time and I have zero expectation for you to sacrifice your time beyond what you are willing to spend on this project.
Maybe in turn you can understand where I was coming from: I had already spent days working with & learning the framework. Only last week I moved to the
post-merge
bit of my work and yes, I misunderstood the relevance of the paragraph you pointed me to and also did not make the connection betweenpost_checkout
(always_run
documented) andpost_merge
(always_run
not mentioned). However, not only is this really difficult stuff, I also made an honest effort to solve the problem without having to post an issue here, including spending considerable time here and on SoF. So yes, ‘RTFM’ wasn’t the answer I was hoping for. There might also be a little bit of cultural differences in the mix, what you consider ‘brevity’ in English is a solid 8/10 ‘rudeness’ in German 😃However, all good from my end, and as I said, I really appreciate your work here.