correl.github.io/_drafts/git-graphs-truncated.org

2.1 KiB

  (git-graph/to-graphviz-pretty
   "git"
   (git-graph/git-graph-head
    "/tmp/test.git"
    "master"))
  <<graph-git-branch()>>

/github/correl.github.io/media/branch/truncated-graphs-wip/_drafts/git-graphs-truncated-git-graph-branch.svg

  (defun git-graph/filter (predicate graph)
    (-filter predicate graph))

  (defun git-graph/group-matches-p (pattern node)
    (string-match-p pattern
                    (git-graph/node-group node)))

  (defun git-graph/intermediate-commit-p (node)
    (and (> 2 (length (git-graph/node-parents node)))
         (not (string-equal (git-graph/node-id node)
                            (git-graph/node-group node)))))
  ;; (git-graph/to-graphviz-pretty
  ;;  "git"
  ;;  (git-graph/filter
  ;;   (lambda (node)
  ;;     (not (git-graph/intermediate-commit-p node)))
  ;;   (git-graph/filter
  ;;    (lambda (node)
  ;;      (not (git-graph/group-matches-p "6ea32ad3fe6220c88342e798ed34d9582334bf57" node)))
  ;;    (git-graph/git-graph-head
  ;;     "/tmp/test.git"
  ;;     "master"))))
  (git-graph/to-graphviz-pretty
   "git"
   (git-graph/filter
    (lambda (node)
      (not (git-graph/intermediate-commit-p node)))
    (git-graph/git-graph-head
     "/tmp/test.git"
     "master")))
<<git-graph-integration-branches()>>

/github/correl.github.io/media/branch/truncated-graphs-wip/_drafts/git-graphs-truncated-develop-only.svg

  (defun git-graph/git-graph-head (repo-url head)
    (git-graph/group-topo
     (-map (lambda (rev-with-parents)
             (let* ((rev (car rev-with-parents))
                    (parents (cdr rev-with-parents))
                    (label (git-graph/git-label repo-url rev)))
               (git-graph/make-node rev parents
                                    `((label . ,label)))))
           (git-graph/git-rev-list repo-url head))))