2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
14 Usage: `basename $0` [-r] <path>
17 Recursively list all repos found starting at <path>
24 repotop=$(git -C $1 rev-parse --show-toplevel)
25 origin=$(git -C $repotop config --get remote.origin.url)
26 sha1=$(git -C $repotop rev-parse HEAD)
42 echo "Error, argument $1 not known" >&2
49 echo "Error, too many arguments" >&2
54 abspath=$(readlink -f $1)
56 if [ -n "$RECURSE" ]; then
57 for dir in $(find $abspath -type d -name .git)
59 repoinfo $(readlink -f $dir/..)