beber pushed a commit to branch master.

http://git.enlightenment.org/website/git.git/commit/?id=ddfda448422999695e3d1268c195293082c33600

commit ddfda448422999695e3d1268c195293082c33600
Author: Bertrand Jacquin <[email protected]>
Date:   Tue Feb 11 21:42:36 2014 +0100

    filters: Filter out commit messages to add some hilight on SHA1 hash and
    phab links
---
 cgitrc                            |  1 +
 public_html/filters/commit-filter | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/cgitrc b/cgitrc
index 37202d8..1bf6808 100644
--- a/cgitrc
+++ b/cgitrc
@@ -23,6 +23,7 @@ enable-subject-links=1
 enable-remote-branches=1
 
 about-filter=filters/about-filter
+commit-filter=filters/commit-filter
 source-filter=filters/source-filter
 
 max-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 @@
+#!/bin/bash
+#
+# This script can be used to generate links in commit messages.
+#
+# To use this script, refer to this file with either the commit-filter or the
+# repo.commit-filter options in cgitrc.
+#
+# The following environment variables can be used to retrieve the configuration
+# of the repository for which this script is called:
+# CGIT_REPO_URL        ( = repo.url       setting )
+# CGIT_REPO_NAME       ( = repo.name      setting )
+# CGIT_REPO_PATH       ( = repo.path      setting )
+# CGIT_REPO_OWNER      ( = repo.owner     setting )
+# CGIT_REPO_DEFBRANCH  ( = repo.defbranch setting )
+# CGIT_REPO_SECTION    ( = section        setting )
+# CGIT_REPO_CLONE_URL  ( = repo.clone-url setting )
+
+exec sed -r \
+  -e 's@\b([0-9a-fA-F]{7,40})\b@<a href="./?id=\1">\1</a>@g' \
+  -e 's@\b(D[0-9]+)\b@<a href="https://phab.enlightenment.org/\1";>\1</a>@g' \
+  -e 's@\b(T[0-9]+)\b@<a href="https://phab.enlightenment.org/\1";>\1</a>@g' \
+  -e 's@^(Differential Revision:) 
(https://phab.enlightenment.org/D[0-9]+)\b@\1 <a href="\2">\2</a>@g'

-- 


Reply via email to