[Haskell-cafe] darcs patch dependencies in dot format

Simon Michael simon at joyful.com
Mon May 14 16:21:49 CEST 2012


On 5/12/12 5:52 AM, Sönke Hahn wrote:
> Hi all!
>
> Yesterday I wrote a little tool to output the dependencies of darcs
> patches in dot format. The hardest part was to wrap my head around the
> darcs API and find a way to let it compute the patch dependencies. I
> don't know, if I got it right, but it looks correct at first glance.
>
> Here is the code:
>
> https://patch-tag.com/r/shahn/darcs2dot
>
> To use it just execute the program in a darcs repo and it will output a
> dot graph to stdout. The graph does not contain all dependencies, but
> the transitive reduction. The patch names are truncated at 15 characters.
>
> And here is an example graph:
>
> http://open-projects.net/~shahn/patchDeps.pdf
>
> These are the patch dependencies of one of my darcs repos
> (https://patch-tag.com/r/shahn/hate). Some observations I made:
>
> * There are two completely separate subgraphs. One subgraph seems to be
> for the testsuite, the other for the actual code. This means, the two
> don't depend on each other and could easily be put in two distinct repos.
> * There is a "re-implementation" patch with a lot of incoming and
> outgoing edges. (Which makes sense.)
> * There are some sequences of patches (e.g. these four "allow ..."
> patches in the upper left corner) that seem to contain related patches.
> * darcs's patch system is awesome!
>
> Any comments or suggestions?
>
> Cheers,
> Sönke

That's nifty, thanks for sharing it. Cc'ing darcs-user.

I tried it in a few repos, like so:

$ darcs2dot > patchdeps.dot && dot patchdeps.dot -Tpdf -o patchdeps.pdf

In a 200-patch repo it ran quickly, giving: http://joyful.com/darcsden/simon/darcsum/raw/patchdeps.pdf

In a 2000-patch repo it took 22 hours: http://joyful.com/darcsden/simon/hledger/raw/patchdeps.pdf

In the 10000-patch Darcs repo I killed it after a few hours, but here are the early dependencies (up to tag 1.0.0rc2):
http://joyful.com/darcsden/simon/darcs-sm/raw/patchdeps.pdf

It should escape double-quotes in patch names, I did that manually.

I wonder how to simplify the graph further. Perhaps just the dependencies of tags would be interesting in some repos ?

Best,
-Simon




More information about the Haskell-Cafe mailing list