[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Adding a file to repos with a post commit hook?

From: John Niven <jniven_at_bravurasolutions.com>
Date: Wed, 13 Feb 2008 12:58:07 +1300

> -----Original Message-----
> From: Ethan Schlenker [mailto:ethans_at_gamespot.com]
> Sent: Wednesday, 13 February 2008 12:36
> To: users_at_subversion.tigris.org
> Subject: Adding a file to repos with a post commit hook?
>
> Aloha,

Kia ora!

>
> I'm working on a way to automatically compress / minify our javascript
> files when committed, and want to run my current plan past the powers
> that be. I'm thinking that this flow may work:
>
> - commit files including a .js file
>
> - post-commit hook checks the files committed for normal .js files, if
> found:
> - grabs file, runs it through a minifier, and writes out
> a .min.js file in the same location as the original .js script
> - then adds? and commits the .min.js file
>
> Or, I might be crazy (not sure if I can get the hook script to
> actually create/overwrite the existing file or do a add?/commit).
> Basically, I don't want to have our devs to remember to compress the
> files, and I want the compressed files saved in svn.

I'm unconvinced about this - I don't believe you do want the compressed
files saved in SVN. The cost of storage per .js file is minimal, and
subsequent changes will be stored as deltas. The flipside is that devs
will then have to maintain a compressed file, which they probably won't
thank you for ;-)

I appreciate that since you're dealing with javascript files you
possibly don't have a build process such as you'd find with, say, Java
or Dotnet, but my recommendation would be to keep genuine source, i.e.
uncompressed javascript files in SVN, and worry about compression nearer
deployment. How do you deploy the javascript files? Could you use
something like Ant (ant.apache.org) and trigger the compression then?

Anyway, just my $0.02 NZD.

Cheers
John

>
> Does this seem cromulent? Or there a better way? Any advice would be
> welcome, and if I get this working, I'd be happy to share the script.
>
> -E
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: users-help_at_subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-13 00:58:37 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.