From 43930cb8c22bc28ed64362845c5f4ebf54faabf2 Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Sat, 1 Aug 2026 21:43:25 -0400 Subject: added git with cgit --- nix/per-host/git/git-shell-commands/desc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 nix/per-host/git/git-shell-commands/desc (limited to 'nix/per-host/git/git-shell-commands/desc') diff --git a/nix/per-host/git/git-shell-commands/desc b/nix/per-host/git/git-shell-commands/desc new file mode 100755 index 0000000..cd0e569 --- /dev/null +++ b/nix/per-host/git/git-shell-commands/desc @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# git-shell-commands(5) subcommand: set or show a repo's description as +# displayed in cgit. +# Run: ssh git@git.kumardamani.net desc [description...] + +name="${1:-}" +case "$name" in + ""|*[!a-zA-Z0-9._-]*|*..*) + echo "usage: desc [description...]" >&2 + exit 1 + ;; +esac +repo="/srv/git/$name.git" +if [ ! -d "$repo" ]; then + echo "error: no such repo '$name'" >&2 + exit 1 +fi +shift +if [ $# -eq 0 ]; then + cat "$repo/description" + exit 0 +fi +printf '%s\n' "$*" > "$repo/description" +echo "description for '$name':" +cat "$repo/description" -- cgit v1.2.3