mirror of
https://github.com/correl/correl.github.io.git
synced 2024-12-29 11:09:24 +00:00
2.1 KiB
2.1 KiB
(git-graph/to-graphviz-pretty
"git"
(git-graph/git-graph-head
"/tmp/test.git"
"master"))
<<graph-git-branch()>>
(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()>>
(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))))