From: Mathieu Othacehe <othacehe@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: [outreachy] Walk through the Git history (guix git {authenticate,log})
Date: Sat, 12 Dec 2020 09:42:51 +0100 [thread overview]
Message-ID: <87czzfpg8k.fsf@gnu.org> (raw)
In-Reply-To: <86r1nwfdeu.fsf@gmail.com> (zimoun's message of "Fri, 11 Dec 2020 18:41:45 +0100")
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
next prev parent reply other threads:[~2020-12-12 8:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 17:41 [outreachy] Walk through the Git history (guix git {authenticate, log}) zimoun
2020-12-11 19:01 ` [outreachy] Walk through the Git history (guix git {authenticate,log}) Magali
2020-12-12 12:24 ` zimoun
2020-12-12 17:24 ` Magali
2020-12-12 17:49 ` [outreachy] Walk through the Git history zimoun
2020-12-14 10:20 ` Ludovic Courtès
2020-12-15 15:20 ` [outreachy] Walk through the Git history (guix git {authenticate,log}) Magali
2020-12-16 9:35 ` zimoun
2020-12-18 15:34 ` Ludovic Courtès
2020-12-19 3:18 ` Magali
2020-12-12 8:42 ` Mathieu Othacehe [this message]
2020-12-12 12:10 ` zimoun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czzfpg8k.fsf@gnu.org \
--to=othacehe@gnu.org \
--cc=guix-devel@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).