       (git-root)
       (blocking-deref res))
     res))
-
-;; Last commit message: git log -n1 --pretty=format:%s
-;; Last commit hash: git rev-parse HEAD
 
 ;; Lock file I/O
 ;; --------------

    ;; We may have some hooks here, if not TODO remove the `let`
    ticket))

(defn append-ticket [t-file-map ticket]
  (update-in t-file-map [:tickets] conj (assoc ticket
                                               :id (-> t-file-map :tickets count inc))))

(defn update-ticket
  "This ticket needs to have the :id key in it already"
  [t-file-map ticket]
  (update-in t-file-map [:tickets (-> ticket :id id->pos)] merge ticket))

(defn ticket-io!
  "This applies a function to the actual ticket file.
  All functions should take two args: the ticket file map, and a ticket.
  You should never lock the ticket file by hand, use this function."
  ([f ticket]
   (ticket-io! f ticket default-ticket-path))

          ticket-ids (map id-str->int (filter #(= \:  (get % 0)) parts))]
      {:ids ticket-ids :maybe-command command :message message-str})))

(defn process-git
  "This is the entry point for processing git feedback.
  It takes a commit hash, the author email, and any chunks of the message.
  These are most easily obtained with: `git log -n1 --pretty=format:'%H %ae %s'`"
  [git-hash email & message-pieces]
  (let [message-map (parse-git-message (cstr/join " " message-pieces))
        command (:maybe-command message-map)
        tickets (:tickets (ticket-file!))]
