Subject: [bug#74481] [PATCH 1/2] git: Catch Git errors when updating cached checkout.

From: Ludovic Courtès <[email-masked]>
Date: Thu, 26 Dec 2024 22:17:32 +0100

Simon Tournier <[email-masked]> skribis:

> On Tue, 17 Dec 2024 at 11:55, Ludovic Courtès <[email-masked]> wrote:
>
>> We have something that can now return #f instead of throwing an
>> exception.  The many users of this interface are not prepared for this;
>> worse, getting #f instead of an exception means we lose information as
>> to why ‘update-cached-checkout’ or similar failed.
>
> Thanks for explaining.
>
> Well, I’d say “mouais“ :-) about « lose information » since I added some
> ’pk’ here or there before finding the relevant piece of code.  So the
> exception is not very helpful, not to say fully useless, IMHO.

The exception conveys information about the failure: no space left on
device, host unreachable, invalid certificate, etc.

Often ‘with-git-error-handling’ is used at the top-level because the
error is not recoverable so we just want to print an error message and
exit.

In other cases, we explicitly want to catch, say, GIT_ENOTFOUND because
there’s a fallback path in this case.

Ludo’.