[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

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

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 30 Oct 2009 07:13:08 +0200 (Jerusalem Standard Time)

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_at_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_at_subversion.tigris.org].

Received on 2009-10-30 06:14:15 CET

This is an archived mail posted to the Subversion Users mailing list.