From 53d246c2adda06165b21c55a2d5a4dc867b66994 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sat, 15 Nov 2025 00:22:34 +0100 Subject: add git shell scripts --- modules/git/git-shell-commands/desc | 6 ++++++ modules/git/git-shell-commands/help | 11 +++++++++++ modules/git/git-shell-commands/init | 9 +++++++++ modules/git/git-shell-commands/owner | 6 ++++++ modules/git/git-shell-commands/section | 6 ++++++ 5 files changed, 38 insertions(+) create mode 100755 modules/git/git-shell-commands/desc create mode 100755 modules/git/git-shell-commands/help create mode 100755 modules/git/git-shell-commands/init create mode 100755 modules/git/git-shell-commands/owner create mode 100755 modules/git/git-shell-commands/section (limited to 'modules/git/git-shell-commands') diff --git a/modules/git/git-shell-commands/desc b/modules/git/git-shell-commands/desc new file mode 100755 index 0000000..52cc8bb --- /dev/null +++ b/modules/git/git-shell-commands/desc @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +if [ -f "$1/config" ]; then + cd "$1" + git config cgit.desc "$2" +fi diff --git a/modules/git/git-shell-commands/help b/modules/git/git-shell-commands/help new file mode 100755 index 0000000..7572fe4 --- /dev/null +++ b/modules/git/git-shell-commands/help @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +echo "Commands:" +echo " init " +echo " Initialize a new bare repo, default branch is main" +echo " desc " +echo " Set repo description" +echo " owner " +echo " Set repo owner" +echo " section
" +echo " Set repo section" diff --git a/modules/git/git-shell-commands/init b/modules/git/git-shell-commands/init new file mode 100755 index 0000000..603b817 --- /dev/null +++ b/modules/git/git-shell-commands/init @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +REPO="$1" + +if [ ! -f "$REPO/config" ]; then + mkdir -p "$REPO" + cd "$REPO" + git init --bare --shared +fi diff --git a/modules/git/git-shell-commands/owner b/modules/git/git-shell-commands/owner new file mode 100755 index 0000000..d65fd02 --- /dev/null +++ b/modules/git/git-shell-commands/owner @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +if [ -f "$1/config" ]; then + cd "$1" + git config cgit.owner "$2" +fi diff --git a/modules/git/git-shell-commands/section b/modules/git/git-shell-commands/section new file mode 100755 index 0000000..b1a998e --- /dev/null +++ b/modules/git/git-shell-commands/section @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +if [ -f "$1/config" ]; then + cd "$1" + git config cgit.section "$2" +fi -- cgit v1.2.3