From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aBNMOMou1V8NWwAA0tVLHw (envelope-from ) for ; Sat, 12 Dec 2020 20:57:46 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AB+oM8ou1V8XbwAAB5/wlQ (envelope-from ) for ; Sat, 12 Dec 2020 20:57:46 +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 A9EE894014B for ; Sat, 12 Dec 2020 20:57:46 +0000 (UTC) Received: from localhost ([::1]:57816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koBxZ-0004fV-M9 for larch@yhetil.org; Sat, 12 Dec 2020 15:57:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koACa-0007Tb-AV for guix-devel@gnu.org; Sat, 12 Dec 2020 14:05:08 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:36355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1koACO-0002ei-Li; Sat, 12 Dec 2020 14:05:08 -0500 Received: by mail-wm1-x329.google.com with SMTP id y23so11643028wmi.1; Sat, 12 Dec 2020 11:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=wJk7ySXGlTZKR2cHAf3ixs5G6ovXLjSvqqhKEdOGUuA=; b=YLsx4WxI2ppaK5ZC4ndpnV/MWYeiq2DTIOEcdCQHvoLaYXeHGhDrahzd5M4mgu6Ea3 FzTBMw6vmoyL9rsuF0BPDh39OHtDvG59g/owJ86Os25ZKMd83jrc7tmew4M1Mvoi6Hkv 0nnYo0G/DDYl5R9A+MqYCeTB+RndB7dPJ6ebcdV/6WEAgJ0f5d8rBAQU+jQEq0wPdMOw qbOPr40RaUAojsR7i7/aeH1Ep+hY2k6IOUofs6MpQX6Fzy5ucjlD20i+iJJz2S7fMInW c+65FJxFpkppfDWvFcL7/dJB4g18qw67T1KRpn1g9V+zJb8XUusioQPM9yKH9TnT8AhL O2iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=wJk7ySXGlTZKR2cHAf3ixs5G6ovXLjSvqqhKEdOGUuA=; b=sZG4fuFh45uvKEfTIG+yZBb98uqpBORFC5b/GZbtLNSg0rd3MnDDEMcs5tfFUKqKcK L+qIhuY+bPKiVC71Eq+9LB6LnfFFYn27At6VlwVKX7wEkW1aFVKMlMUdtycRqo8NHCZF W+i6yLQcu9U1DmzVYGkY2TKAZ4xbBZGs7emJYpF+Q0c5baF9Ivhlf7i/lICLc4Ia8db6 zDMjpqvEKrUM0PbQeGGqxcyD3NkOnBLXOtMSTcrtE4/ODGJ25fEpa5HMXA93/HpF4EGN 0y6/rma8yGFwqFZb3ZwGqUjqKr3lLpDYbfh2w+kPzWogmYjaAeSk0GJ610QTbbEV9V+8 Jc4g== X-Gm-Message-State: AOAM531Q3h57cS6b/B9TL8xz45jCONeZrvDJOsAozqLwmFndxkzuQZYj EgbYa7sf0ZxlqIsUjBCU5qfmWzTxuoA= X-Google-Smtp-Source: ABdhPJzZ0Sfj+g2jQmHtmukveGE4HObfpmhm9Ecl2IK2qkfh2sbud2Q5FnOas6UWlcEVadFkMVonpQ== X-Received: by 2002:a1c:220a:: with SMTP id i10mr18221825wmi.93.1607775119460; Sat, 12 Dec 2020 04:11:59 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id x7sm12108682wmi.11.2020.12.12.04.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Dec 2020 04:11:58 -0800 (PST) From: zimoun To: Mathieu Othacehe Subject: Re: [outreachy] Walk through the Git history (guix git {authenticate,log}) In-Reply-To: <87czzfpg8k.fsf@gnu.org> References: <86r1nwfdeu.fsf@gmail.com> <87czzfpg8k.fsf@gnu.org> Date: Sat, 12 Dec 2020 13:10:57 +0100 Message-ID: <86o8izfcmm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: -1.20 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=YLsx4WxI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: A9EE894014B X-Spam-Score: -1.20 X-Migadu-Scanner: scn1.migadu.com X-TUID: iPue6zV7O+lz Hi Mathieu, On Sat, 12 Dec 2020 at 09:42, Mathieu Othacehe wrote: >> 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. It does not work for complex history where multiple branches are merged. For example, the snippet excludes one of the master or core-updates at the merge points; or I miss something. Therefore, the loop should explore the different branches at the merge points, keeping somehow a list of already visited commit, implementing bit of graph stuff, and all in all, it is git_revwalk_*, IIUC. I agree that looping with commit-parents is a good starting point. All the best, simon