guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [outreachy] Walk through the Git history (guix git {authenticate,log


From: Mathieu Othacehe
Subject: Re: [outreachy] Walk through the Git history (guix git {authenticate,log})
Date: Sat, 12 Dec 2020 09:42:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

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

[Prev in Thread] Current Thread [Next in Thread]