Grunt Task that uses the git diff information to modify the content of files
npm install grunt-git-diff"Grunt Task that uses the git diff information to modify the content of files",
A simple [Grunt][grunt] multitask that uses git diff information to modify the content of files.
Used in [paged-media-boilerplate][paged-media-boilerplate].
Makes use of [simple-git][simple-git]
* Getting Started
* Use it with grunt
* Documentation
* Example with jade
* Release History
* License
Install this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: npm install grunt-git-diff
Then add this line to your project's grunt.js gruntfile:
``javascript`
grunt.loadNpmTasks('grunt-git-diff');
[grunt]: https://github.com/cowboy/grunt
[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
[paged-media-boilerplate]: https://github.com/paulpflug/paged-media-boilerplate
[simple-git]: https://github.com/steveukx/git-js
Here the available options with the corresponding defaults:
`coffeeRegex which is used to get the hunk
Note, that the index 2 is the number of overwritten lines
index 3 is the linenumber where to overwrite, and index 5 is the current
environment, important for jade parsing
hunkregex: /@@ \-(\d+),(\d+) \+(\d+),(\d+) @@([\s\S]*)/
$3
First append this to your css:
`css
span.strongred, span.strongred * {color:red !important;}
span.strongblue, span.strongblue * {color:blue !important;}
`This is how the task could look like, which creates a jade diff:
`coffee
gitdiff:
options:
prependplus: "span.strongred "
prependminus:"span.strongblue "
compile:
files: [
expand: true,
cwd: "jade/",
src: ["*/.jade"],
ext: ".jade",
dest: "tmp/"
]
``