diff options
Diffstat (limited to 'nix/per-host/git/git-shell-commands/hide')
| -rwxr-xr-x | nix/per-host/git/git-shell-commands/hide | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/nix/per-host/git/git-shell-commands/hide b/nix/per-host/git/git-shell-commands/hide new file mode 100755 index 0000000..4208e08 --- /dev/null +++ b/nix/per-host/git/git-shell-commands/hide @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# git-shell-commands(5) subcommand: make a repo private again by removing +# the git-daemon-export-ok marker. SSH access is unaffected. +# Run: ssh git@git.kumardamani.net hide <name> + +name="${1:-}" +case "$name" in + ""|*[!a-zA-Z0-9._-]*|*..*) + echo "usage: hide <name>" >&2 + exit 1 + ;; +esac +repo="/srv/git/$name.git" +if [ ! -d "$repo" ]; then + echo "error: no such repo '$name'" >&2 + exit 1 +fi +rm -f "$repo/git-daemon-export-ok" +echo "hidden (private): '$name'" |
