Skip to main content

Generates the DAG of a git repository

Project description

Generates the DAG of a git repository

Install

  • pip install git-dag

Getting help

  • git dag -h to display help
usage: git-dag [-h] [-p PATH] [-f FILE] [-b {graphviz}] [--format FORMAT]
               [--dpi DPI] [-i INIT_REFS [INIT_REFS ...]]
               [-R RANGE [RANGE ...]] [-n MAX_NUMB_COMMITS]
               [--rankdir RANKDIR] [--bgcolor BGCOLOR] [-u] [-t] [-D] [-l]
               [-r] [-s] [-H] [-T] [-B] [-m COMMIT_MESSAGE_AS_LABEL] [-o]
               [--log-level {NOTSET,INFO,WARNING,ERROR,CRITICAL}]

Visualize the git DAG.

options:
  -h, --help            show this help message and exit
  -p, --path PATH       Path to git repository.
  -f, --file FILE       Output graphviz file (could include a directory e.g.,
                        mydir/myfile).
  -b, --dag-backend {graphviz}
                        Backend DAG library.
  --format FORMAT       Graphviz output format (tooltips are available only
                        with svg). If the format is set to 'gv', only the
                        graphviz source file is generated
  --dpi DPI             DPI of output figure (used with --format png).
  -i, --init-refs INIT_REFS [INIT_REFS ...]
                        A list of branches, tags, objects' SHA (commits,
                        trees, blobs) that represents a limitation from where
                        to display the DAG
  -R, --range RANGE [RANGE ...]
                        A list to commits in a range to display.
  -n, --max-numb-commits MAX_NUMB_COMMITS
                        Max number of commits (set to 0 to remove limitation).
  --rankdir RANKDIR     rankdir argument of graphviz (LR, RL, TB, BT).
  --bgcolor BGCOLOR     bgcolor argument of graphviz (e.g., transparent).
  -u                    Show unreachable commits.
  -t                    Show tags.
  -D                    Show deleted annotated tags.
  -l                    Show local branches.
  -r                    Show remote branches.
  -s                    Show stash.
  -H                    Show head.
  -T                    Show trees (WARNING: should be used only with small
                        repositories).
  -B                    Show blobs (discarded if -T is not set).
  -m, --message COMMIT_MESSAGE_AS_LABEL
                        When greater than 0, this is the number of characters
                        from the commit message to use as a commit label. The
                        commit SHA is used otherwise.
  -o, --xdg-open        Open output SVG file with xdg-open.
  --log-level {NOTSET,INFO,WARNING,ERROR,CRITICAL}
                        Log level.

Examples

  • git dag -rlst -n 20 would generate git-dag.gv (a graphviz dot file) and git-dag.gv.svg with:

    • the 20 most recent commits (-n 20, use -n -1 to show all)
    • all local branches (-l)
    • all remote branches (-r)
    • the stash (-s)
    • all tags (-t)
  • displaying trees (-T) and blobs (-B) is recommended only for small(ish) repositories.

  • using -n 10 -i my-branch my-tag would display the 10 most recent commits accessible from my-branch or my-tag.

Default color-codes

object color name
commit ${\texttt{\color{#cdad00}gold3}}$
unreachable commit ${\texttt{\color{#ff8c00}darkorange}}$
tree ${\texttt{\color{#00688b}deepskyblue4}}$
the empty tree ${\texttt{\color{#00ced1}darkturquoise}}$
blob ${\texttt{\color{#bebebe}gray}}$
annotated tag ${\texttt{\color{#ffc0cb}pink}}$
deleted annotated tag ${\texttt{\color{#ffc0cb}rosybrown4}}$
lightweight tag ${\texttt{\color{#f08080}lightcoral}}$
local branch ${\texttt{\color{#228b22}forestgreen}}$
remote branch ${\texttt{\color{#b22222}firebrick}}$
stash ${\texttt{\color{#87ceeb}skyblue}}$
HEAD ${\texttt{\color{#6495ed}cornflowerblue}}$

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_dag-0.0.7.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_dag-0.0.7-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file git_dag-0.0.7.tar.gz.

File metadata

  • Download URL: git_dag-0.0.7.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for git_dag-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a01cf63d9eb32688ee5d9d7c896a9a9414ea5384941b1c6f60f09d5615b65524
MD5 fe203845252d22ceec71e105b2fb8f66
BLAKE2b-256 855d41bcb23fb2f63e93d229c1f6183a2fc0c1457c1bb92d76474f46ec9279bb

See more details on using hashes here.

File details

Details for the file git_dag-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: git_dag-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for git_dag-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a827386cd7cf49d570a23e8f9956cd70d5e93528bd67e51d9a3acd4add233194
MD5 d84c81dd898375ae246d7f4a898ada24
BLAKE2b-256 4e0feee6437d2213381d08acbf94058977873d765d9ec77fe10ff7ea54112ac9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page