#!/bin/bash # Создание графа коммитов git-репозитория # This produces output that can be displayed using dotty, for example: # $ git graphviz HEAD~100..HEAD~60 | dotty /dev/stdin # $ git graphviz --first-parent master | dotty /dev/stdin # Note how defining a function eliminates the need to use sh -c. make_graphviz() { echo 'digraph git {' git log --pretty='format: %h -> { %p }' "$@" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' echo '}' } make_graphviz "$@"