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

Re: precommit hook to prevent large commits?

From: Andreas Stieger <Andreas.Stieger_at_gmx.de>
Date: Thu, 30 May 2019 09:12:47 +0200

> I'm looking to update my precommit hook to reject commits that are larger than x megabytes.

The proposed transaction is passed as a parameter to the hook.
Hand that to svnlook (svnlook -t $TXN changed), and iterate over all entries.
Filter out deletions and directory changes.
For each file get size (svnlook -t $TXN filesize) and sum it up.
Evaluate and return hook as required.

Received on 2019-05-30 09:13:07 CEST

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