diff options
| author | Kumar Damani <me@kumardamani.net> | 2026-08-02 01:43:25 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2026-08-02 01:43:25 +0000 |
| commit | 43930cb8c22bc28ed64362845c5f4ebf54faabf2 (patch) | |
| tree | 7351357bd38139b0267f1a4cdeff4b5143f5e89a /nix/per-host/git/git-shell-commands/publish | |
| parent | 3e139a0e702513f6e1145158b2695b43c8251b92 (diff) | |
added git with cgit
Diffstat (limited to 'nix/per-host/git/git-shell-commands/publish')
| -rwxr-xr-x | nix/per-host/git/git-shell-commands/publish | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/nix/per-host/git/git-shell-commands/publish b/nix/per-host/git/git-shell-commands/publish new file mode 100755 index 0000000..54aff26 --- /dev/null +++ b/nix/per-host/git/git-shell-commands/publish @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# git-shell-commands(5) subcommand: make a repo public (browsable in cgit +# and cloneable over HTTP) by creating the git-daemon-export-ok marker. +# Run: ssh git@git.kumardamani.net publish <name> + +name="${1:-}" +case "$name" in + ""|*[!a-zA-Z0-9._-]*|*..*) + echo "usage: publish <name>" >&2 + exit 1 + ;; +esac +repo="/srv/git/$name.git" +if [ ! -d "$repo" ]; then + echo "error: no such repo '$name'" >&2 + exit 1 +fi +touch "$repo/git-daemon-export-ok" +echo "published: https://git.kumardamani.net/$name" |
