git-srv-admin.sh: Add stub command list-maintainers

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-04-10 18:18:39 +00:00
commit f7ac54013e

View file

@ -16,6 +16,7 @@ usage()
|
| create-repo name
| list-repos
| list-maintainers
|
EOT
[ "$1" ] && exit $1
@ -101,6 +102,23 @@ list_repos()
return $?
}
list_maintainers()
{
local dev_chief=jan
local master_dir=/srv/git/$dev_chief/proj
local d pdir p val
for d in $master_dir; do
for pdir in `find $d -maxdepth 1 -mindepth 1 -type d`; do
#echo "$d -> $pdir"
p=`basename $pdir`
val=`git -C $pdir show HEAD:make/project.conf 2>/dev/null | sed -n '/^\[global\]/,/^\[/ p' | sed '/group/ !d; s/.*= *//'`
[ "$val" ] || continue
echo "$p $val"
done
done
}
# ----------------- here we go
no_error_if_exists=0
id=`whoami`
@ -170,6 +188,9 @@ create-project-dir|create-repo-dir)
check_user_is_self
create_repo_dir "$@"
;;
list-maintainers|maintainers)
list_maintainers
;;
*)
usage 1
;;