Sachin Mhetre
Sachin Mhetre

Reputation: 4543

SVN Post Commit Hook on list of files

I have many files present in my server. I want to set post-commit hook for some files only. ie. A notification mail should sent only when these files are updated.

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

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

Please suggest me some way for getting out of this.

Note: Maintaining text file is mandatory because this text file going to be updated periodically by third person.

Upvotes: 4

Views: 781

Answers (2)

Geddon
Geddon

Reputation: 1306

If your post-commit hook currently looks at all files and sends you an email of what any file is checked in, then you will need to edit it but with this basic logic.

  1. Upon commit read each line in text file and store that in %file
  2. if the committed file = %file
  3. Send email this %file was checked in at %date.

Something alone that lines.

Upvotes: 0

alroc
alroc

Reputation: 28144

  1. Use svnlook changed to find out what changed in the revision that was just committed
  2. Compare this list to your external text file listing those files
  3. Apply logic per your requirements

Upvotes: 2

Related Questions