about summary refs log tree commit diff
path: root/nixos/cobalt/services/gitolite-noncore/rename
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-02-10 18:38:19 +0900
committersefidel <contact@sefidel.net>2023-02-10 18:38:45 +0900
commit0d28ac05f7ae524fe17a7a3485744e3ffa99ccb6 (patch)
treec1ab383a15c8705d99fe2f5e5a69373b3d951a4d /nixos/cobalt/services/gitolite-noncore/rename
parent3a0ab37f75f127fa5a5746d4d741b0122ef7a8aa (diff)
downloadnixrc-0d28ac05f7ae524fe17a7a3485744e3ffa99ccb6.tar.gz
nixrc-0d28ac05f7ae524fe17a7a3485744e3ffa99ccb6.zip
feat(nixos): remove cobalt
Diffstat (limited to 'nixos/cobalt/services/gitolite-noncore/rename')
-rw-r--r--nixos/cobalt/services/gitolite-noncore/rename62
1 files changed, 0 insertions, 62 deletions
diff --git a/nixos/cobalt/services/gitolite-noncore/rename b/nixos/cobalt/services/gitolite-noncore/rename
deleted file mode 100644
index 00aa5ca..0000000
--- a/nixos/cobalt/services/gitolite-noncore/rename
+++ /dev/null
@@ -1,62 +0,0 @@
-
-# Usage:    ssh git@host rename [-c] <repo1> <repo2>
-#
-# Renames repo1 to repo2. You must be the creator of repo1, and have
-# create ("C") permissions for repo2, which of course must not exist.
-# Alternatively you must be an account admin, that is, you must have
-# write access to the gitolite-admin repository. If you have "C"
-# permissions for repo2 then you can use the -c option to take over
-# as creator of the repository.
-
-die() { echo "$@" >&2; exit 1; }
-usage() { perl -lne 'print substr($_, 2) if /^# Usage/../^$/' < $0; exit 1; }
-[ -z "$1" ] && usage
-[ "$1" = "-h" ] && usage
-[ -z "$GL_USER" ] && die GL_USER not set
-
-# ----------------------------------------------------------------------
-
-if [ "$1" = "-c" ]
-then	shift
-	takeover=true
-else	takeover=false
-fi
-
-from="$1"; shift
-to="$1"; shift
-[ -z "$to" ] && usage
-
-topath=$GL_REPO_BASE/$to.git
-
-checkto() {
-	gitolite access -q "$to" $GL_USER ^C any ||
-		die "'$to' already exists or you are not allowed to create it"
-}
-
-if gitolite access -q gitolite-admin $GL_USER
-then
-	# the user is an admin so we can avoid most permission checks
-	if $takeover
-	then checkto
-	elif [ -e $topath ]
-	then die "'$to' already exists"
-	fi
-else
-	# the user isn't an admin, so do all the checks
-	checkto
-	gitolite creator "$from" $GL_USER ||
-		die "'$from' does not exist or you are not allowed to delete it"
-fi
-
-# ----------------------------------------------------------------------
-
-mv $GL_REPO_BASE/$from.git $topath
-[ $? -ne 0 ] && exit 1
-
-$takeover && echo $GL_USER > $topath/gl-creator
-
-[ -f "$HOME/projects.list" ] && sed "s:$from.git$:$to.git:g" -i "$HOME/projects.list"
-
-echo "$from renamed to $to" >&2
-
-exit