From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 06:10:52 2018 Received: (at submit) by debbugs.gnu.org; 15 Sep 2018 10:10:52 +0000 Received: from localhost ([127.0.0.1]:41128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g17XP-0001uc-O7 for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g17XN-0001uK-1N for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g17XH-0006EU-9L for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49374) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g17XH-0006EL-4t for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g17XG-0005X1-AN for guix-patches@gnu.org; Sat, 15 Sep 2018 06:10:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g17XC-0005rf-B5 for guix-patches@gnu.org; Sat, 15 Sep 2018 06:10:42 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48273) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g17XC-0005jV-3C for guix-patches@gnu.org; Sat, 15 Sep 2018 06:10:38 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 66EDB2188F for ; Sat, 15 Sep 2018 06:10:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 15 Sep 2018 06:10:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:date:from:message-id:mime-version :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=cgU1n3 ZkGwh3FFFf8cBXq3fOdyzKVI3OiDH1vDCcbyw=; b=fpTykbY1/m2E4/tX482MEg ZKpaaDJCsTRauqos3O5uAovO1/oNHq9wGbnWP+0GkML1a2YzOr3UZbgWcHAh+vhy bW7aatYDxRNQrRfMHBqgKOVkAmlMJIdaDEvBXLvfxJl+ZxAEoSGgSmE6hIbO7ej+ m0+iZE5MjL/9Mr2b2LtA3FY1fGom/IeBvkOqQ14G5qqYgpABKsI7IRHWRdSg5Sb4 +HVJInHmQIsrU748lFgoXAWYzrsy/6SlOsFETq/fivlUMSeKFzm5DVeyQSrjdspt gih+Ql9IMsW3qtQMKuuOCjhG1c+hzg07W4tC/y04eeDYuiV7A1pJW9zOicfRNRQA == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=cgU1n3ZkGwh3FFFf8cBXq3fOdyzKVI3OiDH1vDCcb yw=; b=va042s9DKhFXHo6HU1LXXq+gDuH98MR8T4KM8IVdMob9ohtjermHY8bu1 Mf/fTrhpJiO0N3SgivztGxxuIQ+9digXX48l4gwP/+zR/087eFZ0eLyuW21/dKTd hqhE+yRB4tT3yhot7NeJY2AYGMbkXnIkKnLzrzYIfJ7qszM07Cj8CwhwkOgkRAHt fWCC01YqzGUeuj004Q7LxftRqRgqhfl8FP+kvryOIlqeiJbfgflMj8QQdSdHT7dX QdjCQsAy2UB/9BXTObTvaOlmsD/VrbW8WAzVh1xSn+PIrKc8N1O3fp3mtgGThes0 5Cv8WtXu7VLLdpyuUbXk9A9eNPSwA== X-ME-Proxy: X-ME-Sender: Received: from localhost (140.226.16.62.customer.cdi.no [62.16.226.140]) by mail.messagingengine.com (Postfix) with ESMTPA id A5A3C102D4 for ; Sat, 15 Sep 2018 06:10:35 -0400 (EDT) From: Marius Bakke To: guix-patches@gnu.org Subject: [PATCH] git-download: Don't assume the git checkout is the parent of ".git". Date: Sat, 15 Sep 2018 12:10:34 +0200 Message-Id: <20180915101034.10102-1-mbakke@fastmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit 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: -5.3 (-----) This makes it play nicely with worktrees. * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY to locate checkout. Rename from "top" to "workdir". --- Notes: Guix, This fixes (current-guix) for me in a worktree. Testing needed on other git setups! guix/git-download.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/guix/git-download.scm b/guix/git-download.scm index 24cf11be5..a7c8173f4 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -158,19 +158,22 @@ also includes directories, not just regular files. The returned file names are relative to DIRECTORY, which is not necessarily the root of the checkout." (let* ((directory (canonicalize-path directory)) (dot-git (repository-discover directory)) - (top (dirname dot-git)) (repository (repository-open dot-git)) + (workdir (canonicalize-path + ;; XXX: This variable is mistakenly private in Guile-Git 0.1.0. + ((@@ (git repository) repository-working-directory) + repository))) (head (repository-head repository)) (oid (reference-target head)) (commit (commit-lookup repository oid)) (tree (commit-tree commit)) (files (tree-list tree))) (repository-close! repository) - (if (string=? top directory) + (if (string=? workdir directory) files (let ((relative (string-append (string-drop directory - (+ 1 (string-length top))) + (+ 1 (string-length workdir))) "/"))) (filter-map (lambda (file) (and (string-prefix? relative file) -- 2.19.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 17 15:19:47 2018 Received: (at 32740) by debbugs.gnu.org; 17 Sep 2018 19:19:47 +0000 Received: from localhost ([127.0.0.1]:43373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1z3j-0005E7-0d for submit@debbugs.gnu.org; Mon, 17 Sep 2018 15:19:47 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:53643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1z3f-0005Dy-Cf for 32740@debbugs.gnu.org; Mon, 17 Sep 2018 15:19:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A538522203; Mon, 17 Sep 2018 15:19:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 17 Sep 2018 15:19:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=TlPLY6POvcVZ9WsHAF6Ws6owOg6pcmswITDg7zMfQe0=; b=fHV23 3Hdpc+OXfxI2e1PRaM5yaUDl1q0Ju6TjF6N142Js0RYWTB7SYDn5s1+KxWM13P3n rXXgmIz/okzwejUaXAssSYAl/MsWlgZdVfdlpUXpL/F1T8XS2fQEnFPi3pVRFZ15 v0t3Sg+K8gb22hG8JW3ZeGF3PvCTZBiFBpTsDI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=TlPLY6POvcVZ9WsHAF6Ws6owOg6pc mswITDg7zMfQe0=; b=hZ+zpr1pmDrhNNE8hGN0EY0FnVIe8xKWkn4rcKOlUkWfR HENjNEOll3n+rV664iQ4rp89NOYg76nCHsN/olOmHbjW1n6kJGQGcG3tM86KudMW CVMsMKDcBL3W1WGEg+gEulK5r2uRWSzVNyRNsXJ63+HcoLBigO4k86fKFCZS2Vlm weD2Vn4Ox2wJ92dpFKhqUTpagYxYINfgU8Zla8m4s8ODi9YRKxQzpKC1szdrTwZF /itgmeS9sCfos04OdP7mcbkJmQsqeljBcJHvMH+203e1BXyyrZegua4xrcr2kAoH fa17gOu7i/HVi+/5XPAYNoKNa8GSC6KJv9ymvimAQ== X-ME-Proxy: X-ME-Sender: Received: from localhost (c-76-124-202-137.hsd1.pa.comcast.net [76.124.202.137]) by mail.messagingengine.com (Postfix) with ESMTPA id AAA5AE4121; Mon, 17 Sep 2018 15:19:41 -0400 (EDT) Date: Mon, 17 Sep 2018 15:19:39 -0400 From: Leo Famulari To: Marius Bakke Subject: Re: [bug#32740] [PATCH] git-download: Don't assume the git checkout is the parent of ".git". Message-ID: <20180917191939.GA7741@jasmine.lan> References: <20180915101034.10102-1-mbakke@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <20180915101034.10102-1-mbakke@fastmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32740 Cc: 32740@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.7 (-) --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 15, 2018 at 12:10:34PM +0200, Marius Bakke wrote: > This makes it play nicely with worktrees. >=20 > * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY= to > locate checkout. Rename from "top" to "workdir". Thanks! > --- >=20 > Notes: > Guix, > =20 > This fixes (current-guix) for me in a worktree. Testing needed on ot= her git > setups! To clarify what this fixes, I tried building a fresh worktree from scratch without your patch and it crashed: ------ LOAD gnu/tests/install.scm Backtrace: In srfi/srfi-1.scm: 592:29 19 (map1 (#< type: # ?)) 592:29 18 (map1 (#< type: # ?)) 592:29 17 (map1 (#< type: # ?)) 592:29 16 (map1 (#< type: # ?)) 592:17 15 (map1 (#< type: # ?)) In ice-9/eval.scm: 196:43 14 (_ #(#(#(#) ?) ?)) 293:34 13 (_ #(#(#(#) ?) ?)) 293:34 12 (_ #(#(#(# ?)) ?)) 174:20 11 (_ #(#(#(# ?)) ?)) 177:49 10 (lp (# ?)) 177:49 9 (lp (# ?)) 177:49 8 (lp (# ?)) 177:32 7 (lp (#)) In unknown file: 6 (force #) In ice-9/eval.scm: 293:34 5 (_ #(#(# ?))) In ice-9/boot-9.scm: 829:9 4 (catch git-error # ?) In ice-9/eval.scm: 293:34 3 (_ #(#(# "/ho?"))) 293:34 2 (_ #(#(#(#(#(#(#(#(#(#(#(#) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) 159:9 1 (_ #(#(#(#(#(#(#(#(#(#(#(#) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) In unknown file: 0 (string-drop "/home/leo/tmp/mytest" 35) ERROR: In procedure string-drop: Value out of range 0 to 20: 35 ------ Your patch avoids this crash, which I was stymied by a couple days ago! Has it always been there? I've been using Guix worktrees for a while. --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAluf/kgACgkQJkb6MLrK fwiRkRAAkygHaxwgiUyYKDRaO+Ip7KzFpR80lDagpzDFd9l2mnFYV8krpOBPqcdI 886F9L/DJPjPADYtmX7s/6b4nOhSrrnUiL8dhvD7PEv3W0S6lhZH1rKQhRbZrnj1 /MXxPEuHyT3Uv8aiIgxmA6jb+pRMXGGBZzHZ6VVs1DFyRr1JN9PpWkVXceq/3gD0 lF6O6X5vOR4vc41rbGBSEhdTzCAvtl290nKCMm9f5Wpr3cgPqwJS1JrMOzBJcNry ld1ebsViD/Qzbxs8NjAUTYHhXpTteDqfDk7oDkolVTLwrzrjFI4g4JgKasf4tb6f +i3+Zy6a7PGeoRfk0dykm3TfHmUnQrnuIsh2n7T6X6frc09hwfGVc9TEofybu39x pNmXftaXmDqMIXuw5vDRD80pF66lpucHmSjfsumSmScRRQXPYwYzhWqSNH70mnlm +fEXZxcCkSXt76Rln04vQShiVSa/voJthx5WPcwCuCj6SuW5LWIWXLOAUIZelPR6 yvTMqlMwgWE6J3CXFF7Y9QCWgrloAuQCBjpGhKPqlT4oVYNlr1dfXHDzIM4K8IIh gngK6m0hUckhxDBZJOnlN/ss79a7MRvZRiPe7doqsxppa82n84N9mOHkAWW4tpX7 Bd52s8MqrePIpFNYsX5OT4wr3RK8WF+3LhNK9hA9vW/zp2kijLg= =1JAQ -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 05:48:43 2018 Received: (at 32740) by debbugs.gnu.org; 21 Sep 2018 09:48:43 +0000 Received: from localhost ([127.0.0.1]:47646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3I3G-0007WW-UL for submit@debbugs.gnu.org; Fri, 21 Sep 2018 05:48:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3I3F-0007WI-Ew for 32740@debbugs.gnu.org; Fri, 21 Sep 2018 05:48:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3I37-00037V-11 for 32740@debbugs.gnu.org; Fri, 21 Sep 2018 05:48:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3I36-00037C-TL; Fri, 21 Sep 2018 05:48:32 -0400 Received: from [193.50.110.247] (port=53446 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g3I36-0008Dk-Bh; Fri, 21 Sep 2018 05:48:32 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Marius Bakke Subject: Re: [bug#32740] [PATCH] git-download: Don't assume the git checkout is the parent of ".git". References: <20180915101034.10102-1-mbakke@fastmail.com> Date: Fri, 21 Sep 2018 11:48:29 +0200 In-Reply-To: <20180915101034.10102-1-mbakke@fastmail.com> (Marius Bakke's message of "Sat, 15 Sep 2018 12:10:34 +0200") Message-ID: <87sh235ggi.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32740 Cc: 32740@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: -6.0 (------) Hello Marius! Marius Bakke skribis: > This makes it play nicely with worktrees. > > * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY= to > locate checkout. Rename from "top" to "workdir". > --- > > Notes: > Guix, >=20=20=20=20=20 > This fixes (current-guix) for me in a worktree. Testing needed on ot= her git > setups! > > guix/git-download.scm | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/guix/git-download.scm b/guix/git-download.scm > index 24cf11be5..a7c8173f4 100644 > --- a/guix/git-download.scm > +++ b/guix/git-download.scm > @@ -158,19 +158,22 @@ also includes directories, not just regular files. = The returned file names > are relative to DIRECTORY, which is not necessarily the root of the chec= kout." > (let* ((directory (canonicalize-path directory)) > (dot-git (repository-discover directory)) > - (top (dirname dot-git)) > (repository (repository-open dot-git)) > + (workdir (canonicalize-path > + ;; XXX: This variable is mistakenly private in Gui= le-Git 0.1.0. > + ((@@ (git repository) repository-working-directory) > + repository))) I think we can avoid the call to =E2=80=98canonicalize-path=E2=80=99 here, = can=E2=80=99t we? It=E2=80=99s costly, and since we did it just above, it shouldn=E2=80=99t b= e needed here. Otherwise LGTM, thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 05:49:21 2018 Received: (at 32740) by debbugs.gnu.org; 21 Sep 2018 09:49:21 +0000 Received: from localhost ([127.0.0.1]:47651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3I3t-0007Xm-Bl for submit@debbugs.gnu.org; Fri, 21 Sep 2018 05:49:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3I3r-0007XZ-QK for 32740@debbugs.gnu.org; Fri, 21 Sep 2018 05:49:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3I3l-000426-Vp for 32740@debbugs.gnu.org; Fri, 21 Sep 2018 05:49:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3I3l-00041l-Qz; Fri, 21 Sep 2018 05:49:13 -0400 Received: from [193.50.110.247] (port=53448 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g3I3l-0008G8-Gm; Fri, 21 Sep 2018 05:49:13 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: [bug#32740] [PATCH] git-download: Don't assume the git checkout is the parent of ".git". References: <20180915101034.10102-1-mbakke@fastmail.com> <20180917191939.GA7741@jasmine.lan> Date: Fri, 21 Sep 2018 11:49:12 +0200 In-Reply-To: <20180917191939.GA7741@jasmine.lan> (Leo Famulari's message of "Mon, 17 Sep 2018 15:19:39 -0400") Message-ID: <87o9cr5gfb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32740 Cc: Marius Bakke , 32740@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: -6.0 (------) Hi Leo, Leo Famulari skribis: > Your patch avoids this crash, which I was stymied by a couple days ago! > Has it always been there? I've been using Guix worktrees for a while. I kindly introduced the bug in aed0a594058a59bc3bb1d2686391dc0e8a181b1f. :-) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 23 09:13:14 2018 Received: (at 32740) by debbugs.gnu.org; 23 Sep 2018 13:13:14 +0000 Received: from localhost ([127.0.0.1]:50368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g44CI-0001Kg-7z for submit@debbugs.gnu.org; Sun, 23 Sep 2018 09:13:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:60849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g44CG-0001KY-EG for 32740@debbugs.gnu.org; Sun, 23 Sep 2018 09:13:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 381F421AD0; Sun, 23 Sep 2018 09:13:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 23 Sep 2018 09:13:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Pw6JJvuBWRqxdSMIUdDCfuKIPUj9JMOMWBy3/RwPHg0=; b=J31RHRqh hcGebCszhAEaOBBn7wNt3Afk/b6Sk8znUNWyVCXikm6otJnebbYHAEG02f4j8j1F yMkJKSbcAyvtCCC+qRymK0nj/L8kQfLJSMxxp4SrwDwr0EW+Lx6D/vs+Ll7ZYbhk PJW7gRaShJBIW4Ynnrmktwa5Py9cyhT2e9pl7C5Vbo70laGyCmiXNKHeHCFORkn0 rK9ivq5mLBfUmKa377mCEYTHm3jfgKtcVhbTz4y7q/Lqfd3M0FldBmswu75QoBus f13BqooAXtwXRAv+pScVDU9S3QCd/8HEYPvIoYC4QDnHlZpE+dbbqTZOFMqTDvcH eS2NpTB10SBVaA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=Pw6JJvuBWRqxdSMIUdDCfuKIPUj9J MOMWBy3/RwPHg0=; b=Kb+4KKkFM0HRSkxDikk3pKg5pQd3fXbsJLP8Oxttzu2m3 aUO/ZWkNm0IUD1ItBJtRv+wpmcV3cIhUv+ANhBN263HOBqCFL44I6FdW0tajGugo +eK6U/hi96K62F4aqgiTJ42FtaDlxbTGWcbBYvGKzoRdzRjdu12LZP3jWad9w58P Rh0L0d+KUbKOADQjNlv+qziWgdn0xBpyywQJ/36NlyaRRF21m4I00M20EBFtXOKw UwpvDLoP8d1kD+5vW682enIj72QyFdKTVJxcvR5VjKwWIwo6nVi3MU5OwTrZ783p M1SdnGu/NQHqf3RB/C4wBuCgmxKqUWnZJybwTkyBw== X-ME-Proxy: X-ME-Sender: Received: from localhost (140.226.16.62.customer.cdi.no [62.16.226.140]) by mail.messagingengine.com (Postfix) with ESMTPA id 8D0C6102D6; Sun, 23 Sep 2018 09:13:11 -0400 (EDT) From: Marius Bakke To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#32740] [PATCH] git-download: Don't assume the git checkout is the parent of ".git". In-Reply-To: <87sh235ggi.fsf@gnu.org> References: <20180915101034.10102-1-mbakke@fastmail.com> <87sh235ggi.fsf@gnu.org> User-Agent: Notmuch/0.27 (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Sun, 23 Sep 2018 15:13:09 +0200 Message-ID: <87y3bsl5lm.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32740 Cc: 32740@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.7 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello Marius! > > Marius Bakke skribis: > >> This makes it play nicely with worktrees. >> >> * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTOR= Y to >> locate checkout. Rename from "top" to "workdir". >> --- >> >> Notes: >> Guix, >>=20=20=20=20=20 >> This fixes (current-guix) for me in a worktree. Testing needed on o= ther git >> setups! >> >> guix/git-download.scm | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/guix/git-download.scm b/guix/git-download.scm >> index 24cf11be5..a7c8173f4 100644 >> --- a/guix/git-download.scm >> +++ b/guix/git-download.scm >> @@ -158,19 +158,22 @@ also includes directories, not just regular files.= The returned file names >> are relative to DIRECTORY, which is not necessarily the root of the che= ckout." >> (let* ((directory (canonicalize-path directory)) >> (dot-git (repository-discover directory)) >> - (top (dirname dot-git)) >> (repository (repository-open dot-git)) >> + (workdir (canonicalize-path >> + ;; XXX: This variable is mistakenly private in Gu= ile-Git 0.1.0. >> + ((@@ (git repository) repository-working-director= y) >> + repository))) > > I think we can avoid the call to =E2=80=98canonicalize-path=E2=80=99 here= , can=E2=80=99t we? > It=E2=80=99s costly, and since we did it just above, it shouldn=E2=80=99t= be needed > here. You're right. I mostly needed it because (repository-working-directory) includes a trailing slash. This behaviour seems to be consistent, so I managed to simplify the code further by assuming that is the case: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-git-download-Don-t-assume-the-working-directory-is-t.patch Content-Transfer-Encoding: quoted-printable From=20e8b443e1de0a5b1e3dfeee024cd0625790f4f834 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 15 Sep 2018 11:53:40 +0200 Subject: [PATCH] git-download: Don't assume the working directory is the parent of ".git". * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY to locate checkout. Rename from "top" to "workdir". =2D-- guix/git-download.scm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/guix/git-download.scm b/guix/git-download.scm index 24cf11be5..eb20927c7 100644 =2D-- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -156,22 +156,21 @@ HASH-ALGO (a symbol). Use NAME as the file name, or = a generic name if #f." The result is similar to that of the 'git ls-files' command, except that it also includes directories, not just regular files. The returned file names are relative to DIRECTORY, which is not necessarily the root of the checko= ut." =2D (let* ((directory (canonicalize-path directory)) + (let* ((directory (string-append (canonicalize-path directory) "/")) (dot-git (repository-discover directory)) =2D (top (dirname dot-git)) (repository (repository-open dot-git)) + ;; XXX: This procedure is mistakenly private in Guile-Git 0.1.0. + (workdir ((@@ (git repository) repository-working-directory) + repository)) (head (repository-head repository)) (oid (reference-target head)) (commit (commit-lookup repository oid)) (tree (commit-tree commit)) (files (tree-list tree))) (repository-close! repository) =2D (if (string=3D? top directory) + (if (string=3D? workdir directory) files =2D (let ((relative (string-append =2D (string-drop directory =2D (+ 1 (string-length top))) =2D "/"))) + (let ((relative (string-drop directory (string-length workdir)))) (filter-map (lambda (file) (and (string-prefix? relative file) (string-drop file (string-length relative)))) =2D-=20 2.19.0 --=-=-= Content-Type: text/plain WDYT? --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlunkWUACgkQoqBt8qM6 VPo9lAf/TPJsRa7pJU5sQZ80ls2SGzxjuXtMNPeuiDKEwEG3pI86U1/wX+xnFyvD Vndt0rNUhmo0LPya1MyIoYFQy5pBj8R1RyhZNldthCn4maMx6/WVhITEKpnU/NJl k5y9P52j7LrZdoMq4p55UpL9QSJee3rJ0GA2sK23W2V2G2Hog1hMIwxH9WGAy6UX qCL3Lp8a3Id2d7uRy/wq9cztMTjlJ+LYahAaQggE4pSEJk2dILlgc9yHam/HfHvV jkW9BNNshF68D+aOPNn/wfBtELw5Qa/6BeVsrPoS/GACMYJAMS9ZM++kXNb7aA5o ef1Bjp0bEyZnbUqg9/V9itdbq/Rr1Q== =F3Sd -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 23 15:55:59 2018 Received: (at 32740) by debbugs.gnu.org; 23 Sep 2018 19:56:00 +0000 Received: from localhost ([127.0.0.1]:51103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4AU3-0006TW-Mz for submit@debbugs.gnu.org; Sun, 23 Sep 2018 15:55:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4AU2-0006TL-BN for 32740@debbugs.gnu.org; Sun, 23 Sep 2018 15:55:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4ATv-00068L-7r for 32740@debbugs.gnu.org; Sun, 23 Sep 2018 15:55:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4ATt-00067A-AW; Sun, 23 Sep 2018 15:55:50 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38672 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g4ATt-00058Z-2R; Sun, 23 Sep 2018 15:55:49 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Marius Bakke Subject: Re: [bug#32740] [PATCH] git-download: Don't assume the git checkout is the parent of ".git". References: <20180915101034.10102-1-mbakke@fastmail.com> <87sh235ggi.fsf@gnu.org> <87y3bsl5lm.fsf@fastmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Vend=C3=A9miaire?= an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 23 Sep 2018 21:55:47 +0200 In-Reply-To: <87y3bsl5lm.fsf@fastmail.com> (Marius Bakke's message of "Sun, 23 Sep 2018 15:13:09 +0200") Message-ID: <87d0t4rnss.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32740 Cc: 32740@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: -6.0 (------) Hello! Marius Bakke skribis: > From e8b443e1de0a5b1e3dfeee024cd0625790f4f834 Mon Sep 17 00:00:00 2001 > From: Marius Bakke > Date: Sat, 15 Sep 2018 11:53:40 +0200 > Subject: [PATCH] git-download: Don't assume the working directory is the > parent of ".git". > > * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY= to > locate checkout. Rename from "top" to "workdir". > --- > guix/git-download.scm | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/guix/git-download.scm b/guix/git-download.scm > index 24cf11be5..eb20927c7 100644 > --- a/guix/git-download.scm > +++ b/guix/git-download.scm > @@ -156,22 +156,21 @@ HASH-ALGO (a symbol). Use NAME as the file name, o= r a generic name if #f." > The result is similar to that of the 'git ls-files' command, except that= it > also includes directories, not just regular files. The returned file na= mes > are relative to DIRECTORY, which is not necessarily the root of the chec= kout." > - (let* ((directory (canonicalize-path directory)) > + (let* ((directory (string-append (canonicalize-path directory) "/")) Could you just add a comment here explaining that =E2=80=98repository-working-directory=E2=80=99 always appends a trailing sl= ash? Otherwise LGTM, thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 18:41:58 2018 Received: (at 32740-done) by debbugs.gnu.org; 25 Sep 2018 22:41:58 +0000 Received: from localhost ([127.0.0.1]:54154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4w1m-0007ef-9e for submit@debbugs.gnu.org; Tue, 25 Sep 2018 18:41:58 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4w1k-0007eW-Ng for 32740-done@debbugs.gnu.org; Tue, 25 Sep 2018 18:41:57 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8744021E13; Tue, 25 Sep 2018 18:41:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 25 Sep 2018 18:41:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Gp9tPqEB2kcYbDr44pk6nKvmbjLmWffGBB57T/D7BMw=; b=nPM5gepo L3196u+rgoy4Td6aDFy0qksI42OpYAoTmOpmFp2C873DrWI8TdZOmToaLXc8tyP1 WsHtkeiHJvB/FB0FzIoWbEuLOzLjqcOWADnXxekpJn8KwJZzDLIclTMHaV++36Qd 4yFr2VNoTMT3aGIiRhtiUolUrAd2wsG9bUaOieKLUqedumwB3qWB8gKvcVHPcpSh HB4Yi6kOnoEYjxUzoc2oxTrk4kSNBUE78myPPxZtOtQU/RdmCziP4xV3ImbAgaB5 u17JT9Df5D+qVdXsVvFvdMjvytOmFg2KRz8drRzk+3DBToVEEccigLVqTACB3QkC DcAZ2dfFIqxyEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=Gp9tPqEB2kcYbDr44pk6nKvmbjLmW ffGBB57T/D7BMw=; b=Oay2/BfJmovIr2DSr693Fv2Is659/CxBh7WmzumsDgVFa 9JdOF1pisBrBFjBtkf+E0UV4ulmE6mJXiCoZAILRT25S+Eve7/VrtIyCweJbCcr5 fPBdPKR4P0falihBNp2EK8fvSDzsxARgueA+al3+NgE7p/pzEJhpapLylClqDftM zsNyc6jd22AodeWBtKTVA4SD/WLU1s3we6oSMvL74LmoSVYHvNZ0RAUQT5Ny23Ts YYBzy8rbskT1qspo6+qWqewMcdRFbTn8+aqjmj4JVHr8+jfvWxjP97Z2fbZmOWxx DIBHcA2IqFNxF8zlCDVRLYAQOGNMmKtEr8O4LbH2w== X-ME-Proxy: X-ME-Sender: Received: from localhost (140.226.16.62.customer.cdi.no [62.16.226.140]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D8E5E4149; Tue, 25 Sep 2018 18:41:54 -0400 (EDT) From: Marius Bakke To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#32740] [PATCH] git-download: Don't assume the git checkout is the parent of ".git". In-Reply-To: <87d0t4rnss.fsf@gnu.org> References: <20180915101034.10102-1-mbakke@fastmail.com> <87sh235ggi.fsf@gnu.org> <87y3bsl5lm.fsf@fastmail.com> <87d0t4rnss.fsf@gnu.org> User-Agent: Notmuch/0.27 (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Wed, 26 Sep 2018 00:41:52 +0200 Message-ID: <87lg7pkxn3.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32740-done Cc: 32740-done@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.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello! > > Marius Bakke skribis: > >> From e8b443e1de0a5b1e3dfeee024cd0625790f4f834 Mon Sep 17 00:00:00 2001 >> From: Marius Bakke >> Date: Sat, 15 Sep 2018 11:53:40 +0200 >> Subject: [PATCH] git-download: Don't assume the working directory is the >> parent of ".git". >> >> * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTOR= Y to >> locate checkout. Rename from "top" to "workdir". >> --- >> guix/git-download.scm | 13 ++++++------- >> 1 file changed, 6 insertions(+), 7 deletions(-) >> >> diff --git a/guix/git-download.scm b/guix/git-download.scm >> index 24cf11be5..eb20927c7 100644 >> --- a/guix/git-download.scm >> +++ b/guix/git-download.scm >> @@ -156,22 +156,21 @@ HASH-ALGO (a symbol). Use NAME as the file name, = or a generic name if #f." >> The result is similar to that of the 'git ls-files' command, except tha= t it >> also includes directories, not just regular files. The returned file n= ames >> are relative to DIRECTORY, which is not necessarily the root of the che= ckout." >> - (let* ((directory (canonicalize-path directory)) >> + (let* ((directory (string-append (canonicalize-path directory) "/")) > > Could you just add a comment here explaining that > =E2=80=98repository-working-directory=E2=80=99 always appends a trailing = slash? Good idea. > Otherwise LGTM, thank you! Pushed as 280fc8351230a8fea086d9bbce919ba8395f312c, thanks! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAluqubAACgkQoqBt8qM6 VPrqUQf+INwcG095FB4qf3gOCStrlA4/104C86u89OzRvjJ/yAu1Pp1q0smIgTlT sWKOw4JbBypMeAJW1t1OXpOMA/igFEoWtg4v8IyB2A6bIS57+m8bA3f190f5Y5oz +hk4Irw5+3tAD1uv0eZiPhyJZAr4y/+8hMI6Gi65f0VuDS/IulrYxyylM+tGcFMh bzbPL7fJzeXsE8gZ63R3g59h+FfBI3PQkYpr7Ns/XInMo7zkdtizqbaOWuZArehb rMd8nxMeoIyY1dxg82i5uNKX10DAzGuvVTRcNksdXwgZokeoD178Nb+wI8rutPyn wYyVeVFcfAg+5fhq+NHJbORiZpYckw== =0BV1 -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Sep 06 13:45:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 24 Oct 2018 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator