 (defn find-merge-links [{:keys [causal-order branches] :as cg}]
   (let [branch-heads (into {} (map (fn [[k v]] [v k]) branches))]
     (assoc cg :merge-links
-      (->> causal-order
-           (filter-map [key val] (> (count val) 1))
+      (->> (select-keys causal-order
+                (for [[k v] causal-order
+                      :when (> (count v) 1)]
+                  k))
            (into {})
            (map (fn [[k v]] (map (fn [b] [b [(branches b) k]]) (remove nil? (map branch-heads v)))))
            (apply concat)

(ns signet.graph
  (:require [clojure.set :refer [difference]]
            [aprint.core :refer [aprint]]))


(defmacro filter-map [bindings pred m]
  `(select-keys ~m
                (for [~bindings ~m
                      :when ~pred]
                  ~(first bindings))))


(defn branches->nodes [c causal-order heads]

                "dev" 120
                "fix-2" 140}})


  (explore-commit-graph test-cg)

  )
