Add --prune to stack dot#487
Merged
snoyberg merged 3 commits intocommercialhaskell:masterfrom Jul 2, 2015
Merged
Conversation
dot --prune lens,wreq,nats prunes the three packages "lens" "wreq" and "nats" from the dependency graph and also removes resulting orphans.
Contributor
|
@markus1189 Wow, I was just going to ask for that feature. Thanks a lot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: Add
--prune p1,p2,p3tostack dotto remove nodes from the dependency graphThe Motivation
Playing around with some haskell projects and their

stack dotgraphs, it becomes apparent that it it a little hard to look at them because they get quite huge. As an example, take the graph forwreqgenerated bystack dot --external --no-include-base:okay that is a LOT. Looking a bit more we see that
wreq-examplesis also there which depends on a bunch of the dependencies.The new feature is that
--prunetakes a comma separated list of package names that will be pruned.So here is

wreqwithout dependencies ofwreq-examplesandlens:Still a lot but more manageable.
Of course we can have a dependency graph that is a little more focused by pruning more (randomly chosen) dependencies from the graph:
stack dot --external --no-include-base --prune lens,wreq-examples,http-client,aeson,tls,http-client-tlsThe implementation
--prune PACKAGE1,PACKAGE2,...Stack.DotDotSpecfor pruningsplitwithout version bound, do we need one?Help text for
stack dotPS: I also took the liberty to add the changes to CHANGELOG, or is this not wanted / do you prefer to do it yourself in the future?