You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2009/10/30 05:13:08 UTC

Non-hook-based post-commit mailer (e.g., for remote repository)

There is a repository that I don't have access to install a post-commit 
hook on.  But I still want to receive post-commit mails for that 
repository.

I could svnsync-mirror that repository and use the usual suspects 
(mailer.py et al), or I could write a script that runs from cron,
checks for new revisions, and generates post-commit mails as necessary.

The attached pair of scripts implement the latter approach.

They have been tested on Linux only and make a few assumptions specific
to the environment I wrote them in (e.g., they use getent(1) to expand
svn:author values to full names and hard-code /usr/sbin/sendmail).  But
here they are, if someone finds them useful.

Daniel

[[[
Quick README:

- youngest.sh:
  - runs periodically from cron, remembers the last revision it saw, 
    and calls remote-mailer.sh for every revisions between that and 
    HEAD
  - to set up:
    - create the 'recipients' file including a newline/comma-separated
      list of recipients
    - create the 'next-email' file containing the revision number of the
      next mail to send (e.g., HEAD or 1+HEAD)
    - run it from cron

- remote-mailer.sh
  - generates a single email
  - no set up required
  - used by youngest.sh, or directly by you
  - example usage:
      [[[
      revnum="40308"
      url="http://svn.collab.net/repos/svn"
      to="me@example.com"
      ./remote-mailer.sh $url $revnum $to
      # sleep 5;  ### uncomment if running in a loop
      ]]]

- remote-mailer.log
  - log file of remote-mailer.sh
  - contains one msgid line per message sent
]]]

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2412929

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].