Hello zimoun,

>  1. Loop with commit-parents as it is done for ’commit-closure’ in
>     guix/git.scm.
>
>  2. Bind git_revwalk_* and use it instead.
>
> WDYT?
>
> Well, #1 is more straightforward but less efficient, IIUC.

Running something like:

--8<---------------cut here---------------start------------->8---
(let loop ((commit (commit-lookup r (string->oid "cf53ea79d")))
           (res '()))
     (let ((parents (commit-parents commit)))
       (if (null? parents)
           res
         (loop (car parents) (cons (car parents) res)))))
--8<---------------cut here---------------end--------------->8---

takes 1.45s to go over 53391 commits. The "revwalk" API may be more
efficient but I would say that what's currently implemented could be a
fine starting point.

Thanks,

Mathieu

Reply via email to