Don't execute SVN "post commit hook" when a specific file is committed

182 Views Asked by At

Is there any way to not to run "post commit hook" or skip "post commit hook statement" when a specific file is committed?

2

There are 2 best solutions below

10
uzsolt On BEST ANSWER

You can use a test in your post-commit script. The svnlook changed repository_directory will show which files changed - can use grep or similar.

For example:

#!/bin/sh

/usr/bin/svnlook changed /svn/repo | grep -w ' yourfile$' && exit 0

# here begin the main part of your (original) hook
0
Raj Sharma On

This worked for me:

"C:\Program Files\VisualSVN Server\bin\svnlook" changed C:\Repositories\sbm2| findstr version.json && EXIT /B
#here my main part of post-commit-hook will begin

Thanks @uzsolt