unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 63647@debbugs.gnu.org, Felix Lechner <felix.lechner@lease-up.com>
Subject: [bug#63647] [PATCH 0/2] Fix annoyance with "guix import go"
Date: Tue, 06 Jun 2023 08:21:56 +0200	[thread overview]
Message-ID: <86cz29nm9n.fsf@gmail.com> (raw)
In-Reply-To: <87o7luhybt.fsf_-_@gnu.org>

Hi Ludo,

On Mon, 05 Jun 2023 at 14:45, Ludovic Courtès <ludo@gnu.org> wrote:
> Simon Tournier <zimon.toutoune@gmail.com> skribis:
>
>> * guix/import/go.scm (git-checkout-hash): Catch Git error.
>
> [...]
>
>> +  (catch 'git-error
>> +    (lambda _
>> +      (let-values (((checkout commit _)
>> +                    (parameterize ((%repository-cache-directory cache))
>> +                      (update-cached-checkout url
>> +                                              #:ref
>> +                                              `(tag-or-commit . ,reference)))))
>> +        (file-hash* checkout #:algorithm algorithm #:recursive? #true)))
>> +    (lambda (key error . rest)
>> +      (warning (G_ "Git error: ~a in ~a~%") (git-error-message error) url)
>> +      (nix-base32-string->bytevector
>> +       "0000000000000000000000000000000000000000000000000000"))))
>
> I’d rather let the exception through.  How about adding
> ‘with-git-error-handling’ at the UI level, in (guix scripts import go)?

What do you mean by “let the exception through”?  It seems better to be
non-blocking and thus catch the exception then raise a meaningful
warning; it’s required when running with the option recursive.

Well, maybe an improvement could be in the addition of some
’report-git-warning’ and/or ’with-git-error-handling*’, in (guix git);
hum, I do not know.

Last, considering that the module (guix import go) already contains 4 UI
messages (G_), trying to move this warning about Git to (guix scripts
import go) will add some complexity – re-raise the exception 2 or 3
times, IIUC – and thus it will not change much about the UI, IMHO.  I
mean, such move should be for all the messages or nothing.

Cheers,
simon




  reply	other threads:[~2023-06-06  6:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 16:04 [bug#63647] [PATCH 0/2] Fix annoyance with "guix import go" Simon Tournier
2023-05-22 16:08 ` [bug#63647] [PATCH 1/2] guix: import: go: Sort hint about available versions Simon Tournier
2023-05-22 16:08 ` [bug#63647] [PATCH 2/2] guix: import: go: Catch Git error Simon Tournier
2023-05-25 15:41 ` [bug#63647] [PATCH v2 1/3] guix: import: go: Sort hint about available versions Simon Tournier
2023-05-25 15:41   ` [bug#63647] [PATCH v2 2/3] guix: import: go: Catch Git error Simon Tournier
2023-05-25 15:41   ` [bug#63647] [PATCH v2 3/3] guix: import: go: Use correct tag for go module in subdirectory Simon Tournier
2023-05-25 16:07 ` [bug#63647] [PATCH v3 1/3] guix: import: go: Sort hint about available versions Simon Tournier
2023-05-25 16:07   ` [bug#63647] [PATCH v3 2/3] guix: import: go: Catch Git error Simon Tournier
2023-06-05 12:45     ` [bug#63647] [PATCH 0/2] Fix annoyance with "guix import go" Ludovic Courtès
2023-06-06  6:21       ` Simon Tournier [this message]
2023-06-06 15:42         ` Ludovic Courtès
2023-05-25 16:07   ` [bug#63647] [PATCH v3 3/3] guix: import: go: Use correct tag for go module in subdirectory Simon Tournier
2023-06-05 12:43   ` [bug#63647] [PATCH 0/2] Fix annoyance with "guix import go" Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=86cz29nm9n.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=63647@debbugs.gnu.org \
    --cc=felix.lechner@lease-up.com \
    --cc=ludo@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).