Socket
Socket
Sign inDemoInstall

grunt-git-ref-changed-files

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grunt-git-ref-changed-files

Detects which files have changed between two git refs.


Version published
Maintainers
1
Install size
67.6 kB
Created

Readme

Source

grunt-git-ref-changed-files

Detects which files have changed between two git refs.

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide.

From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:

npm install grunt-git-ref-changed-files

Once that's done, add this line to your project's Gruntfile:

grunt.loadNpmTasks('grunt-git-ref-changed-files');

Overview

Inside your Gruntfile.js file add a section named refChangedFiles. This section specifies the options to detect which files have changed between two refs (from/to) and a regular expression to filter them.

How it works

It will query which files have changed since the specified from/to parameter using git by running:

git log {ref}..{ref} --name-only --pretty=format:

Finally it will filter the changed files by applying the regexp option to every item. The result of the filtered files changed will be stored in a grunt config item called refChangedFiles.

Config Example

Example to detect if static files where modified since v.100 tag:

refChangedFiles: {
    dist: {
        options: {
            from: 'v.100', // optional: default is HEAD^
            to: 'HEAD', // optional: default is HEAD
            regexp: /public\/lib\/js/, // optional: default is /.*/
        },
        src: 'repoFolder'
    }
}

Then you can access to the filtered changed files using:

grunt.config.get('refChangedFiles');

License

Copyright (c) 2013 Juan Pablo Garcia Licensed under the MIT license.

Keywords

FAQs

Last updated on 18 Jun 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc