This avoids running "$tg summary --deps" from all commands that need
that information internally.
Signed-off-by: Per Cederqvist <ceder@lysator.liu.se>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+if [ -n "$deps" ]; then
+ list_deps
+ exit 0
+fi
+
git for-each-ref refs/top-bases |
while read rev type ref; do
name="${ref#refs/top-bases/}"
if branch_annihilated "$name"; then
continue;
git for-each-ref refs/top-bases |
while read rev type ref; do
name="${ref#refs/top-bases/}"
if branch_annihilated "$name"; then
continue;
if [ -n "$terse" ]; then
echo "$name"
if [ -n "$terse" ]; then
echo "$name"
- continue
- fi
- if [ -n "$graphviz$sort$deps" ]; then
+ elif [ -n "$graphviz$sort" ]; then
git cat-file blob "$name:.topdeps" | while read dep; do
dep_is_tgish=true
ref_exists "refs/top-bases/$dep" ||
git cat-file blob "$name:.topdeps" | while read dep; do
dep_is_tgish=true
ref_exists "refs/top-bases/$dep" ||
if ! "$dep_is_tgish" || ! branch_annihilated $dep; then
if [ -n "$graphviz" ]; then
echo "\"$name\" -> \"$dep\";"
if ! "$dep_is_tgish" || ! branch_annihilated $dep; then
if [ -n "$graphviz" ]; then
echo "\"$name\" -> \"$dep\";"
- elif [ -n "$deps" ]; then
- echo "$name $dep"
else
echo "$name $dep" >&4
fi
fi
done
else
echo "$name $dep" >&4
fi
fi
done
done
if [ -n "$graphviz" ]; then
done
if [ -n "$graphviz" ]; then
[ -z "$(git diff-tree "refs/top-bases/$1" "$1" -- | fgrep -v " .top")" ]
}
[ -z "$(git diff-tree "refs/top-bases/$1" "$1" -- | fgrep -v " .top")" ]
}
+# list_deps
+list_deps()
+{
+ git for-each-ref refs/top-bases |
+ while read rev type ref; do
+ name="${ref#refs/top-bases/}"
+ if branch_annihilated "$name"; then
+ continue;
+ fi
+
+ git cat-file blob "$name:.topdeps" | while read dep; do
+ dep_is_tgish=true
+ ref_exists "refs/top-bases/$dep" ||
+ dep_is_tgish=false
+ if ! "$dep_is_tgish" || ! branch_annihilated $dep; then
+ echo "$name $dep"
+ fi
+ done
+ done
+}
+
# switch_to_base NAME [SEED]
switch_to_base()
{
# switch_to_base NAME [SEED]
switch_to_base()
{