From: Nicolas Boisselier Date: Fri, 19 Aug 2016 11:03:52 +0000 (+0100) Subject: git_list X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=6a4f9aeaae0e1ab6c897bab2e18aa2a520b94590;p=nb.git git_list --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index 0c9c1fcf..435bd7b3 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -73,9 +73,8 @@ git_commit_push_add() { } git_create() { -# NB 14.04.16 shell_help_noarg "Usage: $FUNCNAME DIRECTORY" "$@" && return 1 -# NB 14.04.16 declare dir="$1"; shift shell_help "Usage: $FUNCNAME create git project from current dir" "$@" && return 1 + declare dir="$(basename $(pwd))" declare repo="$GIT_REPO" [ -n "$1" ] && repo="$1" && shift @@ -83,7 +82,6 @@ git_create() { # # Check, create repo on server # -# NB 14.04.16 [ -e "$dir" ] && echo ">$dir already exists!" 1>&2 && return 1 echo ">git init --bare ${dir}.git" local user=${repo%@*} @@ -111,3 +109,7 @@ git_create() { git_clone() { git clone $GIT_REPO:${1%.git}.git } + +git_list() { + ssh $GIT_REPO list | perl -ne '/(\S+).git/ and print "$1\n"' +}