commit 2b36625af98f47e88f1186dc6a11aced4b42fa61
parent eabe4fae900b3ea32fc8a97ea6724099b079c7f9
Author: Walther Chen <hwchen@hwc.io>
Date:   Fri, 15 Aug 2025 13:23:44 +0000

update for hwc.io

Diffstat:
MREADME.md | 2++
Mi | 4++--
Anew-host | 5+++++
Mnon-interactive/mirror-repository | 15+++++++++------
Mnon-interactive/post-update-hook | 5+++--
5 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -5,6 +5,8 @@ of the scripts assume that you have my version of stagit installed. Some of the scripts are based on the ones found [here][src]. +(This repo is under the git user, which automatically opens the git shell. To make changes and push, use su --shell /usr/bin/bash git) + ## License This repository is licensed under the CC0 1.0 Universal license and therefore is diff --git a/i b/i @@ -18,6 +18,6 @@ mkdir "$p" && \ ln -sf "/usr/local/share/doc/stagit/example_post-receive.sh" "hooks/post-receive" ln -sf "$curr_dir/non-interactive/post-update-hook" "hooks/post-update" -echo "Oscar Benedito" > "owner" -echo "https://git.oscarbenedito.com/${p%.git}" > "url" +echo "Walther Chen" > "owner" +echo "git://git.hwc.io/${p%.git}" > "url" echo "${p%.git}" > "description" diff --git a/new-host b/new-host @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +eval $(ssh-agent -s) +ssh-add /srv/git/.ssh/id_ed25519_sourcehut +git -C /srv/git/bioinformatics.git push srht main diff --git a/non-interactive/mirror-repository b/non-interactive/mirror-repository @@ -8,17 +8,20 @@ fi set -e -trap "notify \"ERROR pushing $repo\" \"There was an error pushing $repo to either SourceHut or GitHub.\"" ERR +eval $(ssh-agent -s) +ssh-add /srv/git/.ssh/id_ed25519_sourcehut + +trap "notify \"ERROR pushing $repo\" \"There was an error pushing $repo to either SourceHut or Codeberg.\"" ERR dir="$(pwd)" repo="$(basename "$(pwd)" ".git")" git -C "$dir" remote get-url srht || \ - git -C "$dir" remote add srht "git@git.sr.ht:~ob/$repo" + git -C "$dir" remote add srht "git@git.sr.ht:~hwchen/$repo" git -C "$dir" push --all --force --prune srht git -C "$dir" push --tags --force --prune srht -git -C "$dir" remote get-url github || \ - git -C "$dir" remote add github "git@github.com:oscarbenedito/$repo" -git -C "$dir" push --all --force --prune github -git -C "$dir" push --tags --force --prune github +#git -C "$dir" remote get-url codeberg || \ +# git -C "$dir" remote add codeberg "git@codeberg.org:hwchen/$repo" +#git -C "$dir" push --all --force --prune codeberg +#git -C "$dir" push --tags --force --prune codeberg diff --git a/non-interactive/post-update-hook b/non-interactive/post-update-hook @@ -3,9 +3,10 @@ # uncomment this line to pack repository for dumb http protocol clone/fetch # git update-server-info -# if repository is public, mirror to SourceHut and GitHub +# if repository is public, mirror to SourceHut and Codeberg if [ -f "git-daemon-export-ok" ] && [ -f "category" ]; then # piping into at(1) as a workaround to let git connection finish before # script has finished running - echo "$(dirname "$(realpath "$0")")/mirror-repository $(pwd)" | at now 2>/dev/null + #echo "$(dirname "$(realpath "$0")")/mirror-repository $(pwd)" | at now # 2>/dev/null + $(dirname "$(realpath "$0")")/mirror-repository $(pwd) fi