Coder Social home page Coder Social logo

Comments (6)

CircleCode avatar CircleCode commented on August 30, 2024 1

There are the Conditions located under CaptainHook\App\Hook\Condition\FileChanged\* they are suited to use for pre-push

It was not stated in the doc (they are flagged only for post-checkout / post-merge), but the code indeed indicates they should work on pre-push.
I will make some tests to see if they fulfill my needs, thanks.
Anyway, after my tests, I may update documentation :-)

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on August 30, 2024

There are the Conditions located under CaptainHook\App\Hook\Condition\FileChanged\* they are suited to use for pre-push

from captainhook.

CircleCode avatar CircleCode commented on August 30, 2024

before working on documentation, I am a bit confused about the way the before-push hook works:

If the pushed reference is not the current HEAD (or if we push several references), the condition FileChanged\OfType is evaluated against pushed reference(s), but the hook is then run against the working directory. I find this surprising because I would expect the before-push to prevent pushing broken code, but here it can't prevent anything on the pushed references…

Additionnaly, CaptainHook\App\Hook\Condition\FileChanged\* has 3 classes: OfType, All, Any, but only OfType is compatile with pre-push

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on August 30, 2024

Additionnaly, CaptainHook\App\Hook\Condition\FileChanged\* has 3 classes: OfType, All, Any, but only OfType is compatile with pre-push

Yes, at the moment that is true, because getting a list of files changed works differently on pre-push, post-merge, post-checkout, and post-rewrite :)

I have to clean that up at some point :)

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on August 30, 2024

Oh looks like I did that, I just didn't update the Restrictions.

So after my next push All and Any should also work for pre-push.

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on August 30, 2024

Fixed with 5.15.4 docs updates as well ;)

from captainhook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.