Simon Tournier <zimon.touto...@gmail.com> writes:

> Hi,
>
> On Wed, 02 Apr 2025 at 09:01, 45mg <45mg.wri...@gmail.com> wrote:
>
>>> 1) Actual 'git pull' equivalent.
>>>
>>> 2) The 'guix authenticate' dance on the commits.
>>>
>>> 3) The Guix derivation part.
>>>
>>> In some settings, I fear step 1 and 2 takes comparable time as 3.
>>
>> In my experience, authentication is pretty fast. `guix git authenticate`
>> processes hundreds of commits in under a second.
>
> Yes.  Although it could be a bit improved – see [1] – that’s not the
> main bottleneck, from my experience too.

Agreed. Back when I was messing with the authentication code to figure
out how to do authenticated forks, it quickly became clear that the
rate-limiting step within authentication is the verification of
individual commits. I didn't see any way to optimize that. The bit
before that - calling `commit-difference` to get the set of commits to
authenticate - rarely takes more than a second or two, even when
authenticating from scratch.

[...]
> Could you share the output of
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guix-user)> ,use(git)
> scheme@(guix-user)> ,use(guix git)
> scheme@(guix-user)> (define url "https://git.savannah.gnu.org/git/guix.git";)
> scheme@(guix-user)> (define cache-directory (url-cache-directory url 
> (%repository-cache-directory)))
> scheme@(guix-user)> (openable-repository? cache-directory)
> $1 = #t
> scheme@(guix-user)> cache-directory
> $2 = 
> "/home/simon/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq"
> --8<---------------cut here---------------end--------------->8---
>
> ?  I guess, openable-repository? returns #f instead of #t, right?

No, it returns #t; contrary to what I suspected, the caching is actually
done correctly. See my previous message.

> Well, I think the issue is from update-cached-checkout in (guix git)…
> #
>> It's probably a bug with the caching; I pull from a local authenticated
>> fork, which can't be too common, so it makes sense that this hasn't been
>> caught before. I haven't had time to properly debug it yet (deleting the
>> cache does not help).
>
> …and something along:
>
>    (let* ((cache-exists? (openable-repository? cache-directory))
>           (repository    (if cache-exists?
>                              (repository-open cache-directory)
>                              (clone/swh-fallback url ref cache-directory
>                                                  #:verify-certificate?
>                                                  verify-certificate?))))
>      ;; Only fetch remote if it has not been cloned just before.
>      (when (and cache-exists?
>                 (not (reference-available? repository ref)))
>        (remote-fetch (remote-lookup repository "origin")
>                      #:fetch-options (make-default-fetch-options
>                                       #:verify-certificate?
>                                       verify-certificate?)))
>
> Therefore, that’s why my guess is about openable-repository?

Yup, it's the `remote-fetch` part. Again, see my previous message.

> Cheers,
> simon
>
>
> 1: comparing commit-relation using Scheme+libgit2 vs shellout plumbing Git
> Simon Tournier <zimon.touto...@gmail.com>
> Tue, 12 Sep 2023 00:48:30 +0200
> id:865y4gz5q9....@gmail.com
> https://lists.gnu.org/archive/html/guix-devel/2023-09
> https://yhetil.org/guix/865y4gz5q9....@gmail.com
>
> 2: bug#65787: time-machine is doing too much network requests
> Simon Tournier <zimon.touto...@gmail.com>
> Wed, 06 Sep 2023 18:26:18 +0200
> id:87wmx3mfo5....@gmail.com
> https://issues.guix.gnu.org/65787
> https://issues.guix.gnu.org/msgid/87wmx3mfo5....@gmail.com
> https://yhetil.org/guix/87wmx3mfo5....@gmail.com

Reply via email to