A script to generate Atom feeds for git commit logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.1 KiB

9 years ago
9 years ago
  1. =pod
  2. =head1 NAME
  3. git-feed - generate an Atom feed of git commits in the current repository
  4. =head1 SYNOPSIS
  5. git-feed [ B<--project_url=...> ]
  6. =head1 DESCRIPTION
  7. I keep a lot of projects in git, and I like to provide feeds for things I'm
  8. working on. This script wraps git and XML::Atom::SimpleFeed to generate a
  9. basic Atom feed of commits. It tries to use information already available in
  10. the environment, but needs to be given a URL for your project (and probably for
  11. the feed itself).
  12. It can be configured for a given repository by doing something like the
  13. following:
  14. git config feed.projecturl https://p1k3.com/userland-book/
  15. git config feed.url https://p1k3.com/userland-book/feed.xml
  16. echo 'userland: a book about the command line for human beings' > .git/description
  17. I have I<no idea> whether this sort of thing is considered an acceptable use of
  18. git configuration, but it seems to work.
  19. ...or you can supply various options on the command line.
  20. B<--project_url=...>
  21. =over
  22. Set a URL for the project.
  23. =back
  24. B<--feed_url=...>
  25. =over
  26. Set an explicit URL for the feed itself.
  27. =back
  28. B<--title=...>
  29. =over
  30. Set an explicit title for the feed. Will otherwise be read from
  31. .git/description, if available.
  32. =back
  33. B<--entries=>I<n>
  34. =over
  35. Explicitly request I<n> entries. Defaults to 10.
  36. =back
  37. B<--author=...>
  38. =over
  39. Explicitly set an author string. Defaults to git config's current idea of
  40. user.name.
  41. =back
  42. =head1 EXAMPLES
  43. git feed --project_url=https://p1k3.com/userland-book/ > feed.xml
  44. =head1 INSTALLING
  45. I'll wrap this in a module and add a build script. For now, install
  46. XML::Atom::SimpleFeed first. I would probably do that either with:
  47. cpanp -i XML::Atom::SimpleFeed
  48. or:
  49. apt-get install libxml-atom-simplefeed-perl
  50. ...depending on which one gave me less static on a given system. I don't
  51. really know what I'm doing in the Perl ecosystem any more, though.
  52. =head1 AUTHOR
  53. Brennen Bearnes <bbearnes@gmail.com>
  54. =head1 LICENSE
  55. This utility is free software, licensed under the terms of the GPL, v2.
  56. See COPYING for a complete copy of the license.