[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: Ethan Schlenker <ethans_at_gamespot.com>
Date: Tue, 12 Feb 2008 16:17:29 -0800

On Feb 12, 2008, at 3:58 PM, John Niven wrote:

>> -----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!

Talofa!

>
>
>>
>> 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 ;-)

Hrm - Perhaps I didn't explain myself well enough :-)

Both the normal js file and the compressed file will be in svn. The
compressed version will be also stored in svn so that our dev
environment can use the compressed or the normal (to test if there are
ever bugs with the compressed version). Devs don't have to touch the
compressed version as the post-commit hook would take care of updating
the compressed file when they commit changes to a normal file.

> 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?

Doing it as part of the deployment process, is an option, but I'd like
the compressed file to be in svn as well so that the dev environments
can easily use it for testing. The more similar the live and dev
enviroments are the better.

I guess my question boils down to: can a post-commit hook add/commit
a file in a repository?

> Anyway, just my $0.02 NZD.

Thanks!

-E

>
>
> 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
>

---------------------------------------------------------------------
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 01:17:56 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.