Subject: Re: [bug#65352] time-machine, unavailable network or Savannah down

From: Simon Tournier <[email-masked]>
Date: Thu, 07 Sep 2023 01:21:46 +0200

Hi,

On Wed, 06 Sep 2023 at 13:41, Maxim Cournoyer <[email-masked]> wrote:

> So all the refs such as commit(ish) or tags would be referenced locally,
> and branches such as 'master' would still trigger an update.

That’s the intent of this patch:

        [bug#65352] [PATCH v2] DRAFT git: Avoid touching the network unless needed in 'reference-available?'.
        Simon Tournier <[email-masked]>
        Wed, 06 Sep 2023 16:17:08 +0200
        id:32d3fb[email-masked]
        https://issues.guix.gnu.org//65352
        https://issues.guix.gnu.org/msgid/32d3fb[email-masked]
        https://yhetil.org/guix/32d3fb[email-masked]

> LGTM, but I'd be curious to hear what Ludovic thinks, since their
> original code treated tags as mutable (which they technically are, but I
> agree to the value of treating them as immutable, and it appears low
> risk to me).

Do we have an use-case where tags are mutable?

To my knowledge, the Guix remote tags have always been immutable.  Do we
have one counter-example?

Well, here an attempt for a scenario with mutable tags – although I
think that’s a corner case considering the current state for
manipulating Guix cache checkouts.  I am using Guix 6113e05, nothing
about the patch I am proposing. :-)

$ cp -r ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq /tmp/guix,git
$ guix time-machine -q --commit=4a027d2 --url=/tmp/guix.git -- describe

So far, so good.  Let add one tag.

$ git -C /tmp/guix.git tag -a mutable -m "some tag" 4a027d2
$ git -C /tmp/guix.git tag -l mut*

And…

$ guix time-machine -q --commit=mutable --url=/tmp/guix.git -- describe
guix time-machine: error: Git error: reference 'refs/tags/mutable' not found

…bang!

Well, the basic Git tags does not seem supported by the Guile-Git
’remote-fetch’ procedure.  I have not investigated more.  Maybe I am
missing something.

My opinion is to stay focused on the current real annoyances first and
not try to fix another hypothetical use-case which seems already buggy.

Ludo, WDYT about the proposed patch?  Does it work for your use-cases?

Cheers,
simon