From 5aed7e7bad8c23080139b452adac75d2571b6dfa Mon Sep 17 00:00:00 2001 From: Per Cederqvist Date: Wed, 14 Jul 2010 18:21:15 +0200 Subject: [PATCH] Added the --deps option to "tg summary". MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The --deps option can be used by scripts that need to know the dependencies between the topic branches. Signed-off-by: Per Cederqvist Signed-off-by: Uwe Kleine-König --- README | 4 ++++ tg-summary.sh | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README b/README index dcb7e80..d7dfb5f 100644 --- a/README +++ b/README @@ -358,6 +358,10 @@ tg summary order. In more complex scenarios, a text graph view would be much more useful, but that is not yet implemented. + The --deps option outputs dependency informations between + branches in a machine-readable format. Feed this to "tsort" + to get the output from --sort. + TODO: Speed up by an order of magnitude TODO: Text graph view diff --git a/tg-summary.sh b/tg-summary.sh index a2cb986..a92480f 100644 --- a/tg-summary.sh +++ b/tg-summary.sh @@ -6,6 +6,7 @@ terse= graphviz= sort= +deps= ## Parse options @@ -19,22 +20,19 @@ while [ -n "$1" ]; do graphviz=1;; --sort) sort=1;; + --deps) + deps=1;; *) - echo "Usage: tg [...] summary [-t | --sort | --graphviz]" >&2 + echo "Usage: tg [...] summary [-t | --sort | --deps | --graphviz]" >&2 exit 1;; esac done curname="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')" -! [ -n "$terse" -a -n "$graphviz" ] || - die "-t and --graphviz options are mutual exclusive" - -! [ -n "$sort" -a -n "$graphviz" ] || - die "--sort and --graphviz options are mutual exclusive" - -! [ -n "$sort" -a -n "$terse" ] || - die "-t and --sort options are mutual exclusive" +[ "$terse$graphviz$sort$deps" = "" ] || + [ "$terse$graphviz$sort$deps" = "1" ] || + die "mutually exclusive options given" if [ -n "$graphviz" ]; then cat < \"$dep\";" + elif [ -n "$deps" ]; then + echo "$name $dep" else echo "$name $dep" >&4 fi -- 2.30.2