Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

BooK (2612)

BooK
  {book} {at} {cpan.org}
http://paris.mongueurs.net/
Yahoo! ID: philippe_bruhat (Add User, Send Message)

Obfuscation [plover.com]. Pink [axis-of-aevil.net]. HTTP::Proxy [cpan.org]. YEF [yapceurope.org]. Fishnet [perl.org]. Kapow [cpan.org]. Cog's [perl.org] bitch [cpan.org]. Invitation [perl.org]. White [perl.org] Camel [perl.org]. Nuff' said.

Journal of BooK (2612)

Thursday November 12, 2009
11:50 AM

git-dot

[ #39887 ]

I'm currently experimenting with creating graphs using Git... I'm not using historical data, or even data at all (I'll soon know the SHA1 of the empty tree by heart), just nodes with %s as their label (I have yet to find a use for the rest of the metadata).

gitk is nice to look at historical information, but not so good for graphs. On the other hand, GraphViz is great for showing graphs.

What's best than Perl (and a tiny wrapping of shell on top) to produce graphs?

    #!/bin/sh
    # create a good looking graph with dot
    echo "digraph G {"
    git log --pretty=format:"%h %p" $* \
    | perl -lna  -e 'print qq("$F[0]";),map{qq("$_"->"$F[0]";)}@F[1..$#F]'
    echo "}"

The output of this is usually boring, so just but pipe it to dot -Tpng -ograph.png and watch the pretty pictures.

Also, imagine a graph that has a full filesystem attached to each node. This is exactly the kind of stuff that Git can give us.

Not that I have any idea what this could be used for...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Sounds like a fun way to spend time. :) I'm sure there are a lot of possibilities for this, down the road.
    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Actually, I have at least two ideas about this. ;-)

      The first one will be the topic of the next entry of my use Perl journal, and the second is the basis of yet another grand application.

      • Cool! I look forward to seeing what marvelous applications the git storage engine can be bent toward. :)

        --
        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
        • Oops, I may have set your expectations too high...

          Actually:

          • The first idea uses git but really belongs to the Acme namespace.
          • The second idea is based on the principles at work in the git object database, but will most probably not use git directly (if I ever get around to it).