Message ID | 86a5tqzze6.fsf@gmail.com |
---|---|
State | New |
Headers | show |
Series | [bug#65352] Fix time-machine and network | expand |
Hi, Simon Tournier <zimon.toutoune@gmail.com> skribis: > On Wed, 13 Sep 2023 at 22:16, Ludovic Courtès <ludo@gnu.org> wrote: > >>> + (('commit . (? commit-id? commit)) >>> + (let ((oid (string->oid commit))) >>> + (->bool (commit-lookup repository oid)))) >>> + ((or ('tag . str) >>> + ('tag-or-commit . str)) >>> + (false-if-git-not-found >>> + (->bool (resolve-reference repository ref)))) >> >> IIUC, the differences compared to what we had are: >> >> 1. 'tag references are now handled on the fast path >> (‘reference-available?’ can return #t); >> >> 2. short commit strings are now always on the slow path >> (‘reference-available?’ always returns #f). >> >> Is that correct? > > No Sorry, could you explain what the difference is then on the hunk I quoted? https://issues.guix.gnu.org/65352#34-lineno11 I see different treatment of short commit IDs and tags, and no difference for full commit IDs. Thanks, Ludo’.
Hi again, Simon Tournier <zimon.toutoune@gmail.com> skribis: > Let ’pk’ (see below) to convince you. :-) > > Before the proposed patch: > > $ ./pre-inst-env guix time-machine --commit=v1.4.0 -- describe > > ;;; (ref (tag-or-commit . "v1.4.0")) > > ;;; (reference-available? #f) > > ;;; (remote-fetch NETWORK) > C-c C-c > > $ ./pre-inst-env guix time-machine --commit=8e2f32c -- describe > > ;;; (ref (tag-or-commit . "8e2f32c")) > > ;;; (reference-available? #f) > > ;;; (remote-fetch NETWORK) > C-c C-c Yes this seems to confirm what I thought. So anyway, go for it! Great that you’re improving performance here. Ludo’.
Hi, On Thu, 14 Sept 2023 at 11:04, Ludovic Courtès <ludo@gnu.org> wrote: > Yes this seems to confirm what I thought. Hum, maybe we have miscommunicated because we were speaking on different levels, I guess. :-) By 'tag references, you meant (tag . "foo") right? And that case is not possible from the command-line and even I am not sure about the use-case of passing (tag . "foo") to reference-available?. Another story. Reconsidering your question, yes the case (tag . "foo") is currently on the fast path and will stay on the fast path. I have read "tag references" as the user is passing a Git tag. Which is currently managed the same way as short commit ID. Hence my previous answer. :-) > So anyway, go for it! Cool! I will proceed. > Great that you’re improving performance here. Now, we can give a look to bug#65787 [1]. ;-) 1: bug#65787: time-machine is doing too much network requests Simon Tournier <zimon.toutoune@gmail.com> Mon, 11 Sep 2023 11:41:54 +0200 id:87tts1jbbx.fsf@gmail.com https://yhetil.org/guix/87tts1jbbx.fsf@gmail.com https://issues.guix.gnu.org/msgid/87tts1jbbx.fsf@gmail.com Cheers, simon
Hi, On Thu, 14 Sep 2023 at 11:42, Simon Tournier <zimon.toutoune@gmail.com> wrote: >> So anyway, go for it! > > Cool! I will proceed. Done with 6d33c1f8061e86d63ab5c9ec75df9c58130c7264. Cheers, simon
diff --git a/guix/git.scm b/guix/git.scm index 1cb87a45607b..c927555cce18 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -481,6 +481,8 @@ (define* (update-cached-checkout url (repository-open cache-directory) (clone/swh-fallback url ref cache-directory)))) ;; Only fetch remote if it has not been cloned just before. + (pk 'ref ref) + (pk 'reference-available? (reference-available? repository ref)) (when (and cache-exists? (not (reference-available? repository ref))) (remote-fetch (remote-lookup repository "origin")