SVN Post Commit Hook on File List

I have a lot of files present on my server. I want to install a post-commit hook for some files. i.e. A notification should only be sent when these files are updated.

I have installed SVN Notify and its working for all files on the SVN server. But it should only work for some files. So I find a way that I will maintain a text file that will contain a list of files that post-commit should apply to.

But the problem is, how will my post-commit script know that the updated file is from the list of files present in the text file?

Please suggest me some way to get out of this.

Note. Maintaining the text file is mandatory as this text file is periodically updated by a third party.

+3


source to share


2 answers


  • Use svnlook changed

    to see what has changed in the version that was just committed.
  • Compare this list with your external text file, which lists these files.
  • Apply logic as per your requirement.


+1


source


If your post-commit hook is currently scanning all files and sending you an email about which file is checked out, then you will need to edit it, but with this basic logic.

  • After commit, read each line in a text file and save it to file%
  • if committed file =% file
  • Send email, this% file has been tagged with% date.


Something like that.

0


source







All Articles