]> Sergey Matveev's repositories - dotfiles.git/blob - bin/bin/git-list-gen.sh
Fixed git-list-gen.sh location
[dotfiles.git] / bin / bin / git-list-gen.sh
1 #!/bin/sh -e
2 # Generate list of available git repositories
3
4 cat pre.txt
5 cat <<EOF
6 -------------------------------+------------------+---------------------------
7 Repository name                | Latest change    | Description, upstream URLs
8 -------------------------------+------------------+---------------------------
9 EOF
10
11 find . -name '*.git' -maxdepth 1 -mindepth 1 | sort | while read dir ; do
12     cd $dir
13     for commit in master main trunk ; do
14         mtime=`git cat-file -p $commit 2>/dev/null | perl -lane 'print $F[$#F - 1] if /^author/'`
15         [ -z "$mtime" ] || break
16     done
17     [ -z "$mtime" ] || mtime=`date -u -j -f %s $mtime "+%Y-%m-%d %H:%M"`
18     printf "%-30s | %16s | %s\n" ${dir#./} "$mtime" "`cat description`"
19     git remote | while read remote ; do
20         printf "%-30s | %16s | %s\n" "" "" "`git remote get-url $remote`"
21     done
22     cd ..
23 done