Reputation: 72
In short, I want to combine all JavaScript- files in my project into one file after each commit and include 'compiled' files in this commit\revision. What I should do?
I tried to use post-commit hook, post-revprop-change, but either I am stupid or it can't helps me.
Upvotes: 1
Views: 37
Reputation: 39153
First, you shouldn't include generated or 'compiled' files in you version control repository. See this SO answer for the reasoning about it. The best option would be to have a build script that generates the combined files with a simple command and add it to your deploy process. The generated files should be added to the svn:ignore property.
For your specific problem, there are even web server modules, like Google mod_pagespeed, that automatically combine javascript files. This solution is a lot better than including generated code in your repository.
Now, if you really want to do it, you should do with a pre-commit hook. You should generate your files before sending them to version control. See that you will have a lot of trouble with it:
If you follow this monstruous path, please don't tell anyone that I've told you how to do it :-)
Upvotes: 3