commit c23fa2677ef958023c49303eea32343efcab8edd
parent 636208156b4f43f556edc35d6819ff3f9191651d
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Sat, 15 Jun 2024 20:23:39 +0200
fix: general cleanup
Diffstat:
4 files changed, 9 insertions(+), 24 deletions(-)
diff --git a/bin/git_create_repo.sh b/bin/git_create_repo.sh
@@ -68,7 +68,7 @@ PUH_FILE="${1}/${2}/${3}.git/hooks/post-update"
touch "$PUH_FILE"
chmod +x "$PUH_FILE"
echo "#!/usr/bin/env sh" >> "$PUH_FILE"
-echo "~/bin/git_post_push.sh \"${1}\" \"${2}\" \"${3}\"" >> "$PUH_FILE"
+echo "~/bin/git_post_push.sh \"${1}\" \"${2}\" \"${3}\" \$@" >> "$PUH_FILE"
# make branch cloneable via http(s)
git update-server-info
diff --git a/bin/git_export_tarball.sh b/bin/git_export_tarball.sh
@@ -5,6 +5,7 @@
# $1 - HTML Root
# $2 - prv/pub
# $3 - repo name
+# $@ - optional list of refs, as given to post-update hook
# Error out if not all options are given
if [ -z "$3" ]; then
diff --git a/bin/git_post_push.sh b/bin/git_post_push.sh
@@ -5,6 +5,7 @@
# $1 - HTML Root
# $2 - prv/pub
# $3 - repo name
+# $@ - optional list of refs, as given to post-update hook
# Error out if not all options are given
if [ -z "$3" ]; then
@@ -12,13 +13,14 @@ if [ -z "$3" ]; then
git_post_push.sh \\
\"/var/www/git.example.git\" \\
\"pub\" \\
- \"stagit-jayvii.de\"
+ \"stagit-jayvii.de\" \\
+ \$@
"
exit 1;
fi
-. $HOME/bin/git_update_repo.sh "${1}" "${2}" "${3}"
-. $HOME/bin/git_export_tarball.sh "${1}" "${2}" "${3}" $@
-. $HOME/bin/git_update_repo_html.sh "${1}" "${2}" "${3}"
-. $HOME/bin/git_update_index_html.sh "${1}" "${2}"
+~/bin/git_update_repo.sh "${1}" "${2}" "${3}"
+~/bin/git_export_tarball.sh "${1}" "${2}" "${3}" $@
+~/bin/git_update_repo_html.sh "${1}" "${2}" "${3}"
+~/bin/git_update_index_html.sh "${1}" "${2}"
diff --git a/bin/git_post_push_all.sh b/bin/git_post_push_all.sh
@@ -1,18 +0,0 @@
-#!/usr/bin/env sh
-# SPDX-License-Identifier: AGPL-3.0-or-later
-# SPDX-FileCopyrightText: 2024 JayVii <jayvii[AT]posteo[DOT]de>
-
-# $1 - HTML Root
-
-# Error out if not all options are given
-if [ -z "$1" ]; then
- echo "Usage:
-git_post_push_all.sh \\
- \"/var/www/git.example.git\"
- "
- exit 1;
-fi
-
-find "${1}/pub" -maxdepth 1 -type d -name "*.git" -exec {}/hooks/post-update \;
-find "${1}/prv" -maxdepth 1 -type d -name "*.git" -exec {}/hooks/post-update \;
-