subatom - produce an atom feed from subversion commits
subatom [-m max] [-o output] [-v viewcvs] REPOSITORY_URL [path ...] subatom -c config_file
subatom is a small script to produce an Atom feed from subversion commits. You can use this with a feed reader to see new commits to your repository.
The first argument is the URL for your subversion repository. The remaining arguments are paths within the repository for which you would like commit messages. If you don't specify any, it will default to the entire repository.
The -m flag states how many entries you would like in the feed. The default is 30.
If you pass a filename using the -o flag, the output will be written there instead of STDOUT. If the filename already exists then the timestamp will be checked and the new feed will only be written if it actually contains any newer entries. If you will be serving the feed file using a web server, then doing this enables If-Modified-Since to work correctly (ie: feed readers will only download the file if it has actually changed).
You can pass an URL using the -v flag, and subatom will create a link for each commit by appending the revision number to the URL. For example a viewcvs URL might look like this (on the command line).
If the URL has question marks or ampersands, don't forget to quote it on the command line. If you don't, the shell will interpret them and probably give some odd looking errors.
If you don't pass in a URL, a link will be automatically made to the first file that changed in this commit.
If you pass an URL using the -s flag, it will be used as the self link for the feed. Use this if you would like to avoid warnings from the feed validator.
In order to avoid wrapper scripts calling subatom with lots of parameters, you can also specify a config file. The format of the file consists of lines containing key-value pairs separated by whitespace. A blank line introduces a new stanza. You can generate multiple feeds by specifying several stanzas.
The following keywords are recognized.
How many entries should be in the feed? Defaults to 30.
Where should the feed be written to? Must be specified.
The path to the root of the repository. Must be specified.
NB: subatom likes to have the trailing slash removed, if you get any complaints, try taking it off.
Specifies a directory in the repository to monitor commit messages for. Defaults to '/'.
Specifies the URL of the feed that will be produced. No default.
Specifies an URL prefix which will have the revision number appended to produce the link for each commit. For example, if you have a trac setup, use something like this:
Specify the title for the feed as a whole. Defaults to "Recent commits to $repos_url".
output_file /www/svn.atom path /trunk repos_url http://svn.collab.net/repos/svn self_url http://localhost/svn.atom viewcvs_url http://svn.collab.net/viewvc/svn?view=rev&revision= feed_title Subversion Changes output_file /www/rails.atom path /trunk repos_url http://dev.rubyonrails.org/svn/rails self_url http://localhost/rails.atom viewcvs_url http://dev.rubyonrails.org/changeset/
Dominic Mitchell <cpan (at) happygiraffe.net>
Copyright (C) 2004 by Dominic Mitchell. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.