git-hooks

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.tronto.net/git-hooks
Download | Log | Files | Refs | README

commit 6f426c3b72cfafb6696881530bfa62803eae84ab
parent 3d5c94be4e903a689299a8347957bc4a7beb0a37
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Mon, 21 Nov 2022 17:50:31 +0100

Possible simplification

Diffstat:
Mpost-receive-stagit | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/post-receive-stagit b/post-receive-stagit @@ -1,26 +1,27 @@ #!/bin/sh +yourname="Sebastiano Tronto repo="$PWD" name="$(basename $repo .git)" +baseurl="https://git.tronto.net" basedir="/var/www/htdocs/git.tronto.net" htdir="$basedir/$name" filesdir="/home/git/FILES" bindir="/home/git/BIN" setupinfo() { - echo "Sebastiano Tronto" > owner - echo "https://git.tronto.net/$name" > url + echo "$yourname" > owner + echo "$baseurl/$name" > url + git update-server-info } genstagit() { rm -rf "$htdir" mkdir -p "$basedir" cp -r "$repo" "$htdir" - cd "$htdir" && \ - git update-server-info && \ - git archive HEAD --prefix="$name/" -o "$basedir/$name.zip" stagit -l 100 "$repo" git show master:README.md > file/README.md + git archive HEAD --prefix="$name/" -o "$basedir/$name.zip" } cpindexfile() {