Replies: 2 comments 2 replies
-
Hello, In times where github actions or other pipeline tools are very cheap, I personally don't see a lot of added value in waiting 3 minutes before you can push code to a remote repository. In my opinion, local git hooks should be able to finish in a reasonable time, blocking you from committing easy to spot issues. That being said, I do see some value in having pre-push instead of pre-commit in some cases. We once tried adding pre-push support, but bounced into some harder problems. The main problems here were:
If we don't want to dive deep into these files problems, a more simpler solution would be to make the pre-push command do a (We are already doing something similar for That way we don't have to change any of the existing tasks and we could make the logic opt-in by not defining the testsuite. There are some drawbacks on this approach, but I think it would make the basic feature easier to achieve. On top of my mind, it would primarily be: setting up the git hook files for this. Let me know what you think and feel free to play around with the idea. We can discuss in more details in a PR if you like. |
Beta Was this translation helpful? Give feedback.
-
Bump! How about just using |
Beta Was this translation helpful? Give feedback.
-
Currently GrumPHP supports being run as a
pre-commit
hook, however some tasks we want to run onlypre-push
. These would be time-consuming tasks such aspsalm
or running our test suite.In our case, we want to run our test suite on bare metal in
pre-commit
(~20s), but in Docker inpre-push
(~3m).The way I see this functioning is adding new config options as siblings to
tasks
,pre-commit
andpre-push
, each either their owntasks
sub-key.pre-commit.tasks
would execute identically totasks
in it's functionality (and either could be used, for backwards compatibility), the secondpre-push.tasks
would run when thegit:pre-push
command is run.You would also need to allow the other siblings of
tasks
(e.g.git_hook_variables
,process_timeout
,fixer
,parallel
etc.) as children ofpre-commit
andpre-push
.I understand this is a large change, and I'm happy to try and spend some time on implementing it if there's interest?
Beta Was this translation helpful? Give feedback.
All reactions