From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 11 15:43:14 2020 Received: (at 43893) by debbugs.gnu.org; 11 Oct 2020 19:43:14 +0000 Received: from localhost ([127.0.0.1]:41074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRhFS-0000jP-2q for submit@debbugs.gnu.org; Sun, 11 Oct 2020 15:43:14 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:37122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRhFQ-0000jA-MA for 43893@debbugs.gnu.org; Sun, 11 Oct 2020 15:43:13 -0400 Received: by mail-qt1-f194.google.com with SMTP id h19so2125878qtq.4 for <43893@debbugs.gnu.org>; Sun, 11 Oct 2020 12:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Sakn7RVGxxkBe6d1+xBbSld54ZPRyhpslk7w8zgcFIY=; b=I3EDsIz/znOqUyr4AKO8fFqJyDOwHKwVBs83Rq+MpYWvkQk3nz4XRkgVods7/VWxtO DA3fnPgj9/ICJj8u/42kzgtadOfBGioyhSQ8Lvx+FiT6qXubwNUpcuDSSYCshl58qcC2 LOEtaFT3fVyJDIExb4rNpaQTFj0MlDC5/yFq9h8qfpL3ybhwxhz0QB6dp9aepempbg74 Co2bv1xNd4YobI7TuSTJfleubji3J47OSw2jviNgTUBdHKtaJuMJZQKnqVFEBy+Z4Ns+ 01de94P15YAEkYzXA3VOBk0K0rbI6hYnrNAFnvXCkEgbBqRojQQ3vmIIutCLfEcxFunJ JEqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Sakn7RVGxxkBe6d1+xBbSld54ZPRyhpslk7w8zgcFIY=; b=oiT85uLayydUE+KLqr1TW+3ElejQNqUObgh5579cINlvXtGLuMqxvN3vrr5B+Sv5w4 9DhrIcxMb3t6KPQ01UoQ2hwlBecBD2SBu0XOYXWlkVpaYdSC9O2xAUB0B71sfp7oRUfL 66tDWfH96t780NpDKSs+diJq3LPTX03Q66/dIJO+/Wen4rd9E1emTnXCqOkCls+aeTOu 3VErfdnDag7ej2B0UGmtFZ1uTGCyo42UAH1VoFRn4JHd01G0c6glXgnv8MVvLKjuZ2sq 4V+c7d3q+ojDeFeDsVsEfI3uSKJm/OIlhBy9l90t/G8T5DoJcMpQhtbUwvbS8tycyotG AAqg== X-Gm-Message-State: AOAM533UygeVMnsNibH90U9gG7n7BS+OrSSGW8ix38rJ2WQUp3BWbzhx ueUdOCV6NZOPwMKJX5EP48FC1ekA5dY= X-Google-Smtp-Source: ABdhPJzAZwSgnEC8gsjaOcJgfY1VVFQ/KgJTlVFK+cLwTTqdmNdgbEvDdOGRFwhFOxkSEaxoSKpw8Q== X-Received: by 2002:ac8:5649:: with SMTP id 9mr7071289qtt.109.1602445386824; Sun, 11 Oct 2020 12:43:06 -0700 (PDT) Received: from hurd (dsl-10-136-39.b2b2c.ca. [72.10.136.39]) by smtp.gmail.com with ESMTPSA id t2sm11325456qti.25.2020.10.11.12.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:43:06 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#43893: [PATCH] maint: update-guix-package: Ensure sources are clean. References: <87eem7qcxc.fsf@gmail.com> <20201010050852.19975-1-maxim.cournoyer@gmail.com> <871ri5j13g.fsf@gnu.org> Date: Sun, 11 Oct 2020 15:43:05 -0400 In-Reply-To: <871ri5j13g.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 10 Oct 2020 22:08:19 +0200") Message-ID: <875z7gtupi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 43893 Cc: 43893@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello! Ludovic Court=C3=A8s writes: [...] >> * build-aux/update-guix-package.scm (git-add-worktree): New procedure. >> (main): Use it to checkout a clean copy of the used commit, and compute = the >> hash from it. Print a user warning after completion. > > I=E2=80=99m not quite enthusiastic about the tool creating a worktree beh= ind my > back. May I ask why? It's not something you'd (need to) be aware of (it doesn't leave traces in my v2 as 'git worktree prune' clears up the temporary worktree entries), and it's quite cheap to create. >> - ;; Re-add SOURCE to the store, but this time under the real na= me used >> - ;; in the 'origin'. This allows us to build the package witho= ut >> - ;; having to make a real checkout; thus, it also works when wo= rking >> - ;; on a private branch. > > So this preserves this possibility, right? Yes. [...] > I could also suggest running =E2=80=98guix build guix --check=E2=80=99. > > Honestly, I would simply add this last message; better yet, we could use > Guile-Git to (1) check whether we=E2=80=99re on a dirty tree and stop rig= ht away > if we are Using the worktree approach, checking for local changes is made unnecessary; as long as the tool clearly says which commit will be used for the updated Guix package, I don't see why we should force the developer to stash their changes (in the same way git checkout doesn't forces you to do so in the absence of conflicts). Also, this bug reported was triggered by something like: --8<---------------cut here---------------start------------->8--- echo ";;some comment" >> .dir-locals \ && git update-index --skip-worktree .dir-locals \ && make update-guix-package) --8<---------------cut here---------------end--------------->8--- leading 'update-guix-package' to produce a wrong hash. Git has been told to ignore changes on .dir-locals so checking for changes would not have been sufficient (you'd also need to 'git ls-files -v' and interpret the result). > and (2) check whether the commit exists in the official Git > repo and error out if it doesn=E2=80=99t, unless > GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set. That's a good idea; implemented in the v2 patch I'm about to send. Thanks, Maxim