From 4b70501e432eb5fd9ed04a4afbadafabd982e9fc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 5 Sep 2014 01:31:14 -0400 Subject: restructure to have most data in YAML --- git-shell-commands/change-description | 19 ------------------- git-shell-commands/change-owner | 19 ------------------- git-shell-commands/create-bare-repo | 18 ------------------ git-shell-commands/delete-repo | 17 ----------------- git-shell-commands/fetch-mirrors | 13 ------------- git-shell-commands/help | 12 ------------ git-shell-commands/hook-install | 28 ---------------------------- git-shell-commands/mirror | 10 ---------- git-shell-commands/mirrors | 9 --------- 9 files changed, 145 deletions(-) delete mode 100755 git-shell-commands/change-description delete mode 100755 git-shell-commands/change-owner delete mode 100755 git-shell-commands/create-bare-repo delete mode 100755 git-shell-commands/delete-repo delete mode 100755 git-shell-commands/fetch-mirrors delete mode 100755 git-shell-commands/help delete mode 100755 git-shell-commands/hook-install delete mode 100755 git-shell-commands/mirror delete mode 100755 git-shell-commands/mirrors (limited to 'git-shell-commands') diff --git a/git-shell-commands/change-description b/git-shell-commands/change-description deleted file mode 100755 index 60db0ac..0000000 --- a/git-shell-commands/change-description +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# * change-description -# Cambia la descripcion del projecto, necesita archivo description en el proyecto -# ssh git@host change-description repo "description" - -set -e - -repo=$1; shift - -repo="$(sed -r 's,^/*,,' <<<"$repo")" -_repo="$(sed -r -e '/(^|\/)\.\.($|\/)/d' -e "s,[^A-Za-z0-9\./_~-],,g" <<<"$repo")" -test "$repo" = "$_repo" || { printf 'Illegal name: %s\n' "${repo}"; exit 1; } - -if test -d "$repo".git; then - echo "${*}" > "${repo}".git/description -else - printf 'Does not exist: %s\n' "${repo}" - exit 1 -fi diff --git a/git-shell-commands/change-owner b/git-shell-commands/change-owner deleted file mode 100755 index 6b6f353..0000000 --- a/git-shell-commands/change-owner +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# * change-owner -# Define quiƩn manda -# ssh git@host change-owner repo "Hacklab" - -set -e - -repo=$1; shift - -repo="$(sed -r 's,^/*,,' <<<"$repo")" -_repo="$(sed -r -e '/(^|\/)\.\.($|\/)/d' -e "s,[^A-Za-z0-9\./_~-],,g" <<<"$repo")" -test "$repo" = "$_repo" || { printf 'Illegal name: %s\n' "${repo}"; exit 1; } - -if test -d "${repo}".git; then - git config -f "${repo}.git/config" "gitweb.owner" "${*}" -else - printf 'Does not exist: %s\n' "${repo}" - exit 1 -fi diff --git a/git-shell-commands/create-bare-repo b/git-shell-commands/create-bare-repo deleted file mode 100755 index b4d2d5f..0000000 --- a/git-shell-commands/create-bare-repo +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# * create-bare-repo -# Allows users to create repo.git -# ssh git@host create-bare-repo repo1 repo2 ... - -set -e - -for repo in "$@"; do - repo="$(sed -r 's,^/*,,' <<<"$repo")" - _repo="$(sed -r -e '/(^|\/)\.\.($|\/)/d' -e "s,[^A-Za-z0-9\./_~-],,g" <<<"$repo")" - test "$repo" != "$_repo" && { printf 'Illegal name: %s\n' "${repo}"; continue; } - test -d "$repo".git && { printf 'Already exists: %s\n' "${repo}"; continue; } - - mkdir -p -- "$repo".git - pushd "$repo".git >/dev/null - git init --bare - popd >/dev/null -done diff --git a/git-shell-commands/delete-repo b/git-shell-commands/delete-repo deleted file mode 100755 index 5ef94b1..0000000 --- a/git-shell-commands/delete-repo +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# * delete-repo -# Allows users to delete repositories permanently -# ssh git@host delete-repo repo1 repo2 ... - -set -e - -for repo in "$@"; do - repo="$(sed -r 's,^/*,,' <<<"$repo")" - _repo="$(sed -r -e '/(^|\/)\.\.($|\/)/d' -e "s,[^A-Za-z0-9\./_~-],,g" <<<"$repo")" - test "$repo" != "$_repo" && { printf 'Illegal name: %s\n' "${repo}"; continue; } - test ! -d "$repo".git && { printf 'Does not exist: %s\n' "${repo}"; continue; } - - echo "Removing ${repo}.git" - # lo and behold absolute horror - rm -rf -- "$repo".git -done diff --git a/git-shell-commands/fetch-mirrors b/git-shell-commands/fetch-mirrors deleted file mode 100755 index 15bf9c4..0000000 --- a/git-shell-commands/fetch-mirrors +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# * fetch-mirrors -# Actualiza el `mirrors` (espejos) creados con `mirror` -# ssh git@host fetch-mirrors - -set -e - -# Find all mirrors -"$(dirname "$0")"/mirrors | while read -r mirror; do - pushd "$mirror" >/dev/null - git remote update - popd >/dev/null -done diff --git a/git-shell-commands/help b/git-shell-commands/help deleted file mode 100755 index f1d116b..0000000 --- a/git-shell-commands/help +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# * help -# Obtiene los comando habilitados -# ssh git@host help - -set -e - -# Gets the initial comment after the shebeng from every git-shell-command -for c in "$(dirname "$0")"/*; do - sed -rn '2,/^[^#]/s/^# ?//p' "$c" - echo -done diff --git a/git-shell-commands/hook-install b/git-shell-commands/hook-install deleted file mode 100755 index b38836a..0000000 --- a/git-shell-commands/hook-install +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# * hook-install -# Instala un hook en un repo -# ssh git@host hook-install hook script repo [alt-dir] - -set -e - -exit 1 # I don't trust this script - -hook="${1}" -script="${HOME}/.ssh/git-hooks/${2}" -repo="${3}" -clone="${4:-${repo}}" - -repo="$(sed -r 's,^/*,,' <<<"$repo")" -_repo="$(sed -r -e '/(^|\/)\.\.($|\/)/d' -e "s,[^A-Za-z0-9\./_~-],,g" <<<"$repo")" -test "$repo" = "$_repo" || { printf 'Illegal name: %s\n' "${repo}"; exit 1; } -test -d "$repo".git || { printf 'Does not exist: %s\n' "${repo}"; exit 1; } - -# Tests -test -f "${repo}.git/HEAD" -test -f "${clone}/.git/HEAD" - -# Installs the generic hook that runs scripts -test -f "${repo}.git/hooks/${hook}" || ln -s "${HOME}/.ssh/git-hooks/generic" "${repo}.git/hooks/${hook}" - -# Install the hook on the repo -git config -f "${repo}.git/config" --add "hacking.hooks.${hook}.${2}" "${clone}" diff --git a/git-shell-commands/mirror b/git-shell-commands/mirror deleted file mode 100755 index 8282e9b..0000000 --- a/git-shell-commands/mirror +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# * mirror -# Espeja un repositorio -# ssh git@host mirror git://url/repo.git - -set -E - -for _m in "$@"; do - git clone --mirror "$_m" -done diff --git a/git-shell-commands/mirrors b/git-shell-commands/mirrors deleted file mode 100755 index 436564f..0000000 --- a/git-shell-commands/mirrors +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# * mirrors -# Muestra todos los repositorios espejos (mirror) -# ssh git@host mirrors - -set -e - -# Find all mirrors -find $(find * -name '*.git' -type d) -maxdepth 1 -name config -exec grep -l 'mirror\s*=\s*true' {} + | sed 's,/config$,,' -- cgit v1.2.3