You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Vladimir Prus <gh...@cs.msu.su> on 2005/10/31 13:51:17 UTC

Limiting the commit size

Hello,
is it possible, in a pre-commit hook, to limit the size in bytes of newly
added files? I've looked at all the "svnlook" commands, and none provides
this information directly.

The reason I'm asking is that one person just mistakenly committed 600M of
binary files to our repository, and I'd like to prevent such accidents in
future.

Thanks in advance,
Volodya



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Limiting the commit size

Posted by Chris Jensen <cj...@edex.com.au>.
Hi Vladimir

> is it possible, in a pre-commit hook, to limit the size in bytes of newly
> added files? I've looked at all the "svnlook" commands, and none provides
> this information directly.

Don't know how you'd do it with a hook script. But if you're using 
Apache as your access method, perhaps you could set a limit on the size 
of HTTP requests that are sent to subversion?

Chris

-- 
---------------------------------------------------------------------
Chris Jensen cjensen@edex.com.au

Educational Experience (Australia)
Postal Address: PO Box 860, Newcastle NSW 2300
Freecall:       1-800-025 270      International: +61-2-4923 8222
Fax:            (02) 4942 1991     International: +61-2-4942 1991

Visit our online Toy store! http://www.toysandmore.com.au/
---------------------------------------------------------------------

Re: Limiting the commit size

Posted by Vladimir Prus <gh...@cs.msu.su>.
On Tuesday 01 November 2005 07:48, jarrod roberson wrote:
> On 10/31/05, Vladimir Prus <gh...@cs.msu.su> wrote:
> > Hello,
> > is it possible, in a pre-commit hook, to limit the size in bytes of newly
> > added files? I've looked at all the "svnlook" commands, and none provides
> > this information directly.
> >
> > The reason I'm asking is that one person just mistakenly committed 600M
> > of binary files to our repository, and I'd like to prevent such accidents
> > in future.
> >
> > Thanks in advance,
> > Volodya
>
> don't let that person have commit priviledges anymore :-)
>
> but seriously, I think trying to limit screwups like that is a waste of
> effort.
> just like trying to enforce commit comments, you can force them to be not
> null, but you can't
> force people to put USEFUL comments, at least not programmatically.

While I can't programmatically prevent all possible misuse, I think limiting 
commit size is still reasonable. Say, if somebody mistakenly commits 2M 
binary, it's no biggie, I can "svn rm" it. If somebody mistakenly commits 
600M its big addition to repository size, and to backup size, and so such 
commit must be reverted completely, say via "svnadmin dump/load". Command 
like "svn obliterate" will be handy here, but it does not exists, so 
pre-commit hook is desirable.

I've managed to do such check with "svnlook cat .... | wc -c", but a standard 
solution would be better.

- Volodya

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org