From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0DcOJpuC1F9dSwAA0tVLHw (envelope-from ) for ; Sat, 12 Dec 2020 08:43:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mAjjIZuC1F9BSgAA1q6Kng (envelope-from ) for ; Sat, 12 Dec 2020 08:43:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F3BAB94042E for ; Sat, 12 Dec 2020 08:43:06 +0000 (UTC) Received: from localhost ([::1]:45538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ko0Ub-0001MO-SH for larch@yhetil.org; Sat, 12 Dec 2020 03:43:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ko0UQ-0001ME-KY for guix-devel@gnu.org; Sat, 12 Dec 2020 03:42:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44103) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ko0UP-0007IZ-T8; Sat, 12 Dec 2020 03:42:53 -0500 Received: from [2a01:e0a:19b:d9a0:edc2:7949:6205:c521] (port=47104 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ko0UP-0006BZ-6Q; Sat, 12 Dec 2020 03:42:53 -0500 From: Mathieu Othacehe To: zimoun Subject: Re: [outreachy] Walk through the Git history (guix git {authenticate,log}) References: <86r1nwfdeu.fsf@gmail.com> Date: Sat, 12 Dec 2020 09:42:51 +0100 In-Reply-To: <86r1nwfdeu.fsf@gmail.com> (zimoun's message of "Fri, 11 Dec 2020 18:41:45 +0100") Message-ID: <87czzfpg8k.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: F3BAB94042E X-Spam-Score: -2.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: 2UpL8/sagraQ Hello zimoun, > 1. Loop with commit-parents as it is done for =E2=80=99commit-closure=E2= =80=99 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