From unknown Sat Aug 09 04:53:29 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#30450 <30450@debbugs.gnu.org> To: bug#30450 <30450@debbugs.gnu.org> Subject: Status: [PATCH] git-download: Fetch only the required commit, if possible. Reply-To: bug#30450 <30450@debbugs.gnu.org> Date: Sat, 09 Aug 2025 11:53:29 +0000 retitle 30450 [PATCH] git-download: Fetch only the required commit, if poss= ible. reassign 30450 guix-patches submitter 30450 Danny Milosavljevic severity 30450 normal tag 30450 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 13 18:54:39 2018 Received: (at submit) by debbugs.gnu.org; 13 Feb 2018 23:54:39 +0000 Received: from localhost ([127.0.0.1]:41946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elkPH-0007eR-6P for submit@debbugs.gnu.org; Tue, 13 Feb 2018 18:54:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elkPF-0007eF-Oe for submit@debbugs.gnu.org; Tue, 13 Feb 2018 18:54:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elkP9-0001kP-Pq for submit@debbugs.gnu.org; Tue, 13 Feb 2018 18:54:32 -0500 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 lists.gnu.org ([2001:4830:134:3::11]:60961) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elkP9-0001kC-MN for submit@debbugs.gnu.org; Tue, 13 Feb 2018 18:54:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elkP8-0001LC-BB for guix-patches@gnu.org; Tue, 13 Feb 2018 18:54:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elkP3-0001h0-G6 for guix-patches@gnu.org; Tue, 13 Feb 2018 18:54:30 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:36120) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elkP3-0001ft-8I for guix-patches@gnu.org; Tue, 13 Feb 2018 18:54:25 -0500 Received: from dayas.3.home (77.118.165.203.wireless.dyn.drei.com [77.118.165.203]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 7CDFC3360A1F; Wed, 14 Feb 2018 00:54:22 +0100 (CET) From: Danny Milosavljevic To: guix-patches@gnu.org Subject: [PATCH] git-download: Fetch only the required commit, if possible. Date: Wed, 14 Feb 2018 00:54:01 +0100 Message-Id: <20180213235401.18358-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.15.1 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Danny Milosavljevic 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.0 (-----) * guix/build/git.scm (git-fetch): Fetch only the required commit, if possible. --- guix/build/git.scm | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/guix/build/git.scm b/guix/build/git.scm index c1af545a7..14d415a6f 100644 --- a/guix/build/git.scm +++ b/guix/build/git.scm @@ -37,28 +37,31 @@ recursively. Return #t on success, #f otherwise." ;; in advance anyway. (setenv "GIT_SSL_NO_VERIFY" "true") - ;; We cannot use "git clone --recursive" since the following "git checkout" - ;; effectively removes sub-module checkouts as of Git 2.6.3. - (and (zero? (system* git-command "clone" url directory)) - (with-directory-excursion directory - (system* git-command "tag" "-l") - (and (zero? (system* git-command "checkout" commit)) - (begin - (when recursive? - ;; Now is the time to fetch sub-modules. - (unless (zero? (system* git-command "submodule" "update" + (mkdir-p directory) + + (with-directory-excursion directory + (invoke git-command "init") + (invoke git-command "remote" "add" "origin" url) + (if (zero? (system* git-command "fetch" "--depth" "1" "origin" commit)) + (invoke git-command "checkout" "FETCH_HEAD") + (begin + (invoke git-command "fetch" "origin") + (invoke git-command "checkout" commit))) + (when recursive? + ;; Now is the time to fetch sub-modules. + (unless (zero? (system* git-command "submodule" "update" "--init" "--recursive")) - (error "failed to fetch sub-modules" url)) + (error "failed to fetch sub-modules" url)) - ;; In sub-modules, '.git' is a flat file, not a directory, - ;; so we can use 'find-files' here. - (for-each delete-file-recursively - (find-files directory "^\\.git$"))) + ;; In sub-modules, '.git' is a flat file, not a directory, + ;; so we can use 'find-files' here. + (for-each delete-file-recursively + (find-files directory "^\\.git$"))) - ;; The contents of '.git' vary as a function of the current - ;; status of the Git repo. Since we want a fixed output, this - ;; directory needs to be taken out. - (delete-file-recursively ".git") - #t))))) + ;; The contents of '.git' vary as a function of the current + ;; status of the Git repo. Since we want a fixed output, this + ;; directory needs to be taken out. + (delete-file-recursively ".git") + #t)) ;;; git.scm ends here From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 11:52:44 2018 Received: (at control) by debbugs.gnu.org; 4 Mar 2018 16:52:44 +0000 Received: from localhost ([127.0.0.1]:44608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esWsO-0005XV-1t for submit@debbugs.gnu.org; Sun, 04 Mar 2018 11:52:44 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:55066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esWsM-0005XN-IM for control@debbugs.gnu.org; Sun, 04 Mar 2018 11:52:43 -0500 Received: from localhost (80-108-65-216.cable.dynamic.surfer.at [80.108.65.216]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 28F923367616 for ; Sun, 4 Mar 2018 17:52:41 +0100 (CET) Date: Sun, 4 Mar 2018 17:52:37 +0100 From: Danny Milosavljevic To: Message-ID: <20180304175237.2f8a7a7a@scratchpost.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/UzNCQ+Bz2HxKRO1axnd1Xue"; protocol="application/pgp-signature" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 30450 close 30050 [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control 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.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 30450 close 30050 [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject --Sig_/UzNCQ+Bz2HxKRO1axnd1Xue Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable close 30450 close 30050 --Sig_/UzNCQ+Bz2HxKRO1axnd1Xue Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlqcJFUACgkQ5xo1VCww uqUovAf/XUKLwDbHTLpj+CtYAaZxUHfpJDMCbEVuiCn0ORbEhD4A6RBaJMDL5tKf SV7xK0MIGrf/VSdn4pVQAKPDMXufU949Ahu+tCXdZ5uYeUmfZZSV7I4vfazqe5f9 OVVYVAgZd0O8WcS3umDUjHW8S819otM4vkt0/QqYMbpxkLJPyBMo+Y7RHfFJOM3W oGZEnEKljYETRnL1clZiTJ/aFh6PZTRgKdjytVFP3f+TtufUlToA1ygueEqxrRbj pJtE5y82GIFyiYBomVUmNw6sW/gzEKHqTBko4VFlbv4847s3atfEqZAF7udndLtm sUY3FfZdOMH249vsQbeC7waR+oP0+A== =oDsG -----END PGP SIGNATURE----- --Sig_/UzNCQ+Bz2HxKRO1axnd1Xue-- From unknown Sat Aug 09 04:53:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 02 Apr 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