Skip to content
Browse files

Implement "tg summary --deps" as a shell function.

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>
  • Loading branch information...
1 parent 9404aa1 commit 83d44c01a9494fdd1935012f3bad5ed805c750a3 @cederlys cederlys committed with Uwe Kleine-König Oct 3, 2010
Showing with 30 additions and 9 deletions.
  1. +9 −9 tg-summary.sh
  2. +21 −0 tg.sh
View
18 tg-summary.sh
@@ -99,36 +99,36 @@ process_branch()
"$name" "$subject"
}
+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;
- fi;
+ fi
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" ||
dep_is_tgish=false
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
- continue
+ else
+ process_branch
fi
-
- process_branch
done
if [ -n "$graphviz" ]; then
View
21 tg.sh
@@ -239,6 +239,27 @@ branch_empty()
[ -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()
{

0 comments on commit 83d44c0

Please sign in to comment.
Something went wrong with that request. Please try again.