0

I'm looking for SVN option or plugin that will not allow commit if files contain certain string (like System.out.println).

Is there any possibility that such thing exists? May be client or server sided.

Thanks, Piotr

1 Answers1

3

Sure.

You can use pre-commit hooks on your svn server.

http://svnbook.red-bean.com/en/1.8/svn.ref.reposhooks.pre-commit.html

The pre-commit hook is run just before a commit transaction is promoted to a new revision. Typically, this hook is used to protect against commits that are disallowed due to content or location (e.g., your site might require that all commits to a certain branch include a ticket number from the bug tracker, or that the incoming log message is nonempty).

Alternatively you can create pre-commit hooks in your TortoiseSVN client as well.

http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-settings.html

bahrep
  • 29,961
  • 12
  • 103
  • 150
Adam Papai
  • 256
  • 2
  • 9
  • 1
    Client-side pre-commit hooks should not be fully trusted for this sort of scenario because you can't assume that the user will always use (or have properly configured) your preferred client. It adds a layer of convenience & faster feedback for the user, but the same checks should be performed later by a process that has more control - a server-side hook, or a CI server. – alroc Sep 03 '14 at 14:29