简体   繁体   中英

How to create a pre-commit hook in SVNto limit file size?

I am new in creating pre-commit hooks on SVN. Is there anyone who knows how to limit file size that being committed to SVN? I am currently using TortoiseSVN.

  • Client-side program used by you is irrelevant for server-side SVN hooks
  • Core of your hook is two subcommands of svnlook
    1. With svnlook changed you'll get list of all files in transaction
    2. Using svnlook filesize for every file from the step 1 you'll get size of object in bytes, which you can compare with known limit and reject transaction, if needed
  • Technical details of implementations heavily depends from server's OS and used shell

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM