2009-08-09 12:56:23 +00:00
|
|
|
#!/bin/sh
|
2010-07-06 03:38:34 +00:00
|
|
|
# This script can be used to generate links in commit messages.
|
2009-08-09 12:56:23 +00:00
|
|
|
#
|
|
|
|
# To use this script, refer to this file with either the commit-filter or the
|
|
|
|
# repo.commit-filter options in cgitrc.
|
|
|
|
|
2010-07-06 03:38:34 +00:00
|
|
|
# This expression generates links to commits referenced by their SHA1.
|
|
|
|
regex=$regex'
|
|
|
|
s|\b([0-9a-fA-F]{8,40})\b|<a href="./?id=\1">\1</a>|g'
|
|
|
|
# This expression generates links to a fictional bugtracker.
|
|
|
|
regex=$regex'
|
|
|
|
s| #([0-9]+)\b|<a href="http://bugs.example.com/?bug=\1">#\1</a>|g'
|
|
|
|
|
|
|
|
sed -re "$regex"
|