From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id raY7ELye2V73HAAA0tVLHw (envelope-from ) for ; Fri, 05 Jun 2020 01:24:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id smhvC7ye2V4mGQAAbx9fmQ (envelope-from ) for ; Fri, 05 Jun 2020 01:24:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5A939940983 for ; Fri, 5 Jun 2020 01:24:11 +0000 (UTC) Received: from localhost ([::1]:36042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh15c-0008Iv-Vp for larch@yhetil.org; Thu, 04 Jun 2020 21:24:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh15W-0008Ij-PF for bug-guix@gnu.org; Thu, 04 Jun 2020 21:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jh15W-0007tr-G9 for bug-guix@gnu.org; Thu, 04 Jun 2020 21:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jh15W-0000SX-Cb for bug-guix@gnu.org; Thu, 04 Jun 2020 21:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41604: guix pull impossible after rebasing a local repository Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 05 Jun 2020 01:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41604 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 41604-submit@debbugs.gnu.org id=B41604.15913202201736 (code B ref 41604); Fri, 05 Jun 2020 01:24:02 +0000 Received: (at 41604) by debbugs.gnu.org; 5 Jun 2020 01:23:40 +0000 Received: from localhost ([127.0.0.1]:47892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh15A-0000Rw-4r for submit@debbugs.gnu.org; Thu, 04 Jun 2020 21:23:40 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:38920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jh158-0000Rj-H2 for 41604@debbugs.gnu.org; Thu, 04 Jun 2020 21:23:38 -0400 Received: by mail-qt1-f174.google.com with SMTP id k22so7191239qtm.6 for <41604@debbugs.gnu.org>; Thu, 04 Jun 2020 18:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LFCEjdEKzFIfRaualOe0zVq2IBGzYEfWfbplJk763vo=; b=IrBicng3426k6VwzvojkrQzOEbcVU0APSZk392MN9UerGLuBzpQ6vvxSc41yvPTJFm 3MAD1UNIFRRyH2DW/gq6O+RkezUHNrGxTYXGZODmcGs0KTxr4OcTyfsU1jrwSZeEBf6J voYwnvzLDsjFCL6FRIKjtndpb97qjWZ4Aqvdsl830QgMn3g5lGgPB30oZSs5H6dwiY3o IkhOP5vUyv8HtNjHo9GyPUB42p8RA4/YPpDLgrImf+fc1PeqFDBGcxt27eFxjslCm0ag UXWM5zrjaqZQFYL+mHxKKOe1E71sv9FSGR0h3cONqAS6M+aBXx0yqIkyJnooIrlJxWnp fIYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LFCEjdEKzFIfRaualOe0zVq2IBGzYEfWfbplJk763vo=; b=Nl1cJxPHcwbVxt66EWcbI4CAbdYfQ2YVSjQLBwbf5zraCT7aZtXMt8Q1vdNrznlV6n sZeDggWXTty1GfEWzLF22bygo80QF7itWr64gKPbTSRiPw+iuec2SSbsF+LCQaQAMHyS +hkhpischvlxIni8AAGFvUCN2JizaDdaMK47IoOkGoHW6S1ZxtQB3A1NhAYkRhanezZX 8ke5SIPXBM34YiR593FBdls4akCyV7RlU2LtajkxJWYeOkRyN4au992EwhxFATlxl53O P/VK0yrL0zLqGK1k72AhnKD4iJhiA/a6xLkAk/snb9A5N1A7j/j3yKS3BuY1cZA3n9Z5 D4Gg== X-Gm-Message-State: AOAM5332O8sX/1d9J3VejDi1yspWkM8wplnIvxnIpd1M335oRxp1dLVn WhQiNA37RVl3Yd4I+kxa+hB2z8o3P9lHLlA0rvw= X-Google-Smtp-Source: ABdhPJxzDabgBLFAfKxV5hqoeyTKfi7roRAoqxGMutvuqStCu4VdraLU+GcPYj693mpzbs35kBPgw/el97QHXILxCoo= X-Received: by 2002:ac8:24a8:: with SMTP id s37mr7664409qts.186.1591320212788; Thu, 04 Jun 2020 18:23:32 -0700 (PDT) MIME-Version: 1.0 References: <87zh9qofw7.fsf@asu.edu> <87a71kqyzw.fsf@gnu.org> <878sh41cx5.fsf@asu.edu> <87img8mbci.fsf@gnu.org> In-Reply-To: <87img8mbci.fsf@gnu.org> From: zimoun Date: Fri, 5 Jun 2020 03:23:20 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 41604@debbugs.gnu.org, John Soo Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=IrBicng3; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: n1FMxXffP0N/ Hi Ludo, On Wed, 3 Jun 2020 at 17:14, Ludovic Court=C3=A8s wrote: > >> (This can be overridden this by passing =E2=80=98--allow-downgrades=E2= =80=99.) > > > > Does '--allow-downgrades' support unrelated git histories? I tried tha= t > > flag and it did not work. > > It supports unrelated Git histories. It could really be called > =E2=80=98--allow-anything=E2=80=99 but I thought it=E2=80=99d be less des= criptive. :-) > > If you hit a problem with that, please report it (perhaps I just > overlooked it in the other issue.) I think it is not a bug and it is a feature* :-) but the behaviour has changed for the commits which do not belong to the repo anymore. That's why John has not seen the issue of his "rebase workflow" before. *feature: at least, it seems expected from what I understand of the code. := -) Let remind the commit history. Instead of create a channel file, I directly use the raw repo, but it is the same for any channel (Git repo). --8<---------------cut here---------------start------------->8--- $ SRC=3D~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj= 7apsnalwq $ git -C $SRC --no-pager log --oneline c873980d18^..8bd0b533b3 8bd0b533b3 gnu: libexif: Update to 0.6.22 [security fixes]. e451612602 gnu: libgphoto2: Update to 2.5.25. 9744cc7b46 pull: Protect against downgrade attacks. 872898f768 channels: 'latest-channel-instances' guards against non-forward updates. 8d1d56578a git: 'update-cached-checkout' returns the commit relation. 9b049de84e channels: 'latest-channel-instances' doesn't leak internal state= . c098c11be8 git: Add 'commit-relation'. 86ac14b2f3 (HEAD -> master) gnu: protonvpn-cli: Tweak description. c873980d18 gnu: Add protonvpn-cli. --8<---------------cut here---------------end--------------->8--- Here, a first session from a commit before the "downgrade attacks" commit. A commit is added, then pulled, then rebased where this addition is totally deleted of the Git repo, then another pulled. No error at all. --8<---------------cut here---------------start------------->8--- $ guix describe Generation 34 Jun 05 2020 02:16:22 (current) guix 86ac14b repository URL: https://git.savannah.gnu.org/git/guix.git commit: 86ac14b2f37efbb6f4a3ed1c3e183fbc9496b7a5 $ echo hello >> $SRC/README && git -C $SRC commit -am hello [master 20e984e931] hello 1 file changed, 1 insertion(+) $ guix pull --commit=3D$(git -C $SRC rev-parse HEAD) Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'... Building from this channel: guix https://git.savannah.gnu.org/git/guix.git 20e984e Computing Guix derivation for 'x86_64-linux'... / $ guix describe Generation 35 Jun 05 2020 02:32:43 (current) guix 20e984e repository URL: https://git.savannah.gnu.org/git/guix.git commit: 20e984e9311404295c9c82b54eac1c277709b0a0 $ git -C $SRC reset --hard HEAD^ HEAD is now at 86ac14b2f3 gnu: protonvpn-cli: Tweak description. $ git -C $SRC reflog expire --expire-unreachable=3Dnow --all $ git -C $SRC gc --prune=3Dnow --quiet $ git -C $SRC show 20e984e9311404295c9c82b54eac1c277709b0a0 fatal: bad object 20e984e9311404295c9c82b54eac1c277709b0a0 $ guix pull --commit=3Dc873980d18 Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'... Building from this channel: guix https://git.savannah.gnu.org/git/guix.git c873980 Computing Guix derivation for 'x86_64-linux'... / --8<---------------cut here---------------end--------------->8--- Now the same session after the introduction of '--allow-downgrades'. --8<---------------cut here---------------start------------->8--- $ guix describe Generation 37 Jun 05 2020 01:28:52 (current) guix 8bd0b53 repository URL: https://git.savannah.gnu.org/git/guix.git commit: 8bd0b533b30d7ee5e03aee99a2eb96d5b0b1c836 $ echo hello >> $SRC/README && git -C $SRC commit -am hello [master 09f6e9b34c] hello 1 file changed, 1 insertion(+) $ guix pull --commit=3D$(git -C $SRC rev-parse HEAD) Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'... Building from this channel: guix https://git.savannah.gnu.org/git/guix.git 09f6e9b Computing Guix derivation for 'x86_64-linux'... / $ guix describe Generation 38 Jun 05 2020 02:57:13 (current) guix 09f6e9b repository URL: https://git.savannah.gnu.org/git/guix.git commit: 09f6e9b34c6239bcdd8ca9e030d698b5244507a6 $ git -C $SRC reset --hard HEAD^ HEAD is now at 8bd0b533b3 gnu: libexif: Update to 0.6.22 [security fixes]. $ git -C $SRC reflog expire --expire-unreachable=3Dnow --all $ git -C $SRC gc --prune=3Dnow --quiet $ git -C $SRC show 09f6e9b34c6239bcdd8ca9e030d698b5244507a6 fatal: bad object 09f6e9b34c6239bcdd8ca9e030d698b5244507a6 $ guix pull --commit=3De451612602 --allow-downgrades Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'... guix pull: error: Git error: object not found - no match for id (09f6e9b34c6239bcdd8ca9e030d698b5244507a6) --8<---------------cut here---------------end--------------->8--- Well, I admit it is an unexpected use-case. The solution here is to '--roll-back' but it can be tedious if we are talking about several commits which had been removed in the channel by the user. Therefore, the best is to use "--list-generations" to find a generation with an existing commit and switch to it with "guix pull --switch-generation=3DNN". However, some '--news' will be lost. No free lunch. ;-) I do not think it will be worth to allow this kind of workflow but one solution could be to add a flag, i.e., '--allow-downgrade=3Ddangerous', and bypass 'commit-relation' which is somehow the culprit here. IMHO, it is better to document what to do when someone does a mistake by removing the current commit where they is currently (describe). WDYT? All the best, simon