-
Notifications
You must be signed in to change notification settings - Fork 0
qx_committer by insts
RichMorin edited this page Dec 31, 2012
·
5 revisions
committer-by-insts
- list committer email addresses by instants
This example comes from the core.clj file in Devin Walter's nifty codeq-playground.
You need to find out, for some number of instants, the email addresses of the committers.
First, define the committer-by-insts
function,
then use it in a pipeline with commit-dates
.
(defn committer-by-insts
"email addresses of committers, based on date/time"
[instants]
(d/q '[:find ?email
:in $ [?instant ...]
:where
[ ?commit :commit/committedAt ?instant ] ;; get commit for an instant
[ ?commit :commit/committer ?user ] ;; and its committer
[ ?user :email/address ?email ] ] ;; and the committer's email
db
instants))
The function is used as follows:
(-> "clojure.core/pmap"
commit-dates
committer-by-insts)
This function assumes that db
is a database connection.