all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Christopher Baines <guix@cbaines.net>,
	74481@debbugs.gnu.org, Josselin Poiret <dev@jpoiret.xyz>,
	Tobias Geerinckx-Rice <me@tobias.gr>,
	Mathieu Othacehe <othacehe@gnu.org>
Subject: [bug#74481] [PATCH 1/2] git: Catch Git errors when updating cached checkout.
Date: Tue, 17 Dec 2024 19:06:14 +0100	[thread overview]
Message-ID: <87seqmfall.fsf@gmail.com> (raw)
In-Reply-To: <877c7yr336.fsf@gnu.org>

Hi Ludo,

On Tue, 17 Dec 2024 at 11:55, Ludovic Courtès <ludo@gnu.org> 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.

That’s said, I understand your concern and I will not discuss it
here. :-) If I read you correctly and apply the argument, you propose to
guard all the calls of ’update-cached-checkout’, it means:

--8<---------------cut here---------------start------------->8---
./guix/import/egg.scm:94:                  (directory commit _ (update-cached-checkout url)))
./guix/scripts/system/reconfigure.scm:355: (update-cached-checkout
./guix/git.scm:670:                        (update-cached-checkout url
./guix/inferior.scm:877:                   (update-cached-checkout (channel-url channel)
--8<---------------cut here---------------end--------------->8---

Either using ‘(catch 'git-error’ or either using
‘(with-git-error-handling’.

Right?

> Would it be an option to catch 'git-error around the
> ‘update-cached-checkout’ call in (guix import go)?  If an exception is
> thrown, it would print a warning and return a fake hash.

See v2 for this case of ‘guix import go’.

Cheers,
simon

PS: As I said earlier, I think all the call to Guile-Git should be
guarded and each call should manage the exception instead of propagate
it… and so barely catch them. :-)




  reply	other threads:[~2024-12-17 20:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 19:05 [bug#74481] [PATCH 0/2] Handle corner cases of 'guix import go' Simon Tournier
2024-11-22 19:09 ` [bug#74481] [PATCH 1/2] git: Catch Git errors when updating cached checkout Simon Tournier
2024-12-12 11:34   ` Ludovic Courtès
2024-12-12 12:04     ` Simon Tournier
2024-12-17 10:55       ` Ludovic Courtès
2024-12-17 18:06         ` Simon Tournier [this message]
2024-11-22 19:09 ` [bug#74481] [PATCH 2/2] import: go: Warn instead of error out when reference is missing Simon Tournier
2024-12-10 14:09 ` [bug#74481] [PATCH 0/2] Handle corner cases of 'guix import go' Simon Tournier
2024-12-10 18:40   ` Sharlatan Hellseher
2024-12-17 17:45 ` [bug#74481] [PATCH v2] import: go: Warn instead of error out when Git fails Simon Tournier
2024-12-18 20:18 ` [bug#74481] [PATCH 0/2] Handle corner cases of 'guix import go' Sharlatan Hellseher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87seqmfall.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=74481@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=ludo@gnu.org \
    --cc=me@tobias.gr \
    --cc=othacehe@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.