mirror of
https://github.com/flynx/git-utils.git
synced 2025-10-28 10:40:08 +00:00
Compare commits
2 Commits
9db7680605
...
433faa03ab
| Author | SHA1 | Date | |
|---|---|---|---|
| 433faa03ab | |||
| c2da2b01b4 |
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
shopt -s globstar
|
||||
|
||||
while true ; do
|
||||
@ -20,7 +21,7 @@ while true ; do
|
||||
echo "or recursively:"
|
||||
echo " $ git listall -r > reposiotry.lst"
|
||||
echo
|
||||
echo "If a repository list already exists it can be expanded via:"
|
||||
echo "If a repository list already exists it can be updated via:"
|
||||
echo " $ git listall -r reposiotry.lst >> reposiotry.lst"
|
||||
echo
|
||||
echo "For info on list file format see:"
|
||||
@ -41,6 +42,12 @@ while true ; do
|
||||
continue
|
||||
;;
|
||||
|
||||
-u|--update)
|
||||
REPOS_FILE=$2
|
||||
shift 2
|
||||
continue
|
||||
;;
|
||||
|
||||
-*|--*)
|
||||
echo "Error: unknown option: \"$1\"" >&2
|
||||
exit
|
||||
@ -73,6 +80,10 @@ else
|
||||
REPOS=(./*/.git/config)
|
||||
fi
|
||||
|
||||
if [ -e "$LIST" ] ; then
|
||||
echo
|
||||
echo "# $(date)"
|
||||
fi
|
||||
# format and print unique lines...
|
||||
lines=()
|
||||
{
|
||||
@ -82,7 +93,8 @@ lines=()
|
||||
| sed -n '/\[remote "origin"\]/,/^\s*url/p' \
|
||||
| grep 'url = ' \
|
||||
| sed \
|
||||
-e 's/\s*url\s*=\s*//')
|
||||
-e 's/\s*url\s*=\s*//' \
|
||||
-e 's/.git\s*$//')
|
||||
[ -z $remote ] \
|
||||
&& continue
|
||||
line="$path=$remote"
|
||||
@ -92,7 +104,9 @@ lines=()
|
||||
if [ -e "$LIST" ] ; then
|
||||
cat "$LIST" \
|
||||
| grep -ve '\(^\s*#\|^\s*$\)' \
|
||||
| sed -e 's/^-//'
|
||||
| sed \
|
||||
-e 's/^-//' \
|
||||
-e 's/.git\s*$//'
|
||||
fi
|
||||
} \
|
||||
| sort \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user