git_dag.dag.DagVisualizer

class git_dag.dag.DagVisualizer(repository: GitRepository, params: Params, objects_sha_to_include: set[str] | None = None, in_range_commits: list[str] | None = None)[source]

Bases: CommitHandlerMixin, TreeBlobHandlerMixin, TagHandlerMixin, StashHandlerMixin, BranchHandlerMixin, HeadHandlerMixin

Git DAG visualizer.

Methods

show

Show the dag.

Attributes

in_range_commits

objects_sha_to_include

repository

params

show(xdg_open: bool = False) Any[source]

Show the dag.

Note

When the format is set to gv, only the source file is generated and the user can generate the DAG manually with any layout engine and parameters. For example: dot -Gnslimit=2 -Tsvg git-dag.gv -o git-dag.gv.svg, see this thread.

Generating a DAG with more than 1000 nodes could be time-consuming. It is recommended to get an initial view using git dag -lrto and then limit to specific references and number of nodes using the -i and -n flags.