[sysadmin-bin] Allow git hooks commit messages to appear on the GitLab web UI
- From: Andrea Veri <averi src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Allow git hooks commit messages to appear on the GitLab web UI
- Date: Fri, 10 Sep 2021 09:22:09 +0000 (UTC)
commit 10975d282bd58fdd7aab2a585510bd78713603d5
Author: Andrea Veri <averi redhat com>
Date: Fri Sep 10 11:21:41 2021 +0200
Allow git hooks commit messages to appear on the GitLab web UI
git/pre-receive-check-maintainers | 2 +-
git/pre-receive-check-po | 5 +++++
git/pre-receive-check-translations | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/git/pre-receive-check-maintainers b/git/pre-receive-check-maintainers
index 100f7d1..3485766 100755
--- a/git/pre-receive-check-maintainers
+++ b/git/pre-receive-check-maintainers
@@ -51,7 +51,7 @@ check_maintainers() {
fi
fi
else
- echo "A valid $REPONAME.doap file is required. See https://wiki.gnome.org/Git/FAQ" >&2
+ echo "GL-HOOK-ERR: A valid $REPONAME.doap file is required. See https://wiki.gnome.org/Git/FAQ" >&2
return 1
fi
}
diff --git a/git/pre-receive-check-po b/git/pre-receive-check-po
index 20b3ea9..6dcd4a6 100755
--- a/git/pre-receive-check-po
+++ b/git/pre-receive-check-po
@@ -1,5 +1,7 @@
#!/bin/bash
+GITLAB_ERR_PREFIX='GL-HOOK-ERR:'
+
check_po() {
rev=$1
path=$2
@@ -23,6 +25,7 @@ check_po() {
result=`git cat-file blob "$rev:$path" | msgfmt $dash_c -o /dev/null - 2>&1`
if [ $? -gt 0 ]; then
cat <<EOF >&2
+$GITLAB_ERR_PREFIX
---
The following translation (.po) file appears to be invalid.$branch_message
@@ -53,6 +56,7 @@ EOF
result=""
if [ "$result" != "" ]; then
cat <<EOF >&2
+$GITLAB_ERR_PREFIX
---
The following translation (.po) file should ensure the translated content ends with a
semicolon.$branch_message
@@ -76,6 +80,7 @@ EOF
# Check for the absence of an executable flag
if expr "$mode" : ".*\([1357]..\|[1357].\|[1357]\)$" > /dev/null 2>& 1; then
cat <<EOF >&2
+$GITLAB_ERR_PREFIX
---
The following translation file appears to have its executable flag set.$branch_message
diff --git a/git/pre-receive-check-translations b/git/pre-receive-check-translations
index 63458a6..ad1ef4f 100755
--- a/git/pre-receive-check-translations
+++ b/git/pre-receive-check-translations
@@ -16,7 +16,7 @@ import sys
from git import *
def error(msg):
- print >>sys.stderr, msg
+ print >>sys.stderr, 'GL-HOOK-ERR:', msg
sys.exit(1)
def config_dirs(key, default):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]