Open danburzo opened 5 years ago
Added support for the --include
flag in the PR above. It's not as straightforward to use with xargs
as the --only
shortcut, but here's the glorious final script that does what I intended :)
FILES=$(git diff --name-only --diff-filter=AM origin/master...HEAD); \
FLAGS=$(echo $FILES | sed 's/\(.*\)/--include "\1"/g'); \
echo $FLAGS $FILES | xargs -t madge
@pahen any chance taking this in? In non-trivial apps it's almost crucial to be able to limit the scope of the graph.
I temporarily categorize this as visualization filtering. But for performance, maybe we don't need to generate the whole tree, which I don't think is the priority for now.
I have just discovered Madge and it's just superb work!
It would be interesting for me, as I work on a Git branch, to understand how the files I've created relate to each other:
This command takes the added files as entry points, but shows their entire dependency graph. It would be great to limit it to the files I've sent as entry points.
If I understand correctly, the
exclude
option accepts a RegExp and I don't think I can use it.Would an
--only
option make sense? It would limit the set of consider files to the original input. Or, if that's too specific, maybe an--include
option (that you can use multiple time in a command), to supplement--exclude
?