summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Jacquin <beber@meleeweb.net>2014-02-11 21:42:36 +0100
committerBertrand Jacquin <beber@meleeweb.net>2014-02-11 21:42:36 +0100
commitddfda448422999695e3d1268c195293082c33600 (patch)
tree39be0a9d11079908bd4910e20a12dd97bf46295e
parentf41eee7ea879da868747ea00f181864fe52dc02b (diff)
filters: Filter out commit messages to add some hilight on SHA1 hash and
phab links
-rw-r--r--cgitrc1
-rwxr-xr-xpublic_html/filters/commit-filter22
2 files changed, 23 insertions, 0 deletions
diff --git a/cgitrc b/cgitrc
index 37202d8..1bf6808 100644
--- a/cgitrc
+++ b/cgitrc
@@ -23,6 +23,7 @@ enable-subject-links=1
23enable-remote-branches=1 23enable-remote-branches=1
24 24
25about-filter=filters/about-filter 25about-filter=filters/about-filter
26commit-filter=filters/commit-filter
26source-filter=filters/source-filter 27source-filter=filters/source-filter
27 28
28max-repo-count=500 29max-repo-count=500
diff --git a/public_html/filters/commit-filter b/public_html/filters/commit-filter
new file mode 100755
index 0000000..24ca2dc
--- /dev/null
+++ b/public_html/filters/commit-filter
@@ -0,0 +1,22 @@
1#!/bin/bash
2#
3# This script can be used to generate links in commit messages.
4#
5# To use this script, refer to this file with either the commit-filter or the
6# repo.commit-filter options in cgitrc.
7#
8# The following environment variables can be used to retrieve the configuration
9# of the repository for which this script is called:
10# CGIT_REPO_URL ( = repo.url setting )
11# CGIT_REPO_NAME ( = repo.name setting )
12# CGIT_REPO_PATH ( = repo.path setting )
13# CGIT_REPO_OWNER ( = repo.owner setting )
14# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting )
15# CGIT_REPO_SECTION ( = section setting )
16# CGIT_REPO_CLONE_URL ( = repo.clone-url setting )
17
18exec sed -r \
19 -e 's@\b([0-9a-fA-F]{7,40})\b@<a href="./?id=\1">\1</a>@g' \
20 -e 's@\b(D[0-9]+)\b@<a href="https://phab.enlightenment.org/\1">\1</a>@g' \
21 -e 's@\b(T[0-9]+)\b@<a href="https://phab.enlightenment.org/\1">\1</a>@g' \
22 -e 's@^(Differential Revision:) (https://phab.enlightenment.org/D[0-9]+)\b@\1 <a href="\2">\2</a>@g'