On Tue, 7 Oct 2008 12:42:36 +0200
Antonio Ospite <[EMAIL PROTECTED]> wrote:

> The current branches layout is this (it looks like a quilt patchset,
> for now):
>   master
>     t/openezx/fixes
>       t/openezx/ezx-gpio
>         t/openezx/ezx-keypad
>           t/openezx/ezx-eoc
>             t/openezx/ezx-i2c
>               t/openezx/ezx-pcap
>                 t/openezx/pcap_ts
>                   t/openezx/ezx-mci
>                     t/openezx/ezx-udc
> 
> I hope that in the future the command "tg summary" could show that info,
> but for now I don't know how to _quickly_ retrieve the information
> about the layout of a topgit tree, but it can definitely be done using a
> combination of:
>   tg summary
>   tg info <branch>
> 

The attached script dumps the topgit layout to a graphviz file, you can
use 'dotty' to view it or render it to a graphic format using 'dot'.

Regards,
   Antonio 

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

  Web site: http://www.studenti.unina.it/~ospite
Public key: http://www.studenti.unina.it/~ospite/aopubkey.asc
#!/bin/sh

set -e
set -o pipefail

BRANCHES=$(tg summary | sed -e 's/^.*\[PATCH\]\s*//g')

TREEURL=$(cat .git/config | grep url | head -1 | tr -d ' ' | cut -d '=' -f 2)
DESC="$TREEURL - TopGit layout"

cat << EOM
# $DESC, render with:
#   dot -Tpng -o <ouput> <this file>

digraph G {

graph [
  rankdir = "BT"
  label="$DESC\n\n\n"
  fontsize = 14
  labelloc=top
  pad = "0.5,0.5"
];

EOM

for branch in $BRANCHES;
do
  DEPS=$(tg info $branch | grep "^Depends" | cut -d ' ' -f 2-)
  for dep in $DEPS;
  do
    echo "\"$branch\" -> \"$dep\";"
  done
done

echo '}'

Attachment: pgpYUuioEkDnX.pgp
Description: PGP signature

Reply via email to