stagit-scripts

No description
git clone git://niliara.net/stagit-scripts
Log | Files | Refs

commit e3a91069e35cfed4a96953da4577890bacdcc205
Author: nil <nil@niliara.net>
Date:   Thu,  6 Nov 2025 20:02:22 +0000

initialize repository

Diffstat:
A_templates/post-receive | 13+++++++++++++
Anew.sh | 19+++++++++++++++++++
Aremove.sh | 17+++++++++++++++++
Aupdate-index.sh | 4++++
4 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/_templates/post-receive b/_templates/post-receive @@ -0,0 +1,13 @@ +#!/bin/sh +name="" + +while read oldrev newrev ref +do + cd /var/www/git/$name + stagit /var/git/$name/ + + cd /var/git/$name/ + git update-server-info + + /var/git/update-index.sh +done diff --git a/new.sh b/new.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -z $1 ]; then + echo "No arguments given." + exit 1 +fi + +git init --bare $1 + +cp ~/_templates/post-receive /var/git/$1/hooks/ +echo "/var/git/$1/hooks/post-receive" | xargs sed -i "s|name=\"\"|name=\"$1\"|g" +echo "/var/git/update-index.sh" | xargs sed -i "s|> index.html|/var/git/$1/ > index.html|g" + +rm /var/git/$1/description +echo "No description" > /var/git/$1/description +echo "git://niliara.net/$1" > /var/git/$1/url + +mkdir /var/www/git/$1 +ln -s /var/www/git/logo.png /var/www/git/$1/ diff --git a/remove.sh b/remove.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +selected="$(find * -maxdepth 0 \ + -not -name '.*' \ + -not -name '_*' \ + -not -name '*.sh' \ + | fzf)" + +if [ -z $selected ]; then + echo "No repository selected." + exit 1 +fi + +echo "/var/git/update-index.sh" | xargs sed -i "s| /var/git/$selected/||g" + +rm -rf /var/www/git/$selected/ +rm -rf /var/git/$selected/ diff --git a/update-index.sh b/update-index.sh @@ -0,0 +1,4 @@ +#!/bin/sh +cd /var/www/git + +stagit-index /var/git/stagit-scripts/ > index.html