aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2020-07-01 21:15:05 -0400
committerKylie McClain <kylie@somas.is>2020-07-01 21:16:02 -0400
commit5eb7eb9affd8c44454fd4bb5e3b743029a2e0afb (patch)
tree3e54b7ded9c80258b578bc68c1ee40126b57a766
parentef765c383068ce14be65ddf98732d7a33d191322 (diff)
downloadgitolite-admin-5eb7eb9affd8c44454fd4bb5e3b743029a2e0afb.tar.gz
gitolite-admin-5eb7eb9affd8c44454fd4bb5e3b743029a2e0afb.tar.xz
gitolite-admin-5eb7eb9affd8c44454fd4bb5e3b743029a2e0afb.zip
irccat: support tags properly
-rwxr-xr-xlocal/hooks/repo-specific/irccat36
1 files changed, 22 insertions, 14 deletions
diff --git a/local/hooks/repo-specific/irccat b/local/hooks/repo-specific/irccat
index a8d612c..7f93be4 100755
--- a/local/hooks/repo-specific/irccat
+++ b/local/hooks/repo-specific/irccat
@@ -15,24 +15,32 @@ recipients=$(gitolite git-config "${GL_REPO}" gitolite-options.irccat.recipients
url="https://git.mutiny.red/${GL_REPO}"
while read -r oldrev newrev ref; do
- ref=$(printf '%s\n' "${ref}" | sed 's|^refs/heads/||')
echo args: ${oldrev} ${newrev} ${ref}
oldrev_abbr=$(printf '%s\n' "${oldrev}" | cut -c1-7)
newrev_abbr=$(printf '%s\n' "${newrev}" | cut -c1-7)
- if [ "${oldrev}" = 0000000000000000000000000000000000000000 ]; then
- msg "[${GL_REPO}:${ref}] new branch created starting from ${newrev_abbr} ${url}/${ref}"
- else
- committer=$(git log -1 --format='%cN')
- commits=$(git rev-list "${oldrev_abbr}".."${newrev_abbr}" | wc -l)
-
- git \
- log \
- --reverse \
- --format="%%PINK${GL_REPO}%%NORMAL:%%DGREEN${ref} %%BLUE${url}/%%YELLOW%h %%DGREEN%aN%%NORMAL: %s" "${oldrev_abbr}".."${newrev_abbr}" \
- | msg_stdin
- fi
-
+ case "${ref}" in
+ refs/heads/*)
+ ref=$(printf '%s\n' "${ref}" | cut -d/ -f3)
+ if [ "${oldrev}" = 0000000000000000000000000000000000000000 ]; then
+ msg "%PINK${GL_REPO}%NORMAL:%DGREEN${ref}%NORMAL %BLUE${url}/%YELLOW${ref}%NORMAL branch created starting from %YELLOW${newrev_abbr}"
+ else
+ committer=$(git log -1 --format='%cN')
+ commits=$(git rev-list "${oldrev_abbr}".."${newrev_abbr}" | wc -l)
+
+ git \
+ log \
+ --reverse \
+ --format="%%PINK${GL_REPO}%%NORMAL:%%DGREEN${ref} %%BLUE${url}/%%YELLOW%h %%DGREEN%aN%%NORMAL: %s" "${oldrev_abbr}".."${newrev_abbr}" \
+ | msg_stdin
+ fi
+ ;;
+ refs/tags/*)
+ ref=$(printf '%s\n' "${ref}" | cut -d/ -f3)
+
+ msg "%PINK${GL_REPO}%NORMAL:%DGREEN${ref}%NORMAL %BLUE${url}/%YELLOW${ref}%NORMAL tag created"
+ ;;
+ esac
done